perf list: Display metric expressions for --details option
authorJiri Olsa <jolsa@kernel.org>
Wed, 13 Feb 2019 12:32:41 +0000 (13:32 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Feb 2019 18:18:09 +0000 (15:18 -0300)
commit33bbc571ed79cace481fae4031b80a51d93ae997
treea11054b6069dc4a623661e4c68d4506938d6af60
parent714a92d83fd1e20461f53549cfbee77b20be5032
perf list: Display metric expressions for --details option

Display metric expression itself when --details is specified.

Current list with no details:

  # perf list metrics
  ...
  TopDownL1:
    IPC
         [Instructions Per Cycle (per logical thread)]
    SLOTS
         [Total issue-pipeline slots]
  ...

Detailed output with metric formula:

  # perf list --details metrics
  ...
  TopDownL1:
    IPC
         [Instructions Per Cycle (per logical thread)]
         [inst_retired.any / cpu_clk_unhalted.thread]
    SLOTS
         [Total issue-pipeline slots]
         [4*(( cpu_clk_unhalted.thread_any / 2 ) if #smt_on else cycles)]
  ...

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190213123246.4015-6-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-list.c
tools/perf/util/metricgroup.c
tools/perf/util/metricgroup.h
tools/perf/util/parse-events.c