I want to profile my code. So I do:
valgrind --tool=callgrind my_program [programm arguments]
kcachegrind callgrind.out.x
Now I have kcachegrind
window like this:
There is a lot of core and library functions, but how can I set up valgrind
or kcachegrind
to trace only functions are in my code (which, of course, call library functions)?
The expected output is something like that:
time number of calls function_name()
4,52% 569854 CSim2Sim my_function1(int argc, char* argv[])
3,52% 452158 CSim2Sim my_function2(int argc, char* argv[])
3,52% 36569 CSim2Sim my_function3(int argc, char* argv[])
1,52% 1258 CSim2Sim my_function4(int argc, char* argv[])