Performance profiling on Linux

后端 未结 10 1940
爱一瞬间的悲伤
爱一瞬间的悲伤 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:02

    If you can take your application to freeBSD, OS X , or Solaris you can use dtrace, although dtrace is an analyst oriented tool -- i.e., you need to drive it -- read: script it. Nothing else can give you the level of granularity you need; Dtrace can not just profile the latencies of function calls in user-land; it can also follow a context switch into the kernel.

提交回复
热议问题