@@ -225,13 +225,13 @@ out_free_attrs:
}
static struct perf_evsel *
- perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id)
+ perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist, const char *name)
{
struct perf_evsel *evsel;
list_for_each_entry(evsel, &evlist->entries, node) {
if (evsel->attr.type == PERF_TYPE_TRACEPOINT &&
- (int)evsel->attr.config == id)
+ !strcmp(evsel->name, name))
return evsel;
}
@@ -247,11 +247,7 @@ int perf_evlist__set_tracepoints_handlers(struct perf_evlist *evlist,
size_t i;
for (i = 0; i < nr_assocs; i++) {
- err = trace_event__id(assocs[i].name);
- if (err < 0)
- goto out;
-
- evsel = perf_evlist__find_tracepoint_by_id(evlist, err);
+ evsel = perf_evlist__find_tracepoint_by_name(evlist, assocs[i].name);
if (evsel == NULL)
continue;