[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABPqkBTc=_8=nRfYpZwZ4eKbpWLnBuy_4aWoTrPupWGu=oK+jg@mail.gmail.com>
Date: Mon, 2 Mar 2015 15:26:09 -0500
From: Stephane Eranian <eranian@...gle.com>
To: Vince Weaver <vincent.weaver@...ne.edu>
Cc: Jiri Olsa <jolsa@...hat.com>,
"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>,
linux-man@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Chuck Ebbert <cebbert.lkml@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [patch] perf_event_open.2: 3.19 PERF_SAMPLE_REGS_INTR support
vince,
On Mon, Mar 2, 2015 at 2:31 PM, Vince Weaver <vincent.weaver@...ne.edu> wrote:
>
> On Sun, 1 Mar 2015, Stephane Eranian wrote:
>
> > You need to describe your test better. Are you saying that the register values
> > you were seeing with REGS_USER, REGS_INTR, precise_ip > 0 are all
> > the same? That is certainly not impossible. If your PMU interrupts are all
> > at the user level, then REGS_INTR = REGS_USER. With precise_ip > 0,
> > you will get the machine state on retirement of the sampled instruction.
> > But if you have no sampling skid without precise_ip, then both states
> > the REGS_INTR and REGS_INTR+precise_ip>0 could be identical.
>
> If you enable both PERF_SAMPLE_REGS_USER and PERF_SAMPLE_REGS_INTR
> then you will get in the PERF_RECORD_SAMPLE results for both user
> and intr. However they will be identical, always, because
> the kernel code just checks if PERF_SAMPLE_REGS_INTR was given and
> then returns the PEBS state for both.
>
If the PMU interrupt occurred at the user level, then this makes sense.
both perf_sample_regs_user() and perf_sample_regs_intr() use the
same pt_regs() which has the user state.
I think your comment is more along the lines that REGS_USER should not receive
PEBS machine state. Problem is that there is only one set of pt_regs passed to
__intel_pmu_pebs_event(). And if REGS_INTR is set, then the pt_regs
registers are
indeed overwritten with PEBS captured state. To avoid the issue, we
would have to
carry around two sets of pt_regs.
> My test was expecting that if you specified PERF_SAMPLE_REGS_USER and
> PERF_SAMPLE_REGS_INTR then for the PERF_SAMPLE_REGS_USER values you'd
> get the same results as when PERF_SAMPLE_REGS_INTR were not specified, but
> that's not the case.
>
This could certainly be fixed with two sets of pt_regs to make the results more
consisten when REGS_USER and REGS_INTR + precise are used.
>
> This is an obscure corner case, but I found the results unexpected.
>
> Vince
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists