Linux perf events: cpu-clock and task-clock - what is the difference

后端 未结 3 1715
悲哀的现实
悲哀的现实 2021-01-30 21:08

Linux perf tools (some time ago named perf_events) has several builtin universal software events. Two most basic of them are: task-clock a

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 21:57

    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.

提交回复
热议问题