diff options
| author | Andi Kleen <ak@linux.intel.com> | 2017-03-20 16:17:09 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-03-23 10:42:30 -0400 |
| commit | 7f372a636d92e21d6fa41aebd6986ef590aefbfc (patch) | |
| tree | 93374339c16ace4382b7de0ff7b7e7b254de2da1 /tools/perf | |
| parent | 37932c188ef1b471eae29249df045c8e567772d0 (diff) | |
perf list: Support printing MetricExpr with --debug
Output the metric expr in perf list when --debug is specified, so that
the user can check the formula.
Before:
% perf list
...
unc_m_power_channel_ppd
[Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit:
uncore_imc]
uncore_imc_2/event=0x85/
After:
% perf list --debug
...
unc_m_power_channel_ppd
[Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit:
uncore_imc]
Perf: uncore_imc_2/event=0x85/ MetricExpr: (unc_m_power_channel_ppd / unc_m_clockticks) * 100.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-12-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/pmu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 0f1133aa3253..f819ad162b7c 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
| @@ -1105,6 +1105,7 @@ struct sevent { | |||
| 1105 | char *topic; | 1105 | char *topic; |
| 1106 | char *str; | 1106 | char *str; |
| 1107 | char *pmu; | 1107 | char *pmu; |
| 1108 | char *metric_expr; | ||
| 1108 | }; | 1109 | }; |
| 1109 | 1110 | ||
| 1110 | static int cmp_sevent(const void *a, const void *b) | 1111 | static int cmp_sevent(const void *a, const void *b) |
| @@ -1203,6 +1204,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, | |||
| 1203 | aliases[j].topic = alias->topic; | 1204 | aliases[j].topic = alias->topic; |
| 1204 | aliases[j].str = alias->str; | 1205 | aliases[j].str = alias->str; |
| 1205 | aliases[j].pmu = pmu->name; | 1206 | aliases[j].pmu = pmu->name; |
| 1207 | aliases[j].metric_expr = alias->metric_expr; | ||
| 1206 | j++; | 1208 | j++; |
| 1207 | } | 1209 | } |
| 1208 | if (pmu->selectable && | 1210 | if (pmu->selectable && |
| @@ -1237,8 +1239,12 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, | |||
| 1237 | printf("%*s", 8, "["); | 1239 | printf("%*s", 8, "["); |
| 1238 | wordwrap(aliases[j].desc, 8, columns, 0); | 1240 | wordwrap(aliases[j].desc, 8, columns, 0); |
| 1239 | printf("]\n"); | 1241 | printf("]\n"); |
| 1240 | if (verbose > 0) | 1242 | if (verbose > 0) { |
| 1241 | printf("%*s%s/%s/\n", 8, "", aliases[j].pmu, aliases[j].str); | 1243 | printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str); |
| 1244 | if (aliases[j].metric_expr) | ||
| 1245 | printf(" MetricExpr: %s", aliases[j].metric_expr); | ||
| 1246 | putchar('\n'); | ||
| 1247 | } | ||
| 1242 | } else | 1248 | } else |
| 1243 | printf(" %-50s [Kernel PMU event]\n", aliases[j].name); | 1249 | printf(" %-50s [Kernel PMU event]\n", aliases[j].name); |
| 1244 | printed++; | 1250 | printed++; |
