diff options
| author | Dapeng Mi <[email protected]> | 2025-11-12 08:05:26 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2025-11-20 09:42:12 +0000 |
| commit | f1f96511b1c4c33e53f05909dd267878e0643a9a (patch) | |
| tree | 8f738b45bc953bbfee51f9e444453ba69a568f62 /lib/mpi/mpi-mod.c | |
| parent | perf/x86/intel/uncore: Remove superfluous check (diff) | |
| download | kernel-f1f96511b1c4c33e53f05909dd267878e0643a9a.tar.gz kernel-f1f96511b1c4c33e53f05909dd267878e0643a9a.zip | |
perf: Fix 0 count issue of cpu-clock
Currently cpu-clock event always returns 0 count, e.g.,
perf stat -e cpu-clock -- sleep 1
Performance counter stats for 'sleep 1':
0 cpu-clock # 0.000 CPUs utilized
1.002308394 seconds time elapsed
The root cause is the commit 'bc4394e5e79c ("perf: Fix the throttle
error of some clock events")' adds PERF_EF_UPDATE flag check before
calling cpu_clock_event_update() to update the count, however the
PERF_EF_UPDATE flag is never set when the cpu-clock event is stopped in
counting mode (pmu->dev() -> cpu_clock_event_del() ->
cpu_clock_event_stop()). This leads to the cpu-clock event count is
never updated.
To fix this issue, force to set PERF_EF_UPDATE flag for cpu-clock event
just like what task-clock does.
Fixes: bc4394e5e79c ("perf: Fix the throttle error of some clock events")
Signed-off-by: Dapeng Mi <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions
