Re: [PATCH 11/13] perf: add code to support PERF_SAMPLE_BRANCH_STACK (v3)

From: Stephane Eranian
Date: Tue Jan 10 2012 - 10:43:31 EST


On Tue, Jan 10, 2012 at 2:25 AM, Arun Sharma <asharma@xxxxxx> wrote:
> On 1/9/12 8:49 AM, Stephane Eranian wrote:
>>
>> From: Roberto Agostino Vitillo<ravitillo@xxxxxxx>
>>
>> This patch adds:
>> - ability to parse samples with PERF_SAMPLE_BRANCH_STACK
>> - sort on branches
>> - build histograms on branches
>>
> [..]
>>
>> Âstatic struct sort_dimension sort_dimensions[] = {
>> - Â Â Â { .name = "pid", Â Â Â Â.entry =&sort_thread, Â },
>> - Â Â Â { .name = "comm", Â Â Â .entry =&sort_comm, Â Â },
>> - Â Â Â { .name = "dso", Â Â Â Â.entry =&sort_dso, Â Â Â},
>> - Â Â Â { .name = "symbol", Â Â .entry =&sort_sym, Â Â Â},
>> - Â Â Â { .name = "parent", Â Â .entry =&sort_parent, Â },
>> - Â Â Â { .name = "cpu", Â Â Â Â.entry =&sort_cpu, Â Â Â},
>> + Â Â Â { .name = "pid", Â Â Â Â.entry =&sort_thread, Â Â Â Â Â Â Â Â Â },
>> + Â Â Â { .name = "comm", Â Â Â .entry =&sort_comm, Â Â Â Â Â Â Â Â Â Â },
>> + Â Â Â { .name = "dso", Â Â Â Â.entry =&sort_dso, Â Â Â Â Â Â Â Â Â Â Â},
>> +    { .name = "dso_from",  .entry =&sort_dso_from,.taken = true  Â},
>> +    { .name = "dso_to",   .entry =&sort_dso_to,  .taken = true  },
>> + Â Â Â { .name = "symbol", Â Â .entry =&sort_sym, Â Â Â Â Â Â Â Â Â Â Â},
>> +    { .name = "symbol_from",.entry =&sort_sym_from,.taken = true  Â},
>> +    { .name = "symbol_to", Â.entry =&sort_sym_to,  .taken = true  },
>> + Â Â Â { .name = "parent", Â Â .entry =&sort_parent, Â Â Â Â Â Â Â Â Â },
>> + Â Â Â { .name = "cpu", Â Â Â Â.entry =&sort_cpu, Â Â Â Â Â Â Â Â Â Â Â},
>>
>> + Â Â Â { .name = "mispredict", .entry =&sort_mispredict, },
>> Â};
>
>
> The new sort dimensions don't seem to show up in perf report -h. Could you
> please update the help text?
>
Can do this with the understanding that those are only avail when you
use branch sampling.

> Also:
>
> # perf script -h
>
> Â Â-f, --fields <str> Â Âcomma separated output fields prepend with 'type:'.
> Valid types: hw,sw,trace,raw. Fields:
> comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr
>
> You probably want to add a field here, so I could:
>
> perf record -b any_call,u -e cycles:u
> perf script -f event,branch_stack
>
> and examine raw (symbolized) samples like I can with
>
> perf record -g
> perf script -f event,ip,sym
>
Ok, I'll look into this. Looks like a useful command for automating processing.

> Â-Arun
>
--
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/