perf report: Add --percent-type option
authorJiri Olsa <jolsa@kernel.org>
Sat, 4 Aug 2018 13:05:21 +0000 (15:05 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 8 Aug 2018 18:55:54 +0000 (15:55 -0300)
Set annotation percent type from following choices:

  global-period, local-period, global-hits, local-hits

With following report option setup the percent type will be passed to
annotation browser:

  $ perf report --percent-type period-local

The local/global keywords set if the percentage is computed in the scope
of the function (local) or the whole data (global).  The period/hits
keywords set the base the percentage is computed on - the samples period
or the number of samples (hits).

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20180804130521.11408-21-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-report.txt
tools/perf/builtin-report.c

index 917e36fde6d8b5e30e2626a68ef4b01b2cae1929..474a4941f65dabdbc29911a7b324a0ff2fcd63e9 100644 (file)
@@ -477,6 +477,15 @@ include::itrace.txt[]
        Display monitored tasks stored in perf data. Displaying pid/tid/ppid
        plus the command string aligned to distinguish parent and child tasks.
 
+--percent-type::
+       Set annotation percent type from following choices:
+         global-period, local-period, global-hits, local-hits
+
+       The local/global keywords set if the percentage is computed
+       in the scope of the function (local) or the whole data (global).
+       The period/hits keywords set the base the percentage is computed
+       on - the samples period or the number of samples (hits).
+
 include::callchain-overhead-calculation.txt[]
 
 SEE ALSO
index 02f7a3c27761f717b9e8c5cf39d4788b2014297b..143542ffac2017c3898006ef7b50f54875ce9ed9 100644 (file)
@@ -1124,6 +1124,9 @@ int cmd_report(int argc, const char **argv)
                   "Time span of interest (start,stop)"),
        OPT_BOOLEAN(0, "inline", &symbol_conf.inline_name,
                    "Show inline function"),
+       OPT_CALLBACK(0, "percent-type", &report.annotation_opts, "local-period",
+                    "Set percent type local/global-period/hits",
+                    annotate_parse_percent_type),
        OPT_END()
        };
        struct perf_data data = {