3

I need to profile my c++ application which starts with spawn-fcgi. I tried to use callgrind but callgrind output in KCachegrind is not showing any information of my applications.

valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes --demangle=no --trace-children=yes --callgrind-out-file=%p spawn-fcgi -s /tmp/sock.tmp ./myApp arg1 arg2

This command creates two files 10012 and 10013, but second file is empty. First file have function informations for location spawn-fcgi, ld-2.*.so amd libc.

Please suggest correct option to get profiling information for my application.

Anurag
  • 117
  • 1
  • 13

1 Answers1

2

I experienced similar behaviour when profiled fastcgi process crashed on exit (so statistics isn't dumped on termination with SIGSEGV).

I used callgrind_control tool to dump statistics at arbitrary point of time:

callgrind_control --dump

Also you can stop gathering statistics with callgrind_control -i off, reenable with callgrind_control -i on, reset with callgrind_control -z.

See callgrind_control manual for details http://valgrind.org/docs/manual/cl-manual.html .

rutsky
  • 3,900
  • 2
  • 31
  • 30