From: Ingo Molnar <mingo@kernel.org>
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: Fri, 5 Sep 2014 12:35:01 +0200 [thread overview]
Message-ID: <20140905103501.GA30329@gmail.com> (raw)
In-Reply-To: <1409756351-25743-3-git-send-email-eranian@google.com>
* 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;
Beyond regs.r15, is pebs->dx left out on purpose? It's part of
pebs_record_hsw so presumably the hardware fills it in.
Thanks,
Ingo
next prev parent reply other threads:[~2014-09-05 10:35 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
2014-09-05 3:20 ` Stephane Eranian
2014-09-05 10:35 ` Ingo Molnar [this message]
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=20140905103501.GA30329@gmail.com \
--to=mingo@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.