callgrind output in specific file
Asked Answered
E

2

6

I want to redirect the output of callgrind to a file name call_grind.txt, but when ever I try to do that, a file is generated but there is no output inside that file.

For example:

valgrind --tool=callgrind --callgrind-out-file=/tmp/call_grind.txt <program name>

Also, I'm not getting any callgrind.out.<pid> file in my system where it should normally be located.

According to my understanding, if I run the below command it should create the callgrind.out.<pid> file:

valgrind --tool=callgrind <program name>

So, how do I use the tool and also how to read the output file?

Eckhardt answered 20/7, 2015 at 10:52 Comment(0)
A
5

The callgrind.out.<pid> or the file you specified with --callgrind-out-file will be created if valgrind finished running successfully. Check the process exit code to make sure it is 0 to see if succeeded.

Apetalous answered 20/7, 2015 at 13:11 Comment(0)
A
0

You can also use callgrind_control -d to explicitly flush the output.

callgrind_control also allows you to control when to start/stop instrumentation (and a couple other things)

Auguste answered 4/11, 2020 at 21:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.