Linux perf
tools (some time ago named perf_events
) has several builtin universal software events. Two most basic of them are: task-clock
a
According to this message, they measure the same thing.
They just differ in when they sample.
cpu-clock is wall-clock based -- so samples are taken at regular intervals relative to walltime. I believe that task-clock is relative to the task run time. So, samples are taken at regular intervals relative to the process' runtime.
When I run it on my multi-threaded app, it indeed shows nearly identical values.