aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-timechart.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-25 05:19:45 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:38:56 -0500
commitd20deb64e0490ee9442b5181bc08a62d2cadcb90 (patch)
treeafdb3f6fc9abbce9d0a96b7049d1f8121178a356 /tools/perf/builtin-timechart.c
parent7009cc34b964939815160d7de64cf0215cdbf8bb (diff)
perf tools: Pass tool context in the the perf_event_ops functions
So that we don't need to have that many globals. Next steps will remove the 'session' pointer, that in most cases is not needed. Then we can rename perf_event_ops to 'perf_tool' that better describes this class hierarchy. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.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-wp4djox7x6w1i2bab1pt4xxp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r--tools/perf/builtin-timechart.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 3fc52b1aa430..62298a0d7dc9 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -274,7 +274,8 @@ static int cpus_cstate_state[MAX_CPUS];
274static u64 cpus_pstate_start_times[MAX_CPUS]; 274static u64 cpus_pstate_start_times[MAX_CPUS];
275static u64 cpus_pstate_state[MAX_CPUS]; 275static u64 cpus_pstate_state[MAX_CPUS];
276 276
277static int process_comm_event(union perf_event *event, 277static int process_comm_event(struct perf_event_ops *ops __used,
278 union perf_event *event,
278 struct perf_sample *sample __used, 279 struct perf_sample *sample __used,
279 struct perf_session *session __used) 280 struct perf_session *session __used)
280{ 281{
@@ -282,7 +283,8 @@ static int process_comm_event(union perf_event *event,
282 return 0; 283 return 0;
283} 284}
284 285
285static int process_fork_event(union perf_event *event, 286static int process_fork_event(struct perf_event_ops *ops __used,
287 union perf_event *event,
286 struct perf_sample *sample __used, 288 struct perf_sample *sample __used,
287 struct perf_session *session __used) 289 struct perf_session *session __used)
288{ 290{
@@ -290,7 +292,8 @@ static int process_fork_event(union perf_event *event,
290 return 0; 292 return 0;
291} 293}
292 294
293static int process_exit_event(union perf_event *event, 295static int process_exit_event(struct perf_event_ops *ops __used,
296 union perf_event *event,
294 struct perf_sample *sample __used, 297 struct perf_sample *sample __used,
295 struct perf_session *session __used) 298 struct perf_session *session __used)
296{ 299{
@@ -487,7 +490,8 @@ static void sched_switch(int cpu, u64 timestamp, struct trace_entry *te)
487} 490}
488 491
489 492
490static int process_sample_event(union perf_event *event __used, 493static int process_sample_event(struct perf_event_ops *ops __used,
494 union perf_event *event __used,
491 struct perf_sample *sample, 495 struct perf_sample *sample,
492 struct perf_evsel *evsel, 496 struct perf_evsel *evsel,
493 struct perf_session *session __used) 497 struct perf_session *session __used)