All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@elte.hu, ak@linux.intel.com, acme@redhat.com,
	namhyung@kernel.org
Subject: Re: [PATCH 2/4] perf/x86: add support for sampling PEBS machine state registers
Date: Fri, 11 Jul 2014 10:15:10 +0200	[thread overview]
Message-ID: <20140711081510.GC21557@krava.redhat.com> (raw)
In-Reply-To: <1404857759-25105-3-git-send-email-eranian@google.com>

On Wed, Jul 09, 2014 at 12:15:57AM +0200, Stephane Eranian wrote:
> PEBS can capture machine state regs at retirement 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 = &regs;

this assignement is not necessary, because you assign this regs pointer
again in perf_prepare_sample -> perf_sample_regs_intr later

jirka

  reply	other threads:[~2014-07-11  8:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 22:15 [PATCH v1 0/4] perf: add ability to sample interrupted machine state Stephane Eranian
2014-07-08 22:15 ` [PATCH 1/4] perf: add ability to sample machine state on interrupt Stephane Eranian
2014-07-09 15:03   ` Arnaldo Carvalho de Melo
2014-07-09 15:46   ` Andi Kleen
2014-07-11  7:58   ` Jiri Olsa
2014-07-11  8:11   ` Jiri Olsa
2014-07-11  8:14   ` Jiri Olsa
2014-07-08 22:15 ` [PATCH 2/4] perf/x86: add support for sampling PEBS machine state registers Stephane Eranian
2014-07-11  8:15   ` Jiri Olsa [this message]
2014-07-08 22:15 ` [PATCH 3/4] perf tools: add core support for sampling intr machine state regs Stephane Eranian
2014-07-09 15:44   ` Andi Kleen
2014-07-11  8:20   ` Jiri Olsa
2014-07-11  8:25   ` Jiri Olsa
2014-07-14 17:54     ` Stephane Eranian
2014-07-11  8:27   ` Jiri Olsa
2014-07-08 22:15 ` [PATCH 4/4] perf record: add new -I option to sample interrupted machine state Stephane Eranian
2014-07-09 15:45   ` Andi Kleen
2014-07-14  8:00   ` Namhyung Kim
2014-07-14 17:52     ` Stephane Eranian
2014-07-09  8:26 ` [PATCH v1 0/4] perf: add ability " Namhyung Kim
2014-07-09 14:53   ` Arnaldo Carvalho de Melo
2014-07-09 15:26     ` Stephane Eranian
2014-07-09 15:47       ` Andi Kleen
2014-07-09 17:14         ` 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=20140711081510.GC21557@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.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.