From: Chuck Ebbert <cebbert.lkml@gmail.com>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@elte.hu, acme@redhat.com, jolsa@redhat.com,
namhyung@kernel.org, dsahern@gmail.com
Subject: Re: [PATCH v4 2/6] perf/x86: add support for sampling PEBS machine state registers
Date: Thu, 4 Sep 2014 21:16:31 -0500 [thread overview]
Message-ID: <20140904211631.46b8cad8@as> (raw)
In-Reply-To: <1409756351-25743-3-git-send-email-eranian@google.com>
On Wed, 3 Sep 2014 16:59:07 +0200
Stephane Eranian <eranian@google.com> 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 | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c
> b/arch/x86/kernel/cpu/perf_event_intel_ds.c index 9dc4199..139a8a5
> 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> @@ -886,6 +886,23 @@ 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;
^^^
r15 ???
> + }
> +
> if (event->attr.precise_ip > 1 &&
> x86_pmu.intel_cap.pebs_format >= 2) { regs.ip = pebs->real_ip;
> regs.flags |= PERF_EFLAGS_EXACT;
next prev parent reply other threads:[~2014-09-05 2:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 14:59 [PATCH v4 0/6] perf: add ability to sample interrupted machine state Stephane Eranian
2014-09-03 14:59 ` [PATCH v4 1/6] perf: add ability to sample machine state on interrupt Stephane Eranian
2014-09-03 14:59 ` [PATCH v4 2/6] perf/x86: add support for sampling PEBS machine state registers Stephane Eranian
2014-09-05 2:16 ` Chuck Ebbert [this message]
2014-09-05 3:20 ` Stephane Eranian
2014-09-05 10:35 ` Ingo Molnar
2014-09-05 21:38 ` Stephane Eranian
2014-09-03 14:59 ` [PATCH v4 3/6] perf tools: add core support for sampling intr machine state regs Stephane Eranian
2014-09-03 14:59 ` [PATCH v4 4/6] perf/tests: add interrupted state sample parsing test Stephane Eranian
2014-09-03 14:59 ` [PATCH v4 5/6] perf record: add new -I option to sample interrupted machine state Stephane Eranian
2014-09-03 14:59 ` [PATCH v4 6/6] perf: improve perf_sample_data struct layout 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=20140904211631.46b8cad8@as \
--to=cebbert.lkml@gmail.com \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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