What profiler should I use to measure _real_ time (including waiting for syscalls) spend in this function, not _CPU_ one

前端 未结 2 879
Happy的楠姐
Happy的楠姐 2021-01-21 02:52

The application does not calculate things, but does i/o, read files, uses network. I want profiler to show it.

I expect something like something like in callgrind that c

2条回答
  •  花落未央
    2021-01-21 03:30

    Quickly hacked up trivial sampling profiler for linux: http://vi-server.org/vi/simple_sampling_profiler.html

    It appends backtrace(3) to a file on SIGUSR1, and then converts it to annotated source.

    As it probes the program periodically, we'll see functions that waits for something.

    And as it walks the stack, we'll see callers too.

    Also people from answers to similar questions recommends Zoom.

提交回复
热议问题