Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1608885
| From | tip-bot for Andi Kleen <tipbot@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [tip:perf/core] perf list: Support printing MetricExpr with --debug |
| Date | 2017-03-24 20:00 +0100 |
| Message-ID | <toCBj-5D8-17@gated-at.bofh.it> (permalink) |
| References | <tnbWy-1r6-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Commit-ID: 7f372a636d92e21d6fa41aebd6986ef590aefbfc
Gitweb: http://git.kernel.org/tip/7f372a636d92e21d6fa41aebd6986ef590aefbfc
Author: Andi Kleen <ak@linux.intel.com>
AuthorDate: Mon, 20 Mar 2017 13:17:09 -0700
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 23 Mar 2017 11:42:30 -0300
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>
---
tools/perf/util/pmu.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 0f1133a..f819ad1 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1105,6 +1105,7 @@ struct sevent {
char *topic;
char *str;
char *pmu;
+ char *metric_expr;
};
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,
aliases[j].topic = alias->topic;
aliases[j].str = alias->str;
aliases[j].pmu = pmu->name;
+ aliases[j].metric_expr = alias->metric_expr;
j++;
}
if (pmu->selectable &&
@@ -1237,8 +1239,12 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
printf("%*s", 8, "[");
wordwrap(aliases[j].desc, 8, columns, 0);
printf("]\n");
- if (verbose > 0)
- printf("%*s%s/%s/\n", 8, "", aliases[j].pmu, aliases[j].str);
+ if (verbose > 0) {
+ printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str);
+ if (aliases[j].metric_expr)
+ printf(" MetricExpr: %s", aliases[j].metric_expr);
+ putchar('\n');
+ }
} else
printf(" %-50s [Kernel PMU event]\n", aliases[j].name);
printed++;
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 11/13] perf, tools, list: Support printing MetricExpr with --debug Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:20 +0100 [tip:perf/core] perf list: Support printing MetricExpr with --debug tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
csiph-web