diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 05:30:20 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 07:39:28 -0500 |
commit | 45694aa7702bc44d538a3bcb51bb2bb96cf190c0 (patch) | |
tree | 81bc1f449f55984556d89b63c461dcf181dc97e5 /tools/perf/builtin-timechart.c | |
parent | 743eb868657bdb1b26c7b24077ca21c67c82c777 (diff) |
perf tools: Rename perf_event_ops to perf_tool
To better reflect that it became the base class for all tools, that must
be in each tool struct and where common stuff will be put.
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-qgpc4msetqlwr8y2k7537cxe@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.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 8e6539625bc1..135376a37f97 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "util/event.h" | 32 | #include "util/event.h" |
33 | #include "util/session.h" | 33 | #include "util/session.h" |
34 | #include "util/svghelper.h" | 34 | #include "util/svghelper.h" |
35 | #include "util/tool.h" | ||
35 | 36 | ||
36 | #define SUPPORT_OLD_POWER_EVENTS 1 | 37 | #define SUPPORT_OLD_POWER_EVENTS 1 |
37 | #define PWR_EVENT_EXIT -1 | 38 | #define PWR_EVENT_EXIT -1 |
@@ -274,7 +275,7 @@ static int cpus_cstate_state[MAX_CPUS]; | |||
274 | static u64 cpus_pstate_start_times[MAX_CPUS]; | 275 | static u64 cpus_pstate_start_times[MAX_CPUS]; |
275 | static u64 cpus_pstate_state[MAX_CPUS]; | 276 | static u64 cpus_pstate_state[MAX_CPUS]; |
276 | 277 | ||
277 | static int process_comm_event(struct perf_event_ops *ops __used, | 278 | static int process_comm_event(struct perf_tool *tool __used, |
278 | union perf_event *event, | 279 | union perf_event *event, |
279 | struct perf_sample *sample __used, | 280 | struct perf_sample *sample __used, |
280 | struct machine *machine __used) | 281 | struct machine *machine __used) |
@@ -283,7 +284,7 @@ static int process_comm_event(struct perf_event_ops *ops __used, | |||
283 | return 0; | 284 | return 0; |
284 | } | 285 | } |
285 | 286 | ||
286 | static int process_fork_event(struct perf_event_ops *ops __used, | 287 | static int process_fork_event(struct perf_tool *tool __used, |
287 | union perf_event *event, | 288 | union perf_event *event, |
288 | struct perf_sample *sample __used, | 289 | struct perf_sample *sample __used, |
289 | struct machine *machine __used) | 290 | struct machine *machine __used) |
@@ -292,7 +293,7 @@ static int process_fork_event(struct perf_event_ops *ops __used, | |||
292 | return 0; | 293 | return 0; |
293 | } | 294 | } |
294 | 295 | ||
295 | static int process_exit_event(struct perf_event_ops *ops __used, | 296 | static int process_exit_event(struct perf_tool *tool __used, |
296 | union perf_event *event, | 297 | union perf_event *event, |
297 | struct perf_sample *sample __used, | 298 | struct perf_sample *sample __used, |
298 | struct machine *machine __used) | 299 | struct machine *machine __used) |
@@ -490,7 +491,7 @@ static void sched_switch(int cpu, u64 timestamp, struct trace_entry *te) | |||
490 | } | 491 | } |
491 | 492 | ||
492 | 493 | ||
493 | static int process_sample_event(struct perf_event_ops *ops __used, | 494 | static int process_sample_event(struct perf_tool *tool __used, |
494 | union perf_event *event __used, | 495 | union perf_event *event __used, |
495 | struct perf_sample *sample, | 496 | struct perf_sample *sample, |
496 | struct perf_evsel *evsel, | 497 | struct perf_evsel *evsel, |
@@ -979,7 +980,7 @@ static void write_svg_file(const char *filename) | |||
979 | svg_close(); | 980 | svg_close(); |
980 | } | 981 | } |
981 | 982 | ||
982 | static struct perf_event_ops event_ops = { | 983 | static struct perf_tool perf_timechart = { |
983 | .comm = process_comm_event, | 984 | .comm = process_comm_event, |
984 | .fork = process_fork_event, | 985 | .fork = process_fork_event, |
985 | .exit = process_exit_event, | 986 | .exit = process_exit_event, |
@@ -990,7 +991,7 @@ static struct perf_event_ops event_ops = { | |||
990 | static int __cmd_timechart(void) | 991 | static int __cmd_timechart(void) |
991 | { | 992 | { |
992 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, | 993 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, |
993 | 0, false, &event_ops); | 994 | 0, false, &perf_timechart); |
994 | int ret = -EINVAL; | 995 | int ret = -EINVAL; |
995 | 996 | ||
996 | if (session == NULL) | 997 | if (session == NULL) |
@@ -999,7 +1000,7 @@ static int __cmd_timechart(void) | |||
999 | if (!perf_session__has_traces(session, "timechart record")) | 1000 | if (!perf_session__has_traces(session, "timechart record")) |
1000 | goto out_delete; | 1001 | goto out_delete; |
1001 | 1002 | ||
1002 | ret = perf_session__process_events(session, &event_ops); | 1003 | ret = perf_session__process_events(session, &perf_timechart); |
1003 | if (ret) | 1004 | if (ret) |
1004 | goto out_delete; | 1005 | goto out_delete; |
1005 | 1006 | ||