diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-26 16:11:38 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-26 17:29:17 -0400 |
commit | e48ffe2bd49936314d367a8c6b5eaaa17d581d13 (patch) | |
tree | 41beff711243b14bdc96d6a4479d4cf334d91b45 /tools | |
parent | 745cefc5fba4350243bcb63cd6f75fb47ca77725 (diff) |
perf evsel: The tracepoint constructor should store sys:name
Not event_format->name, that doesn't contains the sys: part.
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-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 6022daaa741..6f2a8c30413 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -122,6 +122,9 @@ struct perf_evsel *perf_evsel__newtp(const char *sys, const char *name, int idx) | |||
122 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD), | 122 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD), |
123 | }; | 123 | }; |
124 | 124 | ||
125 | if (asprintf(&evsel->name, "%s:%s", sys, name) < 0) | ||
126 | goto out_free; | ||
127 | |||
125 | evsel->tp_format = event_format__new(sys, name); | 128 | evsel->tp_format = event_format__new(sys, name); |
126 | if (evsel->tp_format == NULL) | 129 | if (evsel->tp_format == NULL) |
127 | goto out_free; | 130 | goto out_free; |
@@ -130,12 +133,12 @@ struct perf_evsel *perf_evsel__newtp(const char *sys, const char *name, int idx) | |||
130 | attr.config = evsel->tp_format->id; | 133 | attr.config = evsel->tp_format->id; |
131 | attr.sample_period = 1; | 134 | attr.sample_period = 1; |
132 | perf_evsel__init(evsel, &attr, idx); | 135 | perf_evsel__init(evsel, &attr, idx); |
133 | evsel->name = evsel->tp_format->name; | ||
134 | } | 136 | } |
135 | 137 | ||
136 | return evsel; | 138 | return evsel; |
137 | 139 | ||
138 | out_free: | 140 | out_free: |
141 | free(evsel->name); | ||
139 | free(evsel); | 142 | free(evsel); |
140 | return NULL; | 143 | return NULL; |
141 | } | 144 | } |
@@ -584,10 +587,8 @@ void perf_evsel__delete(struct perf_evsel *evsel) | |||
584 | perf_evsel__exit(evsel); | 587 | perf_evsel__exit(evsel); |
585 | close_cgroup(evsel->cgrp); | 588 | close_cgroup(evsel->cgrp); |
586 | free(evsel->group_name); | 589 | free(evsel->group_name); |
587 | if (evsel->tp_format && evsel->name == evsel->tp_format->name) { | 590 | if (evsel->tp_format) |
588 | evsel->name = NULL; | ||
589 | pevent_free_format(evsel->tp_format); | 591 | pevent_free_format(evsel->tp_format); |
590 | } | ||
591 | free(evsel->name); | 592 | free(evsel->name); |
592 | free(evsel); | 593 | free(evsel); |
593 | } | 594 | } |