aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-06-14 14:19:21 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-06-21 12:18:33 -0400
commit0102ef3ec940e8a68aa94125cd4b40569b24e6be (patch)
treed49b049bb12d8365b3fe9a764315d0e2a9017489 /tools/perf
parentcbb0bba9f3526f23832385f9a47cf2a45fff7c05 (diff)
perf hists: Rename __hists__add_entry to hists__add_entry
There's no reason we should suffer the '__' prefix for the base global function. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1465928361-2442-12-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-annotate.c2
-rw-r--r--tools/perf/builtin-diff.c12
-rw-r--r--tools/perf/tests/hists_link.c4
-rw-r--r--tools/perf/util/hist.c34
-rw-r--r--tools/perf/util/hist.h14
5 files changed, 28 insertions, 38 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 25c81734a950..a2324e1892aa 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -75,7 +75,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
75 sample->period = 1; 75 sample->period = 1;
76 sample->weight = 1; 76 sample->weight = 1;
77 77
78 he = __hists__add_entry(hists, al, NULL, NULL, NULL, sample, true); 78 he = hists__add_entry(hists, al, NULL, NULL, NULL, sample, true);
79 if (he == NULL) 79 if (he == NULL)
80 return -ENOMEM; 80 return -ENOMEM;
81 81
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 7f628f9c2fb4..8b6735f35179 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -310,16 +310,6 @@ static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair,
310 return -1; 310 return -1;
311} 311}
312 312
313static int hists__add_entry(struct hists *hists,
314 struct addr_location *al,
315 struct perf_sample *sample)
316{
317 if (__hists__add_entry(hists, al, NULL, NULL, NULL,
318 sample, true) != NULL)
319 return 0;
320 return -ENOMEM;
321}
322
323static int diff__process_sample_event(struct perf_tool *tool __maybe_unused, 313static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
324 union perf_event *event, 314 union perf_event *event,
325 struct perf_sample *sample, 315 struct perf_sample *sample,
@@ -336,7 +326,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
336 return -1; 326 return -1;
337 } 327 }
338 328
339 if (hists__add_entry(hists, &al, sample)) { 329 if (!hists__add_entry(hists, &al, NULL, NULL, NULL, sample, true)) {
340 pr_warning("problem incrementing symbol period, skipping event\n"); 330 pr_warning("problem incrementing symbol period, skipping event\n");
341 goto out_put; 331 goto out_put;
342 } 332 }
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index acf5a1301c07..6f96ca4d4fc0 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -84,7 +84,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
84 if (machine__resolve(machine, &al, &sample) < 0) 84 if (machine__resolve(machine, &al, &sample) < 0)
85 goto out; 85 goto out;
86 86
87 he = __hists__add_entry(hists, &al, NULL, 87 he = hists__add_entry(hists, &al, NULL,
88 NULL, NULL, &sample, true); 88 NULL, NULL, &sample, true);
89 if (he == NULL) { 89 if (he == NULL) {
90 addr_location__put(&al); 90 addr_location__put(&al);
@@ -103,7 +103,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
103 if (machine__resolve(machine, &al, &sample) < 0) 103 if (machine__resolve(machine, &al, &sample) < 0)
104 goto out; 104 goto out;
105 105
106 he = __hists__add_entry(hists, &al, NULL, 106 he = hists__add_entry(hists, &al, NULL,
107 NULL, NULL, &sample, true); 107 NULL, NULL, &sample, true);
108 if (he == NULL) { 108 if (he == NULL) {
109 addr_location__put(&al); 109 addr_location__put(&al);
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 2515cfdb7365..d2647b1d82c0 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -531,13 +531,13 @@ out:
531 return he; 531 return he;
532} 532}
533 533
534struct hist_entry *__hists__add_entry(struct hists *hists, 534struct hist_entry *hists__add_entry(struct hists *hists,
535 struct addr_location *al, 535 struct addr_location *al,
536 struct symbol *sym_parent, 536 struct symbol *sym_parent,
537 struct branch_info *bi, 537 struct branch_info *bi,
538 struct mem_info *mi, 538 struct mem_info *mi,
539 struct perf_sample *sample, 539 struct perf_sample *sample,
540 bool sample_self) 540 bool sample_self)
541{ 541{
542 struct hist_entry entry = { 542 struct hist_entry entry = {
543 .thread = al->thread, 543 .thread = al->thread,
@@ -622,8 +622,8 @@ iter_add_single_mem_entry(struct hist_entry_iter *iter, struct addr_location *al
622 */ 622 */
623 sample->period = cost; 623 sample->period = cost;
624 624
625 he = __hists__add_entry(hists, al, iter->parent, NULL, mi, 625 he = hists__add_entry(hists, al, iter->parent, NULL, mi,
626 sample, true); 626 sample, true);
627 if (!he) 627 if (!he)
628 return -ENOMEM; 628 return -ENOMEM;
629 629
@@ -727,8 +727,8 @@ iter_add_next_branch_entry(struct hist_entry_iter *iter, struct addr_location *a
727 sample->period = 1; 727 sample->period = 1;
728 sample->weight = bi->flags.cycles ? bi->flags.cycles : 1; 728 sample->weight = bi->flags.cycles ? bi->flags.cycles : 1;
729 729
730 he = __hists__add_entry(hists, al, iter->parent, &bi[i], NULL, 730 he = hists__add_entry(hists, al, iter->parent, &bi[i], NULL,
731 sample, true); 731 sample, true);
732 if (he == NULL) 732 if (he == NULL)
733 return -ENOMEM; 733 return -ENOMEM;
734 734
@@ -764,8 +764,8 @@ iter_add_single_normal_entry(struct hist_entry_iter *iter, struct addr_location
764 struct perf_sample *sample = iter->sample; 764 struct perf_sample *sample = iter->sample;
765 struct hist_entry *he; 765 struct hist_entry *he;
766 766
767 he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, 767 he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
768 sample, true); 768 sample, true);
769 if (he == NULL) 769 if (he == NULL)
770 return -ENOMEM; 770 return -ENOMEM;
771 771
@@ -825,8 +825,8 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
825 struct hist_entry *he; 825 struct hist_entry *he;
826 int err = 0; 826 int err = 0;
827 827
828 he = __hists__add_entry(hists, al, iter->parent, NULL, NULL, 828 he = hists__add_entry(hists, al, iter->parent, NULL, NULL,
829 sample, true); 829 sample, true);
830 if (he == NULL) 830 if (he == NULL)
831 return -ENOMEM; 831 return -ENOMEM;
832 832
@@ -900,8 +900,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
900 } 900 }
901 } 901 }
902 902
903 he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, 903 he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
904 sample, false); 904 sample, false);
905 if (he == NULL) 905 if (he == NULL)
906 return -ENOMEM; 906 return -ENOMEM;
907 907
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index a19112872ff9..0a03e08be503 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -120,13 +120,13 @@ extern const struct hist_iter_ops hist_iter_branch;
120extern const struct hist_iter_ops hist_iter_mem; 120extern const struct hist_iter_ops hist_iter_mem;
121extern const struct hist_iter_ops hist_iter_cumulative; 121extern const struct hist_iter_ops hist_iter_cumulative;
122 122
123struct hist_entry *__hists__add_entry(struct hists *hists, 123struct hist_entry *hists__add_entry(struct hists *hists,
124 struct addr_location *al, 124 struct addr_location *al,
125 struct symbol *parent, 125 struct symbol *parent,
126 struct branch_info *bi, 126 struct branch_info *bi,
127 struct mem_info *mi, 127 struct mem_info *mi,
128 struct perf_sample *sample, 128 struct perf_sample *sample,
129 bool sample_self); 129 bool sample_self);
130int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, 130int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
131 int max_stack_depth, void *arg); 131 int max_stack_depth, void *arg);
132 132