linux-stable/tools/perf/util/metricgroup.h
Jiri Olsa 33bbc571ed 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>
2019-02-14 15:18:09 -03:00

33 lines
808 B
C

#ifndef METRICGROUP_H
#define METRICGROUP_H 1
#include "linux/list.h"
#include "rblist.h"
#include <subcmd/parse-options.h>
#include "evlist.h"
#include "strbuf.h"
struct metric_event {
struct rb_node nd;
struct perf_evsel *evsel;
struct list_head head; /* list of metric_expr */
};
struct metric_expr {
struct list_head nd;
const char *metric_expr;
const char *metric_name;
struct perf_evsel **metric_events;
};
struct metric_event *metricgroup__lookup(struct rblist *metric_events,
struct perf_evsel *evsel,
bool create);
int metricgroup__parse_groups(const struct option *opt,
const char *str,
struct rblist *metric_events);
void metricgroup__print(bool metrics, bool groups, char *filter,
bool raw, bool details);
bool metricgroup__has_metric(const char *metric);
#endif