我想使用 valgrind 进行一些分析,因为它不需要重新构建程序。 (我想分析的程序已经用“-g”构建了)
但是 valgrind(callgrind) 很慢......所以这是我要做的:
我可以在 Solaris 上使用 sun studio 做这种事情。 (使用 dbx )。我只想知道是否可以使用 valgrind(callgrind) 做同样的事情?
谢谢
最佳答案
你应该看看callgrind documentation ,并阅读有关 callgrind_control 的信息。
valgrind --tool=callgrind --instr-atstart=no your_server.x
callgrind_control -i on
callgrind_control -i off
关于profiling - 如何使用 callgrind 仅分析特定时间段的程序执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2400025/