From: "Mi, Dapeng" <dapeng1.mi@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>,
Eranian Stephane <eranian@google.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Dapeng Mi <dapeng1.mi@intel.com>, Zide Chen <zide.chen@intel.com>,
Falcon Thomas <thomas.falcon@intel.com>,
Xudong Hao <xudong.hao@intel.com>
Subject: Re: [PATCH] perf: Fix 0 count issue of cpu-clock
Date: Tue, 18 Nov 2025 19:22:24 +0800 [thread overview]
Message-ID: <baf8aceb-5caa-4c3b-80f0-43a4a1449a23@linux.intel.com> (raw)
In-Reply-To: <20251118110417.GI4068168@noisy.programming.kicks-ass.net>
On 11/18/2025 7:04 PM, Peter Zijlstra wrote:
> On Tue, Nov 18, 2025 at 12:03:09PM +0100, Peter Zijlstra wrote:
>> On Wed, Nov 12, 2025 at 04:05:26PM +0800, Dapeng Mi wrote:
>>
>>> diff --git a/kernel/events/core.c b/kernel/events/core.c
>>> index f6a08c73f783..77d3af5959c1 100644
>>> --- a/kernel/events/core.c
>>> +++ b/kernel/events/core.c
>>> @@ -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);
>>> }
>> 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).
> 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
next prev parent reply other threads:[~2025-11-18 11:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 8:05 [PATCH] perf: Fix 0 count issue of cpu-clock Dapeng Mi
2025-11-12 16:42 ` Ian Rogers
2025-11-17 17:04 ` Ian Rogers
2025-11-18 1:43 ` Namhyung Kim
2025-11-18 10:50 ` Peter Zijlstra
2025-11-18 11:03 ` Peter Zijlstra
2025-11-18 11:04 ` Peter Zijlstra
2025-11-18 11:22 ` Mi, Dapeng [this message]
2025-11-18 11:24 ` Peter Zijlstra
2025-12-05 23:44 ` Ian Rogers
2025-12-08 5:16 ` Mi, Dapeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=baf8aceb-5caa-4c3b-80f0-43a4a1449a23@linux.intel.com \
--to=dapeng1.mi@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dapeng1.mi@intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=thomas.falcon@intel.com \
--cc=xudong.hao@intel.com \
--cc=zide.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).