perf evsel: Ditch evsel->handler.data field
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Nov 2013 13:17:38 +0000 (10:17 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 7 Nov 2013 13:40:47 +0000 (10:40 -0300)
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>
tools/perf/builtin-inject.c
tools/perf/builtin-kmem.c
tools/perf/builtin-lock.c
tools/perf/builtin-sched.c
tools/perf/builtin-timechart.c
tools/perf/builtin-trace.c
tools/perf/util/evlist.c
tools/perf/util/evsel.h
tools/perf/util/session.c

index 409ceaf3b9b95b41adffe181156c33e93504023b..6a2508589460bfc1fec37c10163cf44b95a2ddfc 100644 (file)
@@ -106,8 +106,8 @@ static int perf_event__repipe_sample(struct perf_tool *tool,
                                     struct perf_evsel *evsel,
                                     struct machine *machine)
 {
-       if (evsel->handler.func) {
-               inject_handler f = evsel->handler.func;
+       if (evsel->handler) {
+               inject_handler f = evsel->handler;
                return f(tool, event, sample, evsel, machine);
        }
 
@@ -383,11 +383,11 @@ static int __cmd_inject(struct perf_inject *inject)
                                if (perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID"))
                                        return -EINVAL;
 
-                               evsel->handler.func = perf_inject__sched_switch;
+                               evsel->handler = perf_inject__sched_switch;
                        } else if (!strcmp(name, "sched:sched_process_exit"))
-                               evsel->handler.func = perf_inject__sched_process_exit;
+                               evsel->handler = perf_inject__sched_process_exit;
                        else if (!strncmp(name, "sched:sched_stat_", 17))
-                               evsel->handler.func = perf_inject__sched_stat;
+                               evsel->handler = perf_inject__sched_stat;
                }
        }
 
index a28970f7ddfb4bd4138aa1e9392c3246c107a359..929462aa494351f5f237eaa03ce0042146853945 100644 (file)
@@ -317,8 +317,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
 
        dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid);
 
-       if (evsel->handler.func != NULL) {
-               tracepoint_handler f = evsel->handler.func;
+       if (evsel->handler != NULL) {
+               tracepoint_handler f = evsel->handler;
                return f(evsel, sample);
        }
 
index 35f9aaa565cc6e624f92525917e996877640202b..c852c7a85d3236e86781b15616858a76b56c6206 100644 (file)
@@ -819,8 +819,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
                return -1;
        }
 
-       if (evsel->handler.func != NULL) {
-               tracepoint_handler f = evsel->handler.func;
+       if (evsel->handler != NULL) {
+               tracepoint_handler f = evsel->handler;
                return f(evsel, sample);
        }
 
index a81ab1828aa5a1a6f2999b3c73138eb278f65218..0f3c65518a2c669a9b83ad255d1018368de6ec69 100644 (file)
@@ -1427,8 +1427,8 @@ static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_
        evsel->hists.stats.total_period += sample->period;
        hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
 
-       if (evsel->handler.func != NULL) {
-               tracepoint_handler f = evsel->handler.func;
+       if (evsel->handler != NULL) {
+               tracepoint_handler f = evsel->handler;
                err = f(tool, evsel, sample, machine);
        }
 
index e11c61d9bda4dee188719f96b2fdbb00e5d6140f..41c9bde2fb67f1418faceaaf86475a163694bdeb 100644 (file)
@@ -483,8 +483,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
        if (sample->cpu > numcpus)
                numcpus = sample->cpu;
 
-       if (evsel->handler.func != NULL) {
-               tracepoint_handler f = evsel->handler.func;
+       if (evsel->handler != NULL) {
+               tracepoint_handler f = evsel->handler;
                return f(evsel, sample);
        }
 
index b3e57dc64546350f541c29cf08dc899a0effffa3..ee59df300a34d76888792365182c05ce3d2ae714 100644 (file)
@@ -1570,7 +1570,7 @@ static int trace__process_sample(struct perf_tool *tool,
        struct trace *trace = container_of(tool, struct trace, tool);
        int err = 0;
 
-       tracepoint_handler handler = evsel->handler.func;
+       tracepoint_handler handler = evsel->handler;
 
        if (skip_sample(trace, sample))
                return 0;
@@ -1656,7 +1656,7 @@ static void perf_evlist__add_vfs_getname(struct perf_evlist *evlist)
                return;
        }
 
-       evsel->handler.func = trace__vfs_getname;
+       evsel->handler = trace__vfs_getname;
        perf_evlist__add(evlist, evsel);
 }
 
@@ -1768,7 +1768,7 @@ again:
                                goto next_event;
                        }
 
-                       handler = evsel->handler.func;
+                       handler = evsel->handler;
                        handler(trace, evsel, &sample);
 next_event:
                        perf_evlist__mmap_consume(evlist, i);
index 1c173ccb0ef2849233ea2d3a5e8b089267fbebcc..b939221efd8dea0b670d1d968e7fa9086c7034a0 100644 (file)
@@ -255,7 +255,7 @@ int perf_evlist__add_newtp(struct perf_evlist *evlist,
        if (evsel == NULL)
                return -1;
 
-       evsel->handler.func = handler;
+       evsel->handler = handler;
        perf_evlist__add(evlist, evsel);
        return 0;
 }
index 5aa68cddc7d9fff14bf6fdff9be38dcf2655a483..64ec8e1a7a2879a21c0592cbe1b50bd7b13f7ea0 100644 (file)
@@ -74,10 +74,7 @@ struct perf_evsel {
                off_t           id_offset;
        };
        struct cgroup_sel       *cgrp;
-       struct {
-               void            *func;
-               void            *data;
-       } handler;
+       void                    *handler;
        struct cpu_map          *cpus;
        unsigned int            sample_size;
        int                     id_pos;
index 0ce46943d62794dcd1e86abf716c69e46951d716..f36d24a024453f6e2777d1bc4cfbb10fb9a3cf4a 100644 (file)
@@ -1650,9 +1650,9 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session,
                        continue;
 
                err = -EEXIST;
-               if (evsel->handler.func != NULL)
+               if (evsel->handler != NULL)
                        goto out;
-               evsel->handler.func = assocs[i].handler;
+               evsel->handler = assocs[i].handler;
        }
 
        err = 0;