lkml.org 
[lkml]   [2014]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] perf tools: Construct LBR call chain
On Thu, Nov 06, 2014 at 09:58:06AM -0500, kan.liang@intel.com wrote:

SNIP

>
> -static void callchain__printf(struct perf_sample *sample)
> +static void callchain__printf(struct perf_evsel *evsel,
> + struct perf_sample *sample)
> {
> unsigned int i;
> + u64 total_nr, callchain_nr;
> + int lbr = 0;
>
> - printf("... chain: nr:%" PRIu64 "\n", sample->callchain->nr);
> + total_nr = callchain_nr = sample->callchain->nr;
>
> - for (i = 0; i < sample->callchain->nr; i++)
> + if (evsel->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK)
> + lbr = 1;
> +
> + if (lbr) {
> + struct branch_stack *lbr_stack = sample->branch_stack;
> +
> + for (i = 0; i < callchain_nr; i++) {
> + if (sample->callchain->ips[i] == PERF_CONTEXT_USER)
> + break;
> + }
> +
> + if (i != callchain_nr) {
> + total_nr = i + 1 + lbr_stack->nr;
> + callchain_nr = i + 1;
> + }
> + }
> +
> + printf("... chain: nr:%" PRIu64 "\n", total_nr);
> +
> + for (i = 0; i < callchain_nr + 1; i++)
> printf("..... %2d: %016" PRIx64 "\n",
> i, sample->callchain->ips[i]);

so if there's lbr callstack info we dont display user stack
part from standard callchain? I think the dump code should
dump out all the info..

jirka


\
 
 \ /
  Last update: 2014-11-12 10:41    [W:0.093 / U:27.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site