2021年4月13日星期二

Generate function call-graph by valgrind

sudo apt install kcachegrind valgrind 


Build compiler flags:

CFLAGS / CPPFLAGS: -g (or -ggdb3 -O0)


# Generate a callgrind.out.<PID> file.
valgrind --tool=callgrind ./main


 # Generate the callgrind.out.<PID> files per thread.
valgrind --tool=callgrind --separate-threads=yes  ./main


# Open a GUI tool to visualize call graph
kcachegrind callgrind.out.<PID>


沒有留言:

發佈留言