Performance profiling on Linux

后端 未结 10 1958
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-23 23:40

What are the best tools for profiling C/C++ applications on *nix?

(I\'m hoping to profile a server that is a mix of (blocking) file IO, epoll for network and fork()/

10条回答
  •  臣服心动
    2020-12-24 00:05

    Allinea MAP is a profiler for C++ and other native languages on Linux. It is commercially supported by my employer. It has a graphical interface and source-line level profiling and profiles code with almost no slowdown which makes it very accurate where timing of other subsystems is relevant - such as for IO.

    Callgrind has been useful and accurate - but the slowdown was ~5x so I could only do smaller runs. It can actually count the number of times a function is called which is useful for understanding asymptotic behavior.

提交回复
热议问题