aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-11-06 08:17:38 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-07 08:40:47 -0500
commit744a971940520cf0818e1fe882b64892c528e6de (patch)
treebb7dbdeee810d10c2593ad52c6d13c01da7de2de /tools
parent8a4d0b56b031455adcbe4a9383c3b497456fcfac (diff)
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-inject.c10
-rw-r--r--tools/perf/builtin-kmem.c4
-rw-r--r--tools/perf/builtin-lock.c4
-rw-r--r--tools/perf/builtin-sched.c4
-rw-r--r--tools/perf/builtin-timechart.c4
-rw-r--r--tools/perf/builtin-trace.c6
-rw-r--r--tools/perf/util/evlist.c2
-rw-r--r--tools/perf/util/evsel.h5
-rw-r--r--tools/perf/util/session.c4
9 files changed, 20 insertions, 23 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 409ceaf3b9b9..6a2508589460 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -106,8 +106,8 @@ static int perf_event__repipe_sample(struct perf_tool *tool,
106 struct perf_evsel *evsel, 106 struct perf_evsel *evsel,
107 struct machine *machine) 107 struct machine *machine)
108{ 108{
109 if (evsel->handler.func) { 109 if (evsel->handler) {
110 inject_handler f = evsel->handler.func; 110 inject_handler f = evsel->handler;
111 return f(tool, event, sample, evsel, machine); 111 return f(tool, event, sample, evsel, machine);
112 } 112 }
113 113
@@ -383,11 +383,11 @@ static int __cmd_inject(struct perf_inject *inject)
383 if (perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID")) 383 if (perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID"))
384 return -EINVAL; 384 return -EINVAL;
385 385
386 evsel->handler.func = perf_inject__sched_switch; 386 evsel->handler = perf_inject__sched_switch;
387 } else if (!strcmp(name, "sched:sched_process_exit")) 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 else if (!strncmp(name, "sched:sched_stat_", 17)) 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
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index a28970f7ddfb..929462aa4943 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -317,8 +317,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
317 317
318 dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); 318 dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid);
319 319
320 if (evsel->handler.func != NULL) { 320 if (evsel->handler != NULL) {
321 tracepoint_handler f = evsel->handler.func; 321 tracepoint_handler f = evsel->handler;
322 return f(evsel, sample); 322 return f(evsel, sample);
323 } 323 }
324 324
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 35f9aaa565cc..c852c7a85d32 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -819,8 +819,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
819 return -1; 819 return -1;
820 } 820 }
821 821
822 if (evsel->handler.func != NULL) { 822 if (evsel->handler != NULL) {
823 tracepoint_handler f = evsel->handler.func; 823 tracepoint_handler f = evsel->handler;
824 return f(evsel, sample); 824 return f(evsel, sample);
825 } 825 }
826 826
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index a81ab1828aa5..0f3c65518a2c 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1427,8 +1427,8 @@ static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_
1427 evsel->hists.stats.total_period += sample->period; 1427 evsel->hists.stats.total_period += sample->period;
1428 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); 1428 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
1429 1429
1430 if (evsel->handler.func != NULL) { 1430 if (evsel->handler != NULL) {
1431 tracepoint_handler f = evsel->handler.func; 1431 tracepoint_handler f = evsel->handler;
1432 err = f(tool, evsel, sample, machine); 1432 err = f(tool, evsel, sample, machine);
1433 } 1433 }
1434 1434
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index e11c61d9bda4..41c9bde2fb67 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -483,8 +483,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
483 if (sample->cpu > numcpus) 483 if (sample->cpu > numcpus)
484 numcpus = sample->cpu; 484 numcpus = sample->cpu;
485 485
486 if (evsel->handler.func != NULL) { 486 if (evsel->handler != NULL) {
487 tracepoint_handler f = evsel->handler.func; 487 tracepoint_handler f = evsel->handler;
488 return f(evsel, sample); 488 return f(evsel, sample);
489 } 489 }
490 490
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index b3e57dc64546..ee59df300a34 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1570,7 +1570,7 @@ static int trace__process_sample(struct perf_tool *tool,
1570 struct trace *trace = container_of(tool, struct trace, tool); 1570 struct trace *trace = container_of(tool, struct trace, tool);
1571 int err = 0; 1571 int err = 0;
1572 1572
1573 tracepoint_handler handler = evsel->handler.func; 1573 tracepoint_handler handler = evsel->handler;
1574 1574
1575 if (skip_sample(trace, sample)) 1575 if (skip_sample(trace, sample))
1576 return 0; 1576 return 0;
@@ -1656,7 +1656,7 @@ static void perf_evlist__add_vfs_getname(struct perf_evlist *evlist)
1656 return; 1656 return;
1657 } 1657 }
1658 1658
1659 evsel->handler.func = trace__vfs_getname; 1659 evsel->handler = trace__vfs_getname;
1660 perf_evlist__add(evlist, evsel); 1660 perf_evlist__add(evlist, evsel);
1661} 1661}
1662 1662
@@ -1768,7 +1768,7 @@ again:
1768 goto next_event; 1768 goto next_event;
1769 } 1769 }
1770 1770
1771 handler = evsel->handler.func; 1771 handler = evsel->handler;
1772 handler(trace, evsel, &sample); 1772 handler(trace, evsel, &sample);
1773next_event: 1773next_event:
1774 perf_evlist__mmap_consume(evlist, i); 1774 perf_evlist__mmap_consume(evlist, i);
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 1c173ccb0ef2..b939221efd8d 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -255,7 +255,7 @@ int perf_evlist__add_newtp(struct perf_evlist *evlist,
255 if (evsel == NULL) 255 if (evsel == NULL)
256 return -1; 256 return -1;
257 257
258 evsel->handler.func = handler; 258 evsel->handler = handler;
259 perf_evlist__add(evlist, evsel); 259 perf_evlist__add(evlist, evsel);
260 return 0; 260 return 0;
261} 261}
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 5aa68cddc7d9..64ec8e1a7a28 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -74,10 +74,7 @@ struct perf_evsel {
74 off_t id_offset; 74 off_t id_offset;
75 }; 75 };
76 struct cgroup_sel *cgrp; 76 struct cgroup_sel *cgrp;
77 struct { 77 void *handler;
78 void *func;
79 void *data;
80 } handler;
81 struct cpu_map *cpus; 78 struct cpu_map *cpus;
82 unsigned int sample_size; 79 unsigned int sample_size;
83 int id_pos; 80 int id_pos;
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 0ce46943d627..f36d24a02445 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1650,9 +1650,9 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session,
1650 continue; 1650 continue;
1651 1651
1652 err = -EEXIST; 1652 err = -EEXIST;
1653 if (evsel->handler.func != NULL) 1653 if (evsel->handler != NULL)
1654 goto out; 1654 goto out;
1655 evsel->handler.func = assocs[i].handler; 1655 evsel->handler = assocs[i].handler;
1656 } 1656 }
1657 1657
1658 err = 0; 1658 err = 0;