Commit 744a971940520cf0818e1fe882b64892c528e6de
1 parent
8a4d0b56b0
Exists in
master
and in
16 other branches
perf evsel: Ditch evsel->handler.data field
Not needed since this cset: fcf65bf149af: perf evsel: Cache associated event_format So lets trim this struct a bit. Cc: Adrian Hunter <adrian.hunter@intel.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: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-j8setslokt0goiwxq9dogzqm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Showing 9 changed files with 20 additions and 23 deletions Side-by-side Diff
tools/perf/builtin-inject.c
... | ... | @@ -106,8 +106,8 @@ |
106 | 106 | struct perf_evsel *evsel, |
107 | 107 | struct machine *machine) |
108 | 108 | { |
109 | - if (evsel->handler.func) { | |
110 | - inject_handler f = evsel->handler.func; | |
109 | + if (evsel->handler) { | |
110 | + inject_handler f = evsel->handler; | |
111 | 111 | return f(tool, event, sample, evsel, machine); |
112 | 112 | } |
113 | 113 | |
114 | 114 | |
115 | 115 | |
... | ... | @@ -383,11 +383,11 @@ |
383 | 383 | if (perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID")) |
384 | 384 | return -EINVAL; |
385 | 385 | |
386 | - evsel->handler.func = perf_inject__sched_switch; | |
386 | + evsel->handler = perf_inject__sched_switch; | |
387 | 387 | } else if (!strcmp(name, "sched:sched_process_exit")) |
388 | - evsel->handler.func = perf_inject__sched_process_exit; | |
388 | + evsel->handler = perf_inject__sched_process_exit; | |
389 | 389 | else if (!strncmp(name, "sched:sched_stat_", 17)) |
390 | - evsel->handler.func = perf_inject__sched_stat; | |
390 | + evsel->handler = perf_inject__sched_stat; | |
391 | 391 | } |
392 | 392 | } |
393 | 393 |
tools/perf/builtin-kmem.c
... | ... | @@ -317,8 +317,8 @@ |
317 | 317 | |
318 | 318 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); |
319 | 319 | |
320 | - if (evsel->handler.func != NULL) { | |
321 | - tracepoint_handler f = evsel->handler.func; | |
320 | + if (evsel->handler != NULL) { | |
321 | + tracepoint_handler f = evsel->handler; | |
322 | 322 | return f(evsel, sample); |
323 | 323 | } |
324 | 324 |
tools/perf/builtin-lock.c
tools/perf/builtin-sched.c
... | ... | @@ -1427,8 +1427,8 @@ |
1427 | 1427 | evsel->hists.stats.total_period += sample->period; |
1428 | 1428 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
1429 | 1429 | |
1430 | - if (evsel->handler.func != NULL) { | |
1431 | - tracepoint_handler f = evsel->handler.func; | |
1430 | + if (evsel->handler != NULL) { | |
1431 | + tracepoint_handler f = evsel->handler; | |
1432 | 1432 | err = f(tool, evsel, sample, machine); |
1433 | 1433 | } |
1434 | 1434 |
tools/perf/builtin-timechart.c
... | ... | @@ -483,8 +483,8 @@ |
483 | 483 | if (sample->cpu > numcpus) |
484 | 484 | numcpus = sample->cpu; |
485 | 485 | |
486 | - if (evsel->handler.func != NULL) { | |
487 | - tracepoint_handler f = evsel->handler.func; | |
486 | + if (evsel->handler != NULL) { | |
487 | + tracepoint_handler f = evsel->handler; | |
488 | 488 | return f(evsel, sample); |
489 | 489 | } |
490 | 490 |
tools/perf/builtin-trace.c
... | ... | @@ -1570,7 +1570,7 @@ |
1570 | 1570 | struct trace *trace = container_of(tool, struct trace, tool); |
1571 | 1571 | int err = 0; |
1572 | 1572 | |
1573 | - tracepoint_handler handler = evsel->handler.func; | |
1573 | + tracepoint_handler handler = evsel->handler; | |
1574 | 1574 | |
1575 | 1575 | if (skip_sample(trace, sample)) |
1576 | 1576 | return 0; |
... | ... | @@ -1656,7 +1656,7 @@ |
1656 | 1656 | return; |
1657 | 1657 | } |
1658 | 1658 | |
1659 | - evsel->handler.func = trace__vfs_getname; | |
1659 | + evsel->handler = trace__vfs_getname; | |
1660 | 1660 | perf_evlist__add(evlist, evsel); |
1661 | 1661 | } |
1662 | 1662 | |
... | ... | @@ -1768,7 +1768,7 @@ |
1768 | 1768 | goto next_event; |
1769 | 1769 | } |
1770 | 1770 | |
1771 | - handler = evsel->handler.func; | |
1771 | + handler = evsel->handler; | |
1772 | 1772 | handler(trace, evsel, &sample); |
1773 | 1773 | next_event: |
1774 | 1774 | perf_evlist__mmap_consume(evlist, i); |
tools/perf/util/evlist.c
tools/perf/util/evsel.h
tools/perf/util/session.c
... | ... | @@ -1650,9 +1650,9 @@ |
1650 | 1650 | continue; |
1651 | 1651 | |
1652 | 1652 | err = -EEXIST; |
1653 | - if (evsel->handler.func != NULL) | |
1653 | + if (evsel->handler != NULL) | |
1654 | 1654 | goto out; |
1655 | - evsel->handler.func = assocs[i].handler; | |
1655 | + evsel->handler = assocs[i].handler; | |
1656 | 1656 | } |
1657 | 1657 | |
1658 | 1658 | err = 0; |