oprofile is more accurate; It uses processor performance monitoring (built-in hardware monitoring with 100 second performance events);
and google-perftools libprofiler.so uses setitimer- the kernel kernel intreval timer:
$ nm -D libprofiler.so | grep timer
U getitimer
U setitimer
HZ, (100 1000 300 250). 10000, 100000, 1000 ( 2 , 2000 , cpu profiler google). HZ:
$ zgrep HZ= /proc/config.gz
CONFIG_HZ=1000
, ββ .
, oprofile CPU, . , , 100000 1000000 , HZ. , N- , N- L2 N-th jmp ..... CPU Pentium Pro.
oprofile , , ββ .
oprofile , root (AFAIK), ; ( ).
google-perftools: ; ; . , google-perftools .
oprofile google-perftools/cpuprofiler:
- ( gprof/gcov)
- callgraph (, kcachegind, 1 2; pprof kcachegrind
callgrind) - ( , kcachegrind/callgrind/other valgrind)
- portable (oprofile CPU, intel/amd/through/many, perftools , callstack setitimer)