lkml.org 
[lkml]   [2012]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V2 6/7] perf, x86: Use LBR call stack to get user callchain
From
On Wed, Oct 24, 2012 at 2:31 PM, Andi Kleen <ak@linux.intel.com> wrote:
> On Wed, Oct 24, 2012 at 02:21:43PM +0200, Stephane Eranian wrote:
>> But still, if I do:
>> $ perf record -g -e cpu/cycles/k ........
>>
>> Looks like your code will activate LBR cstack for user stack even
>> though I don't use it.
>> I know it won't generate any user samples (theoretically) but you are
>> still commandeering
>> the LBR resource which other events may want to use.
>
> You can disable it in sysfs. LBR is a power user feature and they will
> know how to do this.
>
But isn't the whole point of the patch to hide LBR cstack from users so they
won't know they're using it for user cstack?

To disable it in sysfs, I need to know it's being used in the first place.
You're saying, I need to know it is used only for user cstack and if I don't
need it then I need to disable it explicitly. I also suspect using it
for nothing
may have some performance implication because you are saving/restoring
on ctxsw, for instance.

I think in x86_pmu_hw_config(), you could simply check the priv level
restrictions on the event. If exclude_user is set, then don't active LBR cstack
and that's it. That's what I was trying to get to...


> See it as a "prefer the needs of the 95+% over the needs of the few" default
>
> -Andi


\
 
 \ /
  Last update: 2012-10-24 15:21    [W:0.757 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site