lkml.org 
[lkml]   [2014]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/8] perf top: Add --percentage option
On Mon, Feb 10, 2014 at 11:47:21AM +0900, Namhyung Kim wrote:
> The --percentage option is for controlling overhead percentage
> displayed. It can only receive either of "relative" or "absolute".
>
> For more information, please see previous commit same thing done to
> "perf report".
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---

SNIP

>
> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> index ed99ec4a309f..a516e0389c5e 100644
> --- a/tools/perf/builtin-top.c
> +++ b/tools/perf/builtin-top.c
> @@ -1011,6 +1011,20 @@ parse_percent_limit(const struct option *opt, const char *arg,
> return 0;
> }
>
> +static int
> +parse_percentage(const struct option *opt __maybe_unused, const char *arg,
> + int unset __maybe_unused)
> +{
> + if (!strcmp(arg, "relative"))
> + symbol_conf.filter_relative = true;
> + else if (!strcmp(arg, "absolute"))
> + symbol_conf.filter_relative = false;
> + else
> + return -1;
> +
> + return 0;
> +}

please make one of parse_percentage functions public and
share it among report/top/diff commands

jirka


\
 
 \ /
  Last update: 2014-02-20 12:21    [W:1.373 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site