what is the best tool to do profiling for c++ multi threaded server daemon on Linux?

Bvm 18
Bvm 18 used Ask the Experts™
on
what is the best tool to do profiling for c++ multi threaded server daemon on Linux?

Complied program with -pg and the tried with gprof/gmon.out. Couldn't find call graph as per functions mentioned in my program. It has shown all low level api's call graph like string internals, memory allocations..etc.

Can someone suggest how to get call graph from gmon.out for multi threaded server daemon.

Any other tool(s)?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I used Valgrind a few years ago.
http://valgrind.org/
http://valgrind.org/info/tools.html


Nice graphs produced with KCachegrind:
Available separately is an amazing visualisation tool, KCachegrind, which gives a much better overview of the data that Callgrind collects
https://kcachegrind.github.io/html/Home.html
https://kcachegrind.github.io/html/Shot3.html
murugesandinsShell_script Automation /bin/bash /bin/bash.exe /bin/ksh /bin/mksh.exe AIX C C++ CYGWIN_NT HP-UX Linux MINGW32 MINGW64 SunOS Windows_NT
Commented:
I like
gdb / dbx
Sample from https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_24.html
>> -g option is required to debug running or new programs.
>> Remove -O or -O2  or -O1 or -O3 options during compilation
/usr/bin/g++ -g -Wall server.c -o ./server

/usr/bin/gdb -q server
or
/usr/bin/gdb -q server -p pid
Inside gdb use
(gdb) info threads
(gdb) thread 1
or
(gdb) thread 2
...

Used dbx (AIX) four years ago.
If cygwin installed you can use gdb.exe
murugesandinsShell_script Automation /bin/bash /bin/bash.exe /bin/ksh /bin/mksh.exe AIX C C++ CYGWIN_NT HP-UX Linux MINGW32 MINGW64 SunOS Windows_NT

Commented:
$ echo "If query being resolved,
close/assist this query. Most welcome. " | /usr/bin/wc
      2       9      65
$

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial