Re: [tip:perf/core] perf/x86: Fix USER/KERNEL tagging of samples

From: Peter Zijlstra
Date: Fri Jul 06 2012 - 14:12:22 EST


On Fri, 2012-07-06 at 09:29 -0700, Linus Torvalds wrote:
> On Thu, Jul 5, 2012 at 11:20 PM, tip-bot for Peter Zijlstra
> <a.p.zijlstra@xxxxxxxxx> wrote:
> >
> > Several perf interrupt handlers (PEBS,IBS,BTS) re-write regs->ip but
> > do not update the segment registers. So use an regs->ip based test
> > instead of an regs->cs/regs->flags based test.
>
> Christ, people, YOU CANNOT DO THIS!
>
> It is never *ever* valid to test the IP to see if you're in kernel
> space or user space. People can do various odd segments etc, the IP is
> totally meaningless.
>
> If the perf handlers fake the IP information, they had better fake the
> CS/eflags information too. Because it is *wrong* to look at IP. Don't
> do it.

PEBS, BTS, LBR don't have CS. PEBS does have eflags.

If we cannot do this I'm not sure what we can do :/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/