aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-06-13 10:53:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-06-19 12:06:21 -0400
commit6eef3d9c2bcf52b7a3c18e609f5838c007b989a4 (patch)
tree84e8109b2ac84a4fcef7e392a9b0ad87aedd4e53
parent9db1763c72b1548626ae9d634015de4f07ef624f (diff)
perf evsel: Reconstruct raw event with modifiers from perf_event_attr
I forgot to add the modifiers to raw events too, fix it. Reported-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-pi267j1aqqjti9rqh9qy4g58@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/evsel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 236bdf25db6d..8f0e9dd03775 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -252,6 +252,12 @@ static int perf_evsel__hw_cache_name(struct perf_evsel *evsel, char *bf, size_t
252 return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); 252 return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret);
253} 253}
254 254
255static int perf_evsel__raw_name(struct perf_evsel *evsel, char *bf, size_t size)
256{
257 int ret = scnprintf(bf, size, "raw 0x%" PRIx64, evsel->attr.config);
258 return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret);
259}
260
255const char *perf_evsel__name(struct perf_evsel *evsel) 261const char *perf_evsel__name(struct perf_evsel *evsel)
256{ 262{
257 char bf[128]; 263 char bf[128];
@@ -261,7 +267,7 @@ const char *perf_evsel__name(struct perf_evsel *evsel)
261 267
262 switch (evsel->attr.type) { 268 switch (evsel->attr.type) {
263 case PERF_TYPE_RAW: 269 case PERF_TYPE_RAW:
264 scnprintf(bf, sizeof(bf), "raw 0x%" PRIx64, evsel->attr.config); 270 perf_evsel__raw_name(evsel, bf, sizeof(bf));
265 break; 271 break;
266 272
267 case PERF_TYPE_HARDWARE: 273 case PERF_TYPE_HARDWARE: