Skip to contentSkip to conversation

perf: Fix 0 count issue of cpu-clock

PATCH Applied Dapeng Mi 5 participants 12 messages Nov 12, 2025 – Dec 8, 2025 perf events

lore
Share & tools
lore

Dapeng Mi

author
#0 lore raw

PATCH 1/1 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. Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0.

Fixes bc4394e5e79c ("perf: Fix the throttle error of some clock events")

---

With this change, both cpu-clock and task-clock can do counting and samping correctly.

1. perf stat -e cpu-clock,task-clock -- true

Performance counter stats for 'true':

           240,636      cpu-clock                        #    0.358 CPUs utilized
           243,319      task-clock                       #    0.362 CPUs utilized

2. perf record -e cpu-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.028 MB perf.data (36 samples) ]

3. perf record -e task-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.029 MB perf.data (41 samples) ]

 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-	task_clock_event_stop(event, PERF_EF_UPDATE);
+	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void task_clock_event_read(struct perf_event *event)

base-commit: 2093d8cf80fa5552d1025a78a8f3a10bf3b6466e
prerequisite-patch-id: a15bcd62a8dcd219d17489eef88b66ea5488a2a0
prerequisite-patch-id: 2a0eefce67b21d1f30c272fd8115b0dc1aca3897

Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Dapeng Mi

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.

Quoted 6 lines

To fix this issue, force to set PERF_EF_UPDATE flag for cpu-clock event just like what task-clock does. Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0.

Fixes bc4394e5e79c ("perf: Fix the throttle error of some clock events")

Thanks Dapeng! This is a fairly major regression and I'm surprised my kernel picked it up so quickly. For those interested the relevant part of the breaking change is requiring PERF_EF_UPDATE:

```
@@ -11829,7 +11834,8 @@ static void cpu_clock_event_start(struct
perf_event *event, int flags)
 static void cpu_clock_event_stop(struct perf_event *event, int flags)
 {
        perf_swevent_cancel_hrtimer(event);
-       cpu_clock_event_update(event);
+       if (flags & PERF_EF_UPDATE)
+               cpu_clock_event_update(event);
 }
 ```

Hopefully a maintainer can pick this up quickly. Thanks, Ian

Quoted 51 lines

---

With this change, both cpu-clock and task-clock can do counting and samping correctly.

1. perf stat -e cpu-clock,task-clock -- true

Performance counter stats for 'true':

           240,636      cpu-clock                        #    0.358 CPUs utilized
           243,319      task-clock                       #    0.362 CPUs utilized

2. perf record -e cpu-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.028 MB perf.data (36 samples) ]

3. perf record -e task-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.029 MB perf.data (41 samples) ]

 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-       cpu_clock_event_stop(event, flags);
+       cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-       task_clock_event_stop(event, PERF_EF_UPDATE);
+       task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void task_clock_event_read(struct perf_event *event)

base-commit: 2093d8cf80fa5552d1025a78a8f3a10bf3b6466e
prerequisite-patch-id: a15bcd62a8dcd219d17489eef88b66ea5488a2a0
prerequisite-patch-id: 2a0eefce67b21d1f30c272fd8115b0dc1aca3897 --
2.34.1

reviewer
#2 lore raw
Quoted 42 lines · Ian Rogers
Quoted 17 lines · Dapeng Mi

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.

Quoted 6 lines

To fix this issue, force to set PERF_EF_UPDATE flag for cpu-clock event just like what task-clock does. Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0.

Fixes bc4394e5e79c ("perf: Fix the throttle error of some clock events")

Thanks Dapeng! This is a fairly major regression and I'm surprised my kernel picked it up so quickly. For those interested the relevant part of the breaking change is requiring PERF_EF_UPDATE:

```

(quoted diff) +2 -1
@@ -11829,7 +11834,8 @@ static void cpu_clock_event_start(struct
 perf_event *event, int flags)
 static void cpu_clock_event_stop(struct perf_event *event, int flags)
 {
        perf_swevent_cancel_hrtimer(event);
-       cpu_clock_event_update(event);
+       if (flags & PERF_EF_UPDATE)
+               cpu_clock_event_update(event);
 }
 ```
Quoted 4 lines

Hopefully a maintainer can pick this up quickly. Thanks, Ian

Hi Peter and Ingo,

any update on picking this up? Having timer based software events (task-clock, cpu-clock) broken is fairly major regression especially in environments like hypervisors where PMU access is blocked.

Thanks,
Ian

Quoted 51 lines
Quoted 51 lines

---

With this change, both cpu-clock and task-clock can do counting and samping correctly.

1. perf stat -e cpu-clock,task-clock -- true

Performance counter stats for 'true':

           240,636      cpu-clock                        #    0.358 CPUs utilized
           243,319      task-clock                       #    0.362 CPUs utilized

2. perf record -e cpu-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.028 MB perf.data (36 samples) ]

3. perf record -e task-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.029 MB perf.data (41 samples) ]

 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-       cpu_clock_event_stop(event, flags);
+       cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-       task_clock_event_stop(event, PERF_EF_UPDATE);
+       task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void task_clock_event_read(struct perf_event *event)

base-commit: 2093d8cf80fa5552d1025a78a8f3a10bf3b6466e
prerequisite-patch-id: a15bcd62a8dcd219d17489eef88b66ea5488a2a0
prerequisite-patch-id: 2a0eefce67b21d1f30c272fd8115b0dc1aca3897 --
2.34.1

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Dapeng Mi

Hello,

Quoted 16 lines · Dapeng Mi

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.

Quoted 6 lines

To fix this issue, force to set PERF_EF_UPDATE flag for cpu-clock event just like what task-clock does. Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0.

Fixes bc4394e5e79c ("perf: Fix the throttle error of some clock events")

Thanks,
Namhyung

Quoted 51 lines

---

With this change, both cpu-clock and task-clock can do counting and samping correctly.

1. perf stat -e cpu-clock,task-clock -- true

Performance counter stats for 'true':

           240,636      cpu-clock                        #    0.358 CPUs utilized
           243,319      task-clock                       #    0.362 CPUs utilized

2. perf record -e cpu-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.028 MB perf.data (36 samples) ]

3. perf record -e task-clock -c 10000 -Iax,bx -- sleep 1 [ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.029 MB perf.data (41 samples) ]

 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-	task_clock_event_stop(event, PERF_EF_UPDATE);
+	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void task_clock_event_read(struct perf_event *event)

base-commit: 2093d8cf80fa5552d1025a78a8f3a10bf3b6466e
prerequisite-patch-id: a15bcd62a8dcd219d17489eef88b66ea5488a2a0
prerequisite-patch-id: 2a0eefce67b21d1f30c272fd8115b0dc1aca3897

Signature · 1 line
2.34.1
maintainer
#4 lore raw
In reply to Dapeng Mi
Quoted 16 lines · Dapeng Mi

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.

Quoted 7 lines

To fix this issue, force to set PERF_EF_UPDATE flag for cpu-clock event just like what task-clock does. Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0.

Fixes bc4394e5e79c ("perf: Fix the throttle error of some clock events")

---

So I'm forever struggling to find what tree a particular commit is in, but afaict the above fingered commit is already in Linus' tree and so this should go to perf/urgent, right?

maintainer
#5 lore raw
In reply to Dapeng Mi
Quoted 14 lines · Dapeng Mi
kernel/events/core.c +1 -1
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)

kernel/events/core.c static int task_clock_event_add(struct perf_event *event, int flags) · line 12047

Quoted 6 lines
kernel/events/core.c +1 -1
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-	task_clock_event_stop(event, PERF_EF_UPDATE);
+	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }

I think it can both just be: PERF_EF_UPDATE. The only pmu::del() caller hands in flags=0, but if there were to be flags added, we'd have to audit all del methods anyway.

Also, the few comments we do have already note that ->del() must do ->stop(EF_UPDATE).

maintainer
#6 lore raw
Quoted 27 lines · Peter Zijlstra
Quoted 14 lines · Dapeng Mi
kernel/events/core.c +1 -1
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)

kernel/events/core.c static int task_clock_event_add(struct perf_event *event, int flags) · line 12047

Quoted 6 lines
kernel/events/core.c +1 -1
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-	task_clock_event_stop(event, PERF_EF_UPDATE);
+	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }

I think it can both just be: PERF_EF_UPDATE. The only pmu::del() caller hands in flags=0, but if there were to be flags added, we'd have to audit all del methods anyway.

Quoted 2 lines

Also, the few comments we do have already note that ->del() must do ->stop(EF_UPDATE).

Updated patch now sits in queue/perf/urgent.

author
#7 lore raw
Quoted 27 lines · Peter Zijlstra
Quoted 26 lines · Peter Zijlstra
Quoted 14 lines · Dapeng Mi
kernel/events/core.c +1 -1
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)

kernel/events/core.c static int task_clock_event_add(struct perf_event *event, int flags) · line 12047

Quoted 6 lines
kernel/events/core.c +1 -1
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-	task_clock_event_stop(event, PERF_EF_UPDATE);
+	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }

