Re: [PATCH V2 6/7] perf, x86: Use LBR call stack to get usercallchain

From: Andi Kleen
Date: Wed Oct 24 2012 - 08:51:06 EST


> 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?

The point of the patch is to get user backtraces where you can't
get them today.

>
> To disable it in sysfs, I need to know it's being used in the first place.

You can always disable unconditionally it if you want to use LBR.

> 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...

Ok that sounds reasonable. Yes it only makes sense for user sampling
currently. However the restriction may be fixed at some point, then
it could be also used for the kernel.

-Andi
--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
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/