From: Ingo Molnar <mingo@kernel.org>
To: mark.barnett@arm.com
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
namhyung@kernel.org, irogers@google.com, ben.gainey@arm.com,
deepak.surti@arm.com, ak@linux.intel.com, will@kernel.org,
james.clark@arm.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 1/5] perf: Record sample last_period before updating
Date: Wed, 9 Apr 2025 13:39:58 +0200 [thread overview]
Message-ID: <Z_ZcjvdC0W3Kq2kq@gmail.com> (raw)
In-Reply-To: <20250408171530.140858-2-mark.barnett@arm.com>
* mark.barnett@arm.com <mark.barnett@arm.com> wrote:
> From: Mark Barnett <mark.barnett@arm.com>
>
> This change alters the PowerPC and x86 driver implementations to record
> the last sample period before the event is updated for the next period.
>
> A common pattern in PMU driver implementations is to have a
> "*_event_set_period" function which takes care of updating the various
> period-related fields in a perf_event structure. In most cases, the
> drivers choose to call this function after initializing a sample data
> structure with perf_sample_data_init. The x86 and PowerPC drivers
> deviate from this, choosing to update the period before initializing the
> sample data. When using an event with an alternate sample period, this
> causes an incorrect period to be written to the sample data that gets
> reported to userspace.
>
> Link: https://lore.kernel.org/r/20240515193610.2350456-4-yabinc@google.com
> Signed-off-by: Mark Barnett <mark.barnett@arm.com>
> ---
> arch/powerpc/perf/core-book3s.c | 3 ++-
> arch/powerpc/perf/core-fsl-emb.c | 3 ++-
> arch/x86/events/core.c | 4 +++-
> arch/x86/events/intel/core.c | 5 ++++-
> arch/x86/events/intel/knc.c | 4 +++-
> 5 files changed, 14 insertions(+), 5 deletions(-)
I've picked up this patch into tip:perf/core, because I think it makes
sense standalone as well.
Thanks,
Ingo
next prev parent reply other threads:[~2025-04-09 11:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 17:15 [PATCH v4 0/5] A mechanism for efficient support for per-function metrics mark.barnett
2025-04-08 17:15 ` [PATCH v4 1/5] perf: Record sample last_period before updating mark.barnett
2025-04-09 11:39 ` Ingo Molnar [this message]
2025-04-09 11:43 ` [tip: perf/core] perf/arch: Record sample last_period before updating on the x86 and PowerPC platforms tip-bot2 for Mark Barnett
2025-04-09 11:53 ` tip-bot2 for Mark Barnett
2025-04-08 17:15 ` [PATCH v4 2/5] perf: Allow periodic events to alternate between two sample periods mark.barnett
2025-04-08 17:15 ` [PATCH v4 3/5] perf: Allow adding fixed random jitter to the sampling period mark.barnett
2025-04-09 10:54 ` Ingo Molnar
2025-04-09 14:24 ` Peter Zijlstra
2025-04-08 17:15 ` [PATCH v4 4/5] tools/perf: Modify event parser to support hf-period term mark.barnett
2025-04-08 17:15 ` [PATCH v4 5/5] tools/perf: Modify event parser to support hf-rand term mark.barnett
2025-04-09 11:38 ` [PATCH v4 0/5] A mechanism for efficient support for per-function metrics Ingo Molnar
2025-04-11 11:07 ` Mark Barnett
2025-04-11 17:34 ` Ian Rogers
2025-04-12 20:42 ` Ingo Molnar
2025-04-12 20:38 ` Ingo Molnar
2025-04-09 14:29 ` Peter Zijlstra
2025-04-11 9:44 ` Mark Barnett
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=Z_ZcjvdC0W3Kq2kq@gmail.com \
--to=mingo@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ben.gainey@arm.com \
--cc=deepak.surti@arm.com \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=jolsa@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.barnett@arm.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/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).