diff options
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index ae89686102f4..6a2809fd257e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -285,6 +285,20 @@ out: return err; } +int perf_evlist__add_newtp(struct perf_evlist *evlist, + const char *sys, const char *name, void *handler) +{ + struct perf_evsel *evsel; + + evsel = perf_evsel__newtp(sys, name, evlist->nr_entries); + if (evsel == NULL) + return -1; + + evsel->handler.func = handler; + perf_evlist__add(evlist, evsel); + return 0; +} + void perf_evlist__disable(struct perf_evlist *evlist) { int cpu, thread; |