lkml.org 
[lkml]   [2013]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/7] perf script: Add an option to print the source line number
On 12/3/13, 12:23 AM, Adrian Hunter wrote:
> @@ -348,6 +355,24 @@ static void print_sample_start(struct perf_sample *sample,
> }
> }
>
> +static void print_sample_finish(struct perf_evsel *evsel,
> + struct addr_location *al)
> +{
> + struct perf_event_attr *attr = &evsel->attr;
> +
> + if (PRINT_FIELD(SRCLINE) && al->map && al->map->dso) {
> + char *srcline;
> +
> + srcline = get_srcline(al->map->dso,
> + map__rip_2objdump(al->map, al->addr));
> + if (srcline != SRCLINE_UNKNOWN)
> + printf("\n %s", srcline);
> + free_srcline(srcline);
> + }
> +
> + printf("\n");
> +}
> +
> static bool is_bts_event(struct perf_event_attr *attr)
> {
> return ((attr->type == PERF_TYPE_HARDWARE) &&
> @@ -438,7 +463,7 @@ static void print_sample_bts(union perf_event *event,
> !output[attr->type].user_set))
> print_sample_addr(event, sample, machine, thread, attr);
>
> - printf("\n");
> + print_sample_finish(evsel, al);
> }
>
> static void process_event(union perf_event *event, struct perf_sample *sample,
> @@ -480,7 +505,7 @@ static void process_event(union perf_event *event, struct perf_sample *sample,
> PERF_MAX_STACK_DEPTH);
> }
>
> - printf("\n");
> + print_sample_finish(evsel, al);
> }
>
> static int default_start_script(const char *script __maybe_unused,

What about callchains?

David



\
 
 \ /
  Last update: 2013-12-03 18:01    [W:0.232 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site