I think it can both just be: PERF_EF_UPDATE. The only pmu::del() caller hands in flags=0, but if there were to be flags added, we'd have to audit all del methods anyway.

Quoted 3 lines
Quoted 2 lines

Also, the few comments we do have already note that ->del() must do ->stop(EF_UPDATE).

Updated patch now sits in queue/perf/urgent.

Hi Peter,

Thanks for merging. If we decide not to or the "flags", then the last sentence "Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0." in the commit message should be dropped as well. :)

https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=perf/urgent&id=cfaecad27435b4eb6a22bb9d008fec4984e03a21

Thanks,

Dapeng Mi

maintainer
#8 lore raw
Quoted 31 lines · Dapeng
Quoted 29 lines · Peter Zijlstra
Quoted 28 lines · Peter Zijlstra
Quoted 14 lines · Dapeng Mi
kernel/events/core.c +1 -1
index f6a08c73f783..77d3af5959c1 100644
@@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)

kernel/events/core.c static int task_clock_event_add(struct perf_event *event, int flags) · line 12047

Quoted 6 lines
kernel/events/core.c +1 -1
@@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
 
 static void task_clock_event_del(struct perf_event *event, int flags)
 {
-	task_clock_event_stop(event, PERF_EF_UPDATE);
+	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
 }

I think it can both just be: PERF_EF_UPDATE. The only pmu::del() caller hands in flags=0, but if there were to be flags added, we'd have to audit all del methods anyway.

Also, the few comments we do have already note that ->del() must do ->stop(EF_UPDATE).

Quoted 8 lines
Quoted 1 line

Updated patch now sits in queue/perf/urgent.

Hi Peter,

Thanks for merging. If we decide not to or the "flags", then the last sentence "Besides, or flags with PERF_EF_UPDATE for task-clock although currently the flags argument would always be 0." in the commit message should be dropped as well. :)

Should be fixed now. Thanks!

reviewer
#9 lore raw
Quoted 7 lines · Peter Zijlstra
Quoted 5 lines · Dapeng
Quoted 3 lines · Peter Zijlstra
Quoted 2 lines · Peter Zijlstra

Also, the few comments we do have already note that ->del() must do ->stop(EF_UPDATE).

Hi Peter,

I was trying to do a quick sanity check that other callers of stop were passing in EF_UPDATE. I wondered if the case of perf_event_throttle_group with leader sampling has an issue? The throttle should only happen on an event or group leader that is in sampling mode, but the group members could be non-sampling with leader sampling. Sorry for the noise if I'm wrong on this. Fwiw, the other uses either pass in EF_UPDATE or I think for __perf_event_aux_pause and __perf_event_overflow the problem isn't relevant.

Thanks,
Ian

author
#10 lore raw
Quoted 8 lines · Ian Rogers
Quoted 5 lines · Peter Zijlstra
Quoted 4 lines · Dapeng
Quoted 3 lines · Peter Zijlstra
Quoted 2 lines · Peter Zijlstra

Also, the few comments we do have already note that ->del() must do ->stop(EF_UPDATE).

Hi Peter,

Quoted 8 lines

I was trying to do a quick sanity check that other callers of stop were passing in EF_UPDATE. I wondered if the case of perf_event_throttle_group with leader sampling has an issue? The throttle should only happen on an event or group leader that is in sampling mode, but the group members could be non-sampling with leader sampling. Sorry for the noise if I'm wrong on this. Fwiw, the other uses either pass in EF_UPDATE or I think for __perf_event_aux_pause and __perf_event_overflow the problem isn't relevant.

Base on the logic, it looks we need to add the flag EF_UPDATE in perf_event_throttle_group(), but need Peter's confirm.

Quoted 4 lines

Thanks,
Ian

merge bot Applied
#11 lore raw
In reply to Dapeng Mi
The following commit has been merged into the perf/urgent branch of tip:

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     f1f96511b1c4c33e53f05909dd267878e0643a9a
Gitweb:        https://git.kernel.org/tip/f1f96511b1c4c33e53f05909dd267878e0643a9a
Author:        Dapeng Mi <[email protected]>
AuthorDate:    Wed, 12 Nov 2025 16:05:26 +08:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Thu, 20 Nov 2025 10:42:12 +01:00

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")
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 1fd347d..2c35acc 100644
@@ -11901,7 +11901,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
 
 static void cpu_clock_event_del(struct perf_event *event, int flags)
 {
-	cpu_clock_event_stop(event, flags);
+	cpu_clock_event_stop(event, PERF_EF_UPDATE);
 }
 
 static void cpu_clock_event_read(struct perf_event *event)