diff options
author | Namhyung Kim <namhyung@kernel.org> | 2015-12-22 12:06:58 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-06 18:11:10 -0500 |
commit | fd36f3dd79331b9610664b867ff205465bf9ce68 (patch) | |
tree | ea10d151dc30cfbe951055df12dd58f8456ac475 /tools/perf/builtin-annotate.c | |
parent | 9cc2617de5b9222abb39cd02e90d57dfea99c6d7 (diff) |
perf hist: Pass struct sample to __hists__add_entry()
This is a preparation to add more info into the hist_entry. Also it
already passes too many argument, so passing sample directly will reduce
the overhead of the function call.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1450804030-29193-2-git-send-email-namhyung@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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index e18f1b995ffd..b5b8db0b0338 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -47,7 +47,7 @@ struct perf_annotate { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | static int perf_evsel__add_sample(struct perf_evsel *evsel, | 49 | static int perf_evsel__add_sample(struct perf_evsel *evsel, |
50 | struct perf_sample *sample __maybe_unused, | 50 | struct perf_sample *sample, |
51 | struct addr_location *al, | 51 | struct addr_location *al, |
52 | struct perf_annotate *ann) | 52 | struct perf_annotate *ann) |
53 | { | 53 | { |
@@ -72,7 +72,10 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, | |||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | he = __hists__add_entry(hists, al, NULL, NULL, NULL, 1, 1, 0, true); | 75 | sample->period = 1; |
76 | sample->weight = 1; | ||
77 | |||
78 | he = __hists__add_entry(hists, al, NULL, NULL, NULL, sample, true); | ||
76 | if (he == NULL) | 79 | if (he == NULL) |
77 | return -ENOMEM; | 80 | return -ENOMEM; |
78 | 81 | ||