Skip to content
The Signal Belfry

/static/campanario/en/sino/sigprof/

Menu

SIG-019 · Clocks

SIGPROF

The profilers' metronome: a steady tick in CPU time, user plus system.

The family's third clock adds the time in user mode to the time the kernel spends on the process's behalf. Armed with a short interval, it becomes a metronome: at every tick, the handler notes where the program was.

It is the foundation of the statistical profilers of the gprof era: thousands of samples of the program counter paint the portrait of where the time went. Modern tools prefer perf and the hardware, but the bell is still in the tower.

$ ./servidor-perfilado
$ gprof ./servidor-perfilado gmon.out | head -4
Flat profile:
  %   cumulative   self
 time   seconds   seconds  name
 62.1      1.24      1.24  parse_request
Every tick a sample; many samples, a portrait.