Skip to content

Commit

Permalink
perf evsel: Reconstruct raw event with modifiers from perf_event_attr
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jun 19, 2012
1 parent 9db1763 commit 6eef3d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ static int perf_evsel__hw_cache_name(struct perf_evsel *evsel, char *bf, size_t
return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret);
}

static int perf_evsel__raw_name(struct perf_evsel *evsel, char *bf, size_t size)
{
int ret = scnprintf(bf, size, "raw 0x%" PRIx64, evsel->attr.config);
return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret);
}

const char *perf_evsel__name(struct perf_evsel *evsel)
{
char bf[128];
Expand All @@ -261,7 +267,7 @@ const char *perf_evsel__name(struct perf_evsel *evsel)

switch (evsel->attr.type) {
case PERF_TYPE_RAW:
scnprintf(bf, sizeof(bf), "raw 0x%" PRIx64, evsel->attr.config);
perf_evsel__raw_name(evsel, bf, sizeof(bf));
break;

case PERF_TYPE_HARDWARE:
Expand Down

0 comments on commit 6eef3d9

Please sign in to comment.