Gleipnir How-To Guide

If you are unfamiliar with Valgrind we suggest that you at least get a basic understanding of how Valgrind works.

Basic Run

Let's get a basic understanding of Gleipnir's output by running the following code:

Compile the code with debug options enabled

 $ gcc -g code.c -o code.out 

Assuming everything compiled and is running you can run gleipnir as follows:

 $ $valgrind/src/bin/valgrind --read-var-info=yes --tool=gleipnir ./path/code.out 

You should see the following output

Gleipnir will generate a trace file in the form gleipnir.pid; where pid is the process ID.

The trace files can get rather large, this simple program produced a ~4MB trace file with roughly ~150k lines.
These traces are Load, Store and Instruction traces interleaved, if it is of little interest then the Instruction traces may be suppressed.

To get an idea of Gleipnir's output, look at the trace snippet below:

The traces are all the instructions (and a few extra :-/) which were executed during the code.out program run. Their virtual addresses are mapped back to their source code variables. The idea is to use these traces in trace driven cache simulators to produce graphical analyses of an application's cache behavior.

As part of the Gleipnir tool-set we have modified DineroIV for our purposes of cache simulation.