Linux perf events would be an order of magnitude more useful IF THERE WERE ANY REAL DOCUMENTATION.

Not to denigrate the heroic effort behind the creation of the perf_even_open man page, where is the event documentation? What do they MEAN?

What, even, is the difference between PERF_COUNT_SW_CPU_CLOCK and PERF_COUNT_SW_TASK_CLOCK? No one seems to be able to give a definitive answer.

And while I'm at it, why is PAPI stuck in an AUR on Arch?!

  • 1
    His Papi went to AUR to get some milk 15 years ago....
    Still not back
  • 2
    SO says that CPU_CLOCK version is broken and should not be used. CPU_CLOCK was intended to be used as wall-clock (the amount of time the task was hanging around in the tasks list), and the TASK_CLOCK should show how long has that task been in RUNNING state (i.e. being actually processed).

    The example with `sleep 1` is very clear IMO.

    TBH I'd name them the other way around. That might be more intuitive: CPU_CL being the CPU time spent on the task and TASK_CL - amount of time the task was lurking in the tasks list.
  • 0
    @netikras I've read that SO answer, and I'm sure it's a part-answer, or is a complete-at-some-point-in-time answer. There are mailing list posts that contradict it, or at least, may reflect what the event meant at a different point in time.

    I think the only way to be sure is to read the kernel source (for a version one cares about) and work backwards.
Add Comment