Which profiler should use to measure _real_ time (including waiting for system calls) in this function, not _CPU_ one

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

I expect something like something like callgrind that calls clock_gettime every time.

Or like an oprofile that interrupts my application (while it is sleeping or waiting for a socket / file / something else) to see what it is doing.

I need things like "read", "connect", "nanosleep", "send" and especially "fsync" ( And all of their callers ) to be bold (not like a string or function number that does the calculations).

Platform: GNU / Linux @ i386

+3
source share
2 answers

Quickly hack trivial proxy server for linux: http://vi-server.org/vi/simple_sampling_profiler.html

It adds backtrace(3)to the file on SIGUSR1, and then converts it to an annotated source.

Since he periodically checks the program, we will see functions that are waiting for something.

And when he goes on the stack, we will also see the callers.

Also, people from the answers to such questions recommend Zoom.

+2
source

There is no real way to answer this question without knowing your platform and a little more about what you are trying to do.

Intel, Time Stamp Counter (RDTSC). . .

0

All Articles