## 1. Introduction

## 1.1. An Overview of Valkyrie

Valkyrie is a graphical front-end to the Valgrind suite of tools for debugging and profiling Linux executables. The current version supports Valgrind from version 3.3.0. Currently, the only supported Valgrind tool is Memcheck.

Valkyrie uses the Qt widget library, and should run on most reasonably recent Linux setups. The only sine qua non is that you must have:

- Qt v.3.2.0 or higher (but not Qt v.4 as yet), and

- Valgrind v.3.3.0 or higher.

Valkyrie also contains a program vk_logmerge. Given multiple log files (in xml format) generated by multiple runs on a parallel machine, or multiple log files generated by sequential runs on a single-processor machine, for the same binary, vk_logmerge merges the log files together, summing the counts of duplicates, and outputs the result to a single file. As input, vk_logmerge expects the log-files to-be-merged and/or a file containing the list of log-files to-be-merged, with each entry on a separate line. Log files can be merged from within Valkyrie, or you can use it in non-gui mode by invoking it thusly:

      vk_logmerge -f <log-file-list> [-o <output-file>]

      vk_logmerge log1.xml log2.xml [-o <output-file>]

Issue the command:

      valkyrie -h | --help

to see a list of command-line flags.

Valkyrie can be started with flags on the command-line. Below are some examples of common usage.

- `valkyrie --view-log=log.xml`

  will start up the graphical user interface, with log-file-to-view in the process of being loaded.

- `valkyrie --merge=tomerge.loglst`

  will start up the user interface, with log-file-list in the process of being merged.

- `valkyrie /bin/ls -lF`

  will start up the user interface. This command differs from the above two in that Valgrind is being called to run the executable ls. Currently only Memcheck is supported, so this is the tool used on the executable.

- You can give many of the Valgrind flag(s) on the command line:

  `valkyrie --smc-check=none --pointercheck=yes /bin/ls -lF`

  Some options are currently disabled, however, as Valgrind presets these options when producing XML output, which Valkyrie requires. Valkyrie also disables options that would interfere with the gathering of Valgrind's output, such as logging options.

See the Options Dialog pages for more information on setting and saving the various flags, options and preferences.

Below is an example screenshot of the result of running `valkyrie xclock`

An error is opened up for scrutiny. If the file in which the error occurred has read and/or write permissions, and Valgrind was able to determine the /path/to/the/file, an icon will be displayed. If you have write permission on the file, the icon will show a pencil; otherwise it will not. Double-clicking on this icon will launch an editor with the file loaded at the line where the error occurred.

If you do not have read and/or write permissions on the file, the error will still be displayed, but you will not be able to launch an editor.

Just as when running a client program directly under Valgrind, the client program retains input/output with the terminal in which Valkyrie was started. You could, for example, run ssh under Valkryie:
`valkyrie ssh hostname`
and all input/output should pass through transparently. Any output from Valkyrie (for example if an error occured) is prefixed by "===valkyrie:pid===".