lkml.org 
[lkml]   [2014]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6/9] perf, tools: Fix max stack handling with lbr-as-callgraph
    Date
    From: Andi Kleen <ak@linux.intel.com>

    The original lbr-as-callstack code ignored the maxium callgraph
    length set by the user. Fix this.

    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    ---
    tools/perf/util/machine.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
    index 4032634..853639c 100644
    --- a/tools/perf/util/machine.c
    +++ b/tools/perf/util/machine.c
    @@ -1372,7 +1372,7 @@ static int machine__resolve_callchain_sample(struct machine *machine,
    }

    if (callchain_param.branch_callstack) {
    - int nr = branch->nr;
    + int nr = min(max_stack, branch->nr);
    struct branch_entry be[nr];

    for (i = 0; i < nr; i++) {
    @@ -1397,6 +1397,7 @@ static int machine__resolve_callchain_sample(struct machine *machine,
    if (err)
    return err;
    }
    + chain_nr -= nr;
    }

    if (chain->nr > PERF_MAX_STACK_DEPTH) {
    --
    1.8.3.1


    \
     
     \ /
      Last update: 2014-01-11 21:21    [W:2.838 / U:0.540 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site