I need to profile a program with callgrind which is started by some script, I don't have control over. I can tell the script to start valgrind, but I cant tell the script which tools or parameters to use.
I found in the valgrind manual (section 2.7.7, "Setting Default Options"), that it is possible to use a variable $VALGRIND_OPTS, or a .valgrindrc file.This works for tool specific options. For instance, I can write in the ~/.valgrindrc
--callgrind:callgrind-out-file=<somefile>And when I execute some test program a.out
valgrind --tool=callgrind a.outthe output file is written as defined in .valgrindrc.But I can't specify the tool (callgrind) I want to use.
I have tried:
--tool=callgrindand
--valgrind:tool=callgrindBoth have no effect and memcheck is started as default.Any hints would be appreciated!