diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 14:30:20 +0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 16:39:28 +0400 |
commit | 45694aa7702bc44d538a3bcb51bb2bb96cf190c0 (patch) | |
tree | 81bc1f449f55984556d89b63c461dcf181dc97e5 /tools/perf/builtin-report.c | |
parent | 743eb868657bdb1b26c7b24077ca21c67c82c777 (diff) | |
download | linux-45694aa7702bc44d538a3bcb51bb2bb96cf190c0.tar.xz |
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-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index ea64fbbdff43..eef8e423deb0 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -25,6 +25,7 @@ #include "util/evsel.h" #include "util/header.h" #include "util/session.h" +#include "util/tool.h" #include "util/parse-options.h" #include "util/parse-events.h" @@ -36,7 +37,7 @@ #include <linux/bitmap.h> struct perf_report { - struct perf_event_ops ops; + struct perf_tool tool; struct perf_session *session; char const *input_name; bool force, use_tui, use_stdio; @@ -103,13 +104,13 @@ out: } -static int process_sample_event(struct perf_event_ops *ops, +static int process_sample_event(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine) { - struct perf_report *rep = container_of(ops, struct perf_report, ops); + struct perf_report *rep = container_of(tool, struct perf_report, tool); struct addr_location al; if (perf_event__preprocess_sample(event, machine, &al, sample, @@ -136,13 +137,13 @@ static int process_sample_event(struct perf_event_ops *ops, return 0; } -static int process_read_event(struct perf_event_ops *ops, +static int process_read_event(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample __used, struct perf_evsel *evsel, struct machine *machine __used) { - struct perf_report *rep = container_of(ops, struct perf_report, ops); + struct perf_report *rep = container_of(tool, struct perf_report, tool); if (rep->show_threads) { const char *name = evsel ? event_name(evsel) : "unknown"; @@ -254,7 +255,7 @@ static int __cmd_report(struct perf_report *rep) signal(SIGINT, sig_handler); session = perf_session__new(rep->input_name, O_RDONLY, - rep->force, false, &rep->ops); + rep->force, false, &rep->tool); if (session == NULL) return -ENOMEM; @@ -277,7 +278,7 @@ static int __cmd_report(struct perf_report *rep) if (ret) goto out_delete; - ret = perf_session__process_events(session, &rep->ops); + ret = perf_session__process_events(session, &rep->tool); if (ret) goto out_delete; @@ -435,7 +436,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) NULL }; struct perf_report report = { - .ops = { + .tool = { .sample = process_sample_event, .mmap = perf_event__process_mmap, .comm = perf_event__process_comm, |