lkml.org 
[lkml]   [2013]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] perf-report: add --max-stack option to limit callchain stack scan
On 10/16/2013 11:01 PM, David Ahern wrote:
> On 10/16/13 1:59 PM, Waiman Long wrote:
>> This patch adds a new --max-stack option to perf-report to limit the
>> depth of callchain stack data to look at to reduce the time it takes
>> for perf-report to finish its processing. It trades the presence of
>> trailing stack information with faster speed.
>
> I like the patch. I have a similar option in my perf-sched-timehist
> command, and I have a patch somewhere for perf-script.
>
> It would be even better to pass this arg kernel side and limit the
> stack depth at data collection time.
>

That will require option a similar option on the record side. However,
the overhead of collecting more stack ip address isn't as high as that
in the report side.

> ---8<---
>
>> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
>> index 72eae74..d90d04a 100644
>> --- a/tools/perf/builtin-report.c
>> +++ b/tools/perf/builtin-report.c
>> @@ -37,6 +37,12 @@
>>
>> #include <linux/bitmap.h>
>>
>> +/*
>> + * 2-level stringification macro to enable stringification of macro
>> value
>> + * */
>> +#define __to_string(x) #x
>> +#define STRINGIFY(x) __to_string(x)
>
> These 2 lines should be somewhere else -- like util/util.h

I will move that to a common header file.

>
> ---8<---
>
>> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
>> index 2122141..2725aca 100644
>> --- a/tools/perf/builtin-top.c
>> +++ b/tools/perf/builtin-top.c
>> @@ -771,7 +771,8 @@ static void perf_event__process_sample(struct
>> perf_tool *tool,
>> sample->callchain) {
>> err = machine__resolve_callchain(machine, evsel,
>> al.thread, sample,
>> - &parent, &al);
>> + &parent, &al,
>> + PERF_MAX_STACK_DEPTH);
>> if (err)
>> return;
>> }
>
> Why not add the option to perf-top as well? copy-paste.

I had thought about it, but I decided to wait for feedback before doing
it. I will make that change in the next version.

-Longman



\
 
 \ /
  Last update: 2013-10-17 19:01    [W:0.035 / U:6.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site