From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, ak@linux.intel.com,
jolsa@redhat.com, acme@redhat.com, namhyung@kernel.org
Subject: Re: [PATCH v2 2/5] perf/x86: add support for sampling PEBS machine state registers
Date: Tue, 15 Jul 2014 16:29:39 +0200 [thread overview]
Message-ID: <20140715142939.GJ9918@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1405384304-26816-3-git-send-email-eranian@google.com>
[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]
On Tue, Jul 15, 2014 at 02:31:41AM +0200, Stephane Eranian wrote:
> PEBS can capture machine state regs at retiremnt of the sampled
> instructions. When precise sampling is enabled on an event, PEBS
> is used, so substitute the interrupted state with the PEBS state.
> Note that not all registers are captured by PEBS. Those missing
> are replaced by the interrupt state counter-parts.
>
> Signed-off-by: Stephane Eranian <eranian@google.com>
> ---
> arch/x86/kernel/cpu/perf_event_intel_ds.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> index 980970c..d612bcd 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> @@ -925,6 +925,25 @@ static void __intel_pmu_pebs_event(struct perf_event *event,
> regs.bp = pebs->bp;
> regs.sp = pebs->sp;
>
> + if (sample_type & PERF_SAMPLE_REGS_INTR) {
> + regs.ax = pebs->ax;
> + regs.bx = pebs->bx;
> + regs.cx = pebs->cx;
> + regs.si = pebs->si;
> + regs.di = pebs->di;
> +
> + regs.r8 = pebs->r8;
> + regs.r9 = pebs->r9;
> + regs.r10 = pebs->r10;
> + regs.r11 = pebs->r11;
> + regs.r12 = pebs->r12;
> + regs.r13 = pebs->r13;
> + regs.r14 = pebs->r14;
> + regs.r14 = pebs->r15;
> +
> + data.regs_intr.regs = ®s;
This last assignment is superfluous. Note how you previous patch's
perf_sample_regs_intr() is unconditionally writing its .regs value, and
in turn, perf_sample_regs_intr() is called unconditionally from
perf_prepare_sample().
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-07-15 14:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-15 0:31 [PATCH v2 0/5] perf: add ability to sample interrupted machine state Stephane Eranian
2014-07-15 0:31 ` [PATCH v2 1/5] perf: add ability to sample machine state on interrupt Stephane Eranian
2014-07-15 14:16 ` Peter Zijlstra
2014-07-16 0:05 ` Stephane Eranian
2014-07-15 14:25 ` Peter Zijlstra
2014-07-15 23:58 ` Stephane Eranian
2014-07-15 0:31 ` [PATCH v2 2/5] perf/x86: add support for sampling PEBS machine state registers Stephane Eranian
2014-07-15 14:29 ` Peter Zijlstra [this message]
2014-07-15 23:56 ` Stephane Eranian
2014-07-15 0:31 ` [PATCH v2 3/5] perf tools: add core support for sampling intr machine state regs Stephane Eranian
2014-07-15 0:31 ` [PATCH v2 4/5] perf/tests: add interrupted state sample parsing test Stephane Eranian
2014-07-15 0:31 ` [PATCH v2 5/5] perf record: add new -I option to sample interrupted machine state Stephane Eranian
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=20140715142939.GJ9918@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@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
all inboxes | Powered by JetHome®