Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428510

[tip:perf/core] perf hists: Rename __hists__add_entry to hists__add_entry

From tip-bot for Jiri Olsa <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:perf/core] perf hists: Rename __hists__add_entry to hists__add_entry
Date 2016-06-22 09:50 +0200
Message-ID <rML58-wN-23@gated-at.bofh.it> (permalink)
References <rK1g6-8wa-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  0102ef3ec940e8a68aa94125cd4b40569b24e6be
Gitweb:     http://git.kernel.org/tip/0102ef3ec940e8a68aa94125cd4b40569b24e6be
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Tue, 14 Jun 2016 20:19:21 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 21 Jun 2016 13:18:33 -0300

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>
---
 tools/perf/builtin-annotate.c |  2 +-
 tools/perf/builtin-diff.c     | 12 +-----------
 tools/perf/tests/hists_link.c |  4 ++--
 tools/perf/util/hist.c        | 34 +++++++++++++++++-----------------
 tools/perf/util/hist.h        | 14 +++++++-------
 5 files changed, 28 insertions(+), 38 deletions(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 25c8173..a2324e1 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,
 	sample->period = 1;
 	sample->weight = 1;
 
-	he = __hists__add_entry(hists, al, NULL, NULL, NULL, sample, true);
+	he = hists__add_entry(hists, al, NULL, NULL, NULL, sample, true);
 	if (he == NULL)
 		return -ENOMEM;
 
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 7f628f9..8b6735f 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,
 	return -1;
 }
 
-static int hists__add_entry(struct hists *hists,
-			    struct addr_location *al,
-			    struct perf_sample *sample)
-{
-	if (__hists__add_entry(hists, al, NULL, NULL, NULL,
-			       sample, true) != NULL)
-		return 0;
-	return -ENOMEM;
-}
-
 static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
 				      union perf_event *event,
 				      struct perf_sample *sample,
@@ -336,7 +326,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
 		return -1;
 	}
 
-	if (hists__add_entry(hists, &al, sample)) {
+	if (!hists__add_entry(hists, &al, NULL, NULL, NULL, sample, true)) {
 		pr_warning("problem incrementing symbol period, skipping event\n");
 		goto out_put;
 	}
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index acf5a13..6f96ca4 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)
 			if (machine__resolve(machine, &al, &sample) < 0)
 				goto out;
 
-			he = __hists__add_entry(hists, &al, NULL,
+			he = hists__add_entry(hists, &al, NULL,
 						NULL, NULL, &sample, true);
 			if (he == NULL) {
 				addr_location__put(&al);
@@ -103,7 +103,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
 			if (machine__resolve(machine, &al, &sample) < 0)
 				goto out;
 
-			he = __hists__add_entry(hists, &al, NULL,
+			he = hists__add_entry(hists, &al, NULL,
 						NULL, NULL, &sample, true);
 			if (he == NULL) {
 				addr_location__put(&al);
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 2515cfd..d2647b1 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -531,13 +531,13 @@ out:
 	return he;
 }
 
-struct hist_entry *__hists__add_entry(struct hists *hists,
-				      struct addr_location *al,
-				      struct symbol *sym_parent,
-				      struct branch_info *bi,
-				      struct mem_info *mi,
-				      struct perf_sample *sample,
-				      bool sample_self)
+struct hist_entry *hists__add_entry(struct hists *hists,
+				    struct addr_location *al,
+				    struct symbol *sym_parent,
+				    struct branch_info *bi,
+				    struct mem_info *mi,
+				    struct perf_sample *sample,
+				    bool sample_self)
 {
 	struct hist_entry entry = {
 		.thread	= al->thread,
@@ -622,8 +622,8 @@ iter_add_single_mem_entry(struct hist_entry_iter *iter, struct addr_location *al
 	 */
 	sample->period = cost;
 
-	he = __hists__add_entry(hists, al, iter->parent, NULL, mi,
-				sample, true);
+	he = hists__add_entry(hists, al, iter->parent, NULL, mi,
+			      sample, true);
 	if (!he)
 		return -ENOMEM;
 
@@ -727,8 +727,8 @@ iter_add_next_branch_entry(struct hist_entry_iter *iter, struct addr_location *a
 	sample->period = 1;
 	sample->weight = bi->flags.cycles ? bi->flags.cycles : 1;
 
-	he = __hists__add_entry(hists, al, iter->parent, &bi[i], NULL,
-				sample, true);
+	he = hists__add_entry(hists, al, iter->parent, &bi[i], NULL,
+			      sample, true);
 	if (he == NULL)
 		return -ENOMEM;
 
@@ -764,8 +764,8 @@ iter_add_single_normal_entry(struct hist_entry_iter *iter, struct addr_location
 	struct perf_sample *sample = iter->sample;
 	struct hist_entry *he;
 
-	he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
-				sample, true);
+	he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
+			      sample, true);
 	if (he == NULL)
 		return -ENOMEM;
 
@@ -825,8 +825,8 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
 	struct hist_entry *he;
 	int err = 0;
 
-	he = __hists__add_entry(hists, al, iter->parent, NULL, NULL,
-				sample, true);
+	he = hists__add_entry(hists, al, iter->parent, NULL, NULL,
+			      sample, true);
 	if (he == NULL)
 		return -ENOMEM;
 
@@ -900,8 +900,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
 		}
 	}
 
-	he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
-				sample, false);
+	he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
+			      sample, false);
 	if (he == NULL)
 		return -ENOMEM;
 
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index a191128..0a03e08 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;
 extern const struct hist_iter_ops hist_iter_mem;
 extern const struct hist_iter_ops hist_iter_cumulative;
 
-struct hist_entry *__hists__add_entry(struct hists *hists,
-				      struct addr_location *al,
-				      struct symbol *parent,
-				      struct branch_info *bi,
-				      struct mem_info *mi,
-				      struct perf_sample *sample,
-				      bool sample_self);
+struct hist_entry *hists__add_entry(struct hists *hists,
+				    struct addr_location *al,
+				    struct symbol *parent,
+				    struct branch_info *bi,
+				    struct mem_info *mi,
+				    struct perf_sample *sample,
+				    bool sample_self);
 int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
 			 int max_stack_depth, void *arg);
 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 00/11] perf tools: Various fixes Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:20 +0200
  [PATCH 07/11] perf tools stdio: Do not pass hists in hist_entry__fprintf Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf stdio: Do not pass hists in  hist_entry__fprintf tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
  [PATCH 05/11] perf tools stdio: Separate hierarchy headers output Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf stdio: Separate hierarchy headers output tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
  [PATCH 06/11] perf tools stdio: Separate standard headers output Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf stdio: Separate standard headers output tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
  [PATCH 09/11] perf tools: Replace perf_evsel arg perf_hpp_fmt's header callback Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf hists: Replace perf_evsel arg perf_hpp_fmt's  header callback tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
  [PATCH 08/11] perf tools stdio: Add use_callchain parameter to hists__fprintf Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf stdio: Add use_callchain parameter to  hists__fprintf tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
  [PATCH 02/11] perf tools: Fix Data Object sort entry width index Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf tools: Fix Data Object sort entry width index tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
  [PATCH 11/11] perf tools: Rename __hists__add_entry to hists__add_entry Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
    [tip:perf/core] perf hists: Rename __hists__add_entry to  hists__add_entry tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-22 09:50 +0200

csiph-web