开发者

gprof - File is missing call-graph data

开发者 https://www.devze.com 2023-04-11 22:11 出处:网络
I\'m just starting out with gprof and am trying to generate a call graph. I\'m using cmake for setting up my makefiles and I\'m setting CMAKE_EXE_LINKER_FLAGS = -gp to enable profil开发者_StackOverflo

I'm just starting out with gprof and am trying to generate a call graph. I'm using cmake for setting up my makefiles and I'm setting CMAKE_EXE_LINKER_FLAGS = -gp to enable profil开发者_StackOverflowing. The only cxx flags I have enabled is -g.

Then I simply call gprof on my gmon.out file.

The generated output file has only a flat profile within which the calls, self ts/call and total ts/call are all empty.

More importantly, it doesn't generate a call-graph. If I try to explicitly provide -q while running gprof to generate the call-graph it says 'File is missing call-graph data'.

I'm not sure what I'm doing wrong here and would appreciate pointers on getting this fixed.

Thanks.


The proper switch for profiling is -pg, not -gp. Is this what you're doing?


Possibly missing -pg when linking?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号