Re: [PATCH V7 13/17] perf, x86: enable LBR callstack when recording callchain

From: Peter Zijlstra
Date: Wed Nov 05 2014 - 05:44:13 EST


On Wed, Nov 05, 2014 at 10:58:28AM +0100, Stephane Eranian wrote:
> On Wed, Nov 5, 2014 at 10:21 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > On Tue, Nov 04, 2014 at 09:56:09PM -0500, Kan Liang wrote:
> >> From: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
> >>
> >> Only enable LBR callstack when user requires fp callgraph. The feature
> >> is not available when PERF_SAMPLE_BRANCH_STACK or PERF_SAMPLE_STACK_USER
> >> is required.
> >> Also, this feature only affects how to get user callchain. The kernel
> >> callchain is always got by frame pointers.
> >
> > Since FP callchains should not change, this doesn't appear to make any
> > sense either.
>
> If I recall earlier discussion, the FP callchain are not changed. On
> HSW, when requesting fp at the user level only, then the kernel
> automatically tries to use the LBR callstack mode. Advantage is that
> the user app does not require frame-pointer or dwarf debug info to get
> correct callchains with perf record. The downside is that LBR
> callstack does not work in certain callchain corner cases.

But this patch changes the FP callchain interface. I see no need of
that. We already have multiple independent callchain options (FP and
Dwarf) adding a third option should also be independent (LBR).

Allowing all 3 at the same time allows for identifying those corner
cases.

That is I simply don't see a good reason intertwine these things at the
interface level. All it does is reduce options. Would it not be 'nice'
to allow both FP and LBR at the same time?
--
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/