summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2011-02-16 15:10:01 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-02-17 10:29:19 -0200
commitf0c55bcf4aa41b4b1dbee826513b1acb01bf65e1 (patch)
tree00ebfe5e00bf70a27f404c161c16b59ad1fcca62 /tools/perf/util/evsel.c
parent4498062e72fd55b2a9a4ac1b44fab8cb44ad5367 (diff)
downloadblackbird-op-linux-f0c55bcf4aa41b4b1dbee826513b1acb01bf65e1.tar.gz
blackbird-op-linux-f0c55bcf4aa41b4b1dbee826513b1acb01bf65e1.zip
perf: make perf stat print user provided full event names
This patch changes the way perf stat prints event names at the end of a run. Until now, it was trying to reconstruct the event name from its encoding. The problem is that it would only print generic events without their modifiers (u, k, pp). This patch saves the event name as passed by the user in the evsel struct and uses it to print the final event name. This would also work in case perf is linked with a library (such as libpfm4) which provides full PMU event tables. $ perf stat -e cycles:u,cycles:k date Wed Feb 16 14:58:52 CET 2011 Performance counter stats for 'date': 568600 cycles:u 2779715 cycles:k 0.001908182 seconds time elapsed Cc: Arun Sharma <arun@sharma-home.net> Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Robert Richter <robert.richter@amd.com> Cc: Stephane Eranian <eranian@gmail.com> LPU-Reference: <4d5bdc64.98a1df0a.7aa3.06c2@mx.google.com> Signed-off-by: Stephane Eranian <eranian@google.com> [ committer note: Fixed a merge problem with 023695d "Add cgroup support" ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.c')
-rw-r--r--tools/perf/util/evsel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index c974e08d07ab..63cadaf3e208 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -86,6 +86,7 @@ void perf_evsel__delete(struct perf_evsel *evsel)
{
perf_evsel__exit(evsel);
close_cgroup(evsel->cgrp);
+ free(evsel->name);
free(evsel);
}
OpenPOWER on IntegriCloud