valgrindcallgrindkcachegrind

Callgrind: how to pass relative path to source code?


I'm using valgrind's callgrind to profile a program and then kcachegrind to view the profile data. I've copied callgrind's output file to a different machine and have a copy of the source code there, but apparently the path information of the source code is baked into callgrind's format. This means kcachegrind is looking in the wrong place:

enter image description here

Is there a way to pass a relative source code path so that I can profile the program on one machine but then transport the profiling data to another machine and still view the source code?


Solution

  • I had originally tried the sed route and that didn't work. But I looked at that solution again and the problem was that paths with '~' don't work with kcachegrind it seems.