linux perf: how to interpret and find hotspots

前端 未结 5 1828
说谎
说谎 2020-11-28 21:14

I tried out linux\' perf utility today and am having trouble in interpreting its results. I\'m used to valgrind\'s callgrind which is of course a totally different approach

5条回答
  •  盖世英雄少女心
    2020-11-28 21:52

    Ok, these functions might be slow, but how do I find out where they are getting called from? As all these hotspots lie in external libraries I see no way to optimize my code.

    Are you sure that your application someapp is built with the gcc option -fno-omit-frame-pointer (and possibly its dependant libraries) ? Something like this:

    g++ -m64 -fno-omit-frame-pointer -g main.cpp
    

提交回复
热议问题