lkml.org 
[lkml]   [2015]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [patch] perf_event_open.2: 3.19 PERF_SAMPLE_REGS_INTR support
On Mon, 2 Mar 2015, Andi Kleen wrote:

> > do not enable REGS_USER and REG_INTR at the same time
> > as REGS_USER will have REG_INTR values and
> > cannot be used for user stack unwinding
>
> If that's true it would be a bug. But I doubt it.
>
> The PEBS handler sets up its own pt_regs, so they should
> be independent.

I could be wrong here, but was tracing through the code.

If you trigger a PEBS interrupt (because you have precise_ip set)
and you have both REGS_USER and REGS_INTR set, then
__intel_pmu_pebs_event()
is called from
arch/x86/kernel/cpu/perf_event_intel_ds.c

and in there it sets the regs values based solely on

if (sample_type & PERF_SAMPLE_REGS_INTR) {
}

with those values copies into regs and then passed upstream through
perf_event_overflow()

so if the sample_type has *both* PERF_SAMPLE_REGS_INTR and
PERF_SAMPLE_REGS_USER set, then the PERF_SAMPLE_REGS_USER values
will have the same register values as the PERF_SAMPLE_REGS_INTR values.

Maybe this is the expected behavior, or maybe I am missing something
still.

Vince



\
 
 \ /
  Last update: 2015-03-06 19:41    [W:0.635 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site