Perfcounters added to the mainline
Posted Jul 5, 2009 10:41 UTC (Sun) by mingo
Parent article: Perfcounters added to the mainline
$ perf top -c 1000 -p 3216
This is a static version of the output from looking at a largely quiescent firefox process (pid 3216), sampling every 1000 cycles.
A sidenote: for the profiling of largely idle workloads one can use 'auto-frequency counters'. These are counters where the kernel does not used a fixed period sampling, but adapts dynamically to the workload's intensity.
This can be done via the -F/--freq parameter to perf record and perf top:
$ perf top -F 1000 -p $(pidof firefox-bin)
This will sample Firefox with 1KHz, regardless of its intensity. If Firefox executes a lot then the cyclce-sampling intervals increase automatically - if Firefox is more idle then they shorten.
(All the perf tools handle such type of 'dynamic samples' correctly so the resulting profile will not be skewed by workload fluctuations.)
The advantage of auto-freq counters is convenience: one does not have to guess '1000 cycles' magic interval that you had to use in your example above (you probably first tried the default 100,000 cycles - then saw that no output was coming then you went down to 10,000 and then to 1000?) - and the sampling will also be more workload-uniform.
to post comments)