aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 05:30:20 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:39:28 -0500
commit45694aa7702bc44d538a3bcb51bb2bb96cf190c0 (patch)
tree81bc1f449f55984556d89b63c461dcf181dc97e5 /tools/perf/builtin-annotate.c
parent743eb868657bdb1b26c7b24077ca21c67c82c777 (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-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index dff081a388bb..c01139fa4a10 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -27,11 +27,12 @@
27#include "util/sort.h" 27#include "util/sort.h"
28#include "util/hist.h" 28#include "util/hist.h"
29#include "util/session.h" 29#include "util/session.h"
30#include "util/tool.h"
30 31
31#include <linux/bitmap.h> 32#include <linux/bitmap.h>
32 33
33struct perf_annotate { 34struct perf_annotate {
34 struct perf_event_ops ops; 35 struct perf_tool tool;
35 char const *input_name; 36 char const *input_name;
36 bool force, use_tui, use_stdio; 37 bool force, use_tui, use_stdio;
37 bool full_paths; 38 bool full_paths;
@@ -79,13 +80,13 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
79 return ret; 80 return ret;
80} 81}
81 82
82static int process_sample_event(struct perf_event_ops *ops, 83static int process_sample_event(struct perf_tool *tool,
83 union perf_event *event, 84 union perf_event *event,
84 struct perf_sample *sample, 85 struct perf_sample *sample,
85 struct perf_evsel *evsel, 86 struct perf_evsel *evsel,
86 struct machine *machine) 87 struct machine *machine)
87{ 88{
88 struct perf_annotate *ann = container_of(ops, struct perf_annotate, ops); 89 struct perf_annotate *ann = container_of(tool, struct perf_annotate, tool);
89 struct addr_location al; 90 struct addr_location al;
90 91
91 if (perf_event__preprocess_sample(event, machine, &al, sample, 92 if (perf_event__preprocess_sample(event, machine, &al, sample,
@@ -174,7 +175,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
174 u64 total_nr_samples; 175 u64 total_nr_samples;
175 176
176 session = perf_session__new(ann->input_name, O_RDONLY, 177 session = perf_session__new(ann->input_name, O_RDONLY,
177 ann->force, false, &ann->ops); 178 ann->force, false, &ann->tool);
178 if (session == NULL) 179 if (session == NULL)
179 return -ENOMEM; 180 return -ENOMEM;
180 181
@@ -185,7 +186,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
185 goto out_delete; 186 goto out_delete;
186 } 187 }
187 188
188 ret = perf_session__process_events(session, &ann->ops); 189 ret = perf_session__process_events(session, &ann->tool);
189 if (ret) 190 if (ret)
190 goto out_delete; 191 goto out_delete;
191 192
@@ -241,7 +242,7 @@ static const char * const annotate_usage[] = {
241int cmd_annotate(int argc, const char **argv, const char *prefix __used) 242int cmd_annotate(int argc, const char **argv, const char *prefix __used)
242{ 243{
243 struct perf_annotate annotate = { 244 struct perf_annotate annotate = {
244 .ops = { 245 .tool = {
245 .sample = process_sample_event, 246 .sample = process_sample_event,
246 .mmap = perf_event__process_mmap, 247 .mmap = perf_event__process_mmap,
247 .comm = perf_event__process_comm, 248 .comm = perf_event__process_comm,