diff options
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 641c4ac8a838..d73690b11242 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -203,24 +203,9 @@ const char *event_type(int type) | |||
203 | 203 | ||
204 | const char *event_name(struct perf_evsel *evsel) | 204 | const char *event_name(struct perf_evsel *evsel) |
205 | { | 205 | { |
206 | u64 config = evsel->attr.config; | 206 | static char bf[128]; |
207 | int type = evsel->attr.type; | 207 | perf_evsel__name(evsel, bf, sizeof(bf)); |
208 | 208 | return bf; | |
209 | if (type == PERF_TYPE_RAW || type == PERF_TYPE_HARDWARE || | ||
210 | type == PERF_TYPE_SOFTWARE || type == PERF_TYPE_HW_CACHE) { | ||
211 | /* | ||
212 | * XXX minimal fix, see comment on perf_evsen__name, this static buffer | ||
213 | * will go away together with event_name in the next devel cycle. | ||
214 | */ | ||
215 | static char bf[128]; | ||
216 | perf_evsel__name(evsel, bf, sizeof(bf)); | ||
217 | return bf; | ||
218 | } | ||
219 | |||
220 | if (evsel->name) | ||
221 | return evsel->name; | ||
222 | |||
223 | return __event_name(type, config); | ||
224 | } | 209 | } |
225 | 210 | ||
226 | const char *__event_name(int type, u64 config) | 211 | const char *__event_name(int type, u64 config) |