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-diff.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-diff.c')
-rw-r--r-- | tools/perf/builtin-diff.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 0b180a885ba3..69f5b1feff39 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c | |||
@@ -311,11 +311,11 @@ static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair, | |||
311 | } | 311 | } |
312 | 312 | ||
313 | static int hists__add_entry(struct hists *hists, | 313 | static int hists__add_entry(struct hists *hists, |
314 | struct addr_location *al, u64 period, | 314 | struct addr_location *al, |
315 | u64 weight, u64 transaction) | 315 | struct perf_sample *sample) |
316 | { | 316 | { |
317 | if (__hists__add_entry(hists, al, NULL, NULL, NULL, period, weight, | 317 | if (__hists__add_entry(hists, al, NULL, NULL, NULL, |
318 | transaction, true) != NULL) | 318 | sample, true) != NULL) |
319 | return 0; | 319 | return 0; |
320 | return -ENOMEM; | 320 | return -ENOMEM; |
321 | } | 321 | } |
@@ -336,8 +336,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused, | |||
336 | return -1; | 336 | return -1; |
337 | } | 337 | } |
338 | 338 | ||
339 | if (hists__add_entry(hists, &al, sample->period, | 339 | if (hists__add_entry(hists, &al, sample)) { |
340 | sample->weight, sample->transaction)) { | ||
341 | pr_warning("problem incrementing symbol period, skipping event\n"); | 340 | pr_warning("problem incrementing symbol period, skipping event\n"); |
342 | goto out_put; | 341 | goto out_put; |
343 | } | 342 | } |