From 45694aa7702bc44d538a3bcb51bb2bb96cf190c0 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 28 Nov 2011 08:30:20 -0200 Subject: 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 Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-qgpc4msetqlwr8y2k7537cxe@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-annotate.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tools/perf/builtin-annotate.c') diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index dff081a..c01139f 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -27,11 +27,12 @@ #include "util/sort.h" #include "util/hist.h" #include "util/session.h" +#include "util/tool.h" #include struct perf_annotate { - struct perf_event_ops ops; + struct perf_tool tool; char const *input_name; bool force, use_tui, use_stdio; bool full_paths; @@ -79,13 +80,13 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, return ret; } -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_annotate *ann = container_of(ops, struct perf_annotate, ops); + struct perf_annotate *ann = container_of(tool, struct perf_annotate, tool); struct addr_location al; if (perf_event__preprocess_sample(event, machine, &al, sample, @@ -174,7 +175,7 @@ static int __cmd_annotate(struct perf_annotate *ann) u64 total_nr_samples; session = perf_session__new(ann->input_name, O_RDONLY, - ann->force, false, &ann->ops); + ann->force, false, &ann->tool); if (session == NULL) return -ENOMEM; @@ -185,7 +186,7 @@ static int __cmd_annotate(struct perf_annotate *ann) goto out_delete; } - ret = perf_session__process_events(session, &ann->ops); + ret = perf_session__process_events(session, &ann->tool); if (ret) goto out_delete; @@ -241,7 +242,7 @@ static const char * const annotate_usage[] = { int cmd_annotate(int argc, const char **argv, const char *prefix __used) { struct perf_annotate annotate = { - .ops = { + .tool = { .sample = process_sample_event, .mmap = perf_event__process_mmap, .comm = perf_event__process_comm, -- cgit v1.1