Commit 0102ef3e authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent cbb0bba9
...@@ -75,7 +75,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, ...@@ -75,7 +75,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
sample->period = 1; sample->period = 1;
sample->weight = 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) if (he == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -310,16 +310,6 @@ static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair, ...@@ -310,16 +310,6 @@ static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair,
return -1; 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, static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
union perf_event *event, union perf_event *event,
struct perf_sample *sample, struct perf_sample *sample,
...@@ -336,7 +326,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused, ...@@ -336,7 +326,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
return -1; 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"); pr_warning("problem incrementing symbol period, skipping event\n");
goto out_put; goto out_put;
} }
......
...@@ -84,7 +84,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine) ...@@ -84,7 +84,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
if (machine__resolve(machine, &al, &sample) < 0) if (machine__resolve(machine, &al, &sample) < 0)
goto out; goto out;
he = __hists__add_entry(hists, &al, NULL, he = hists__add_entry(hists, &al, NULL,
NULL, NULL, &sample, true); NULL, NULL, &sample, true);
if (he == NULL) { if (he == NULL) {
addr_location__put(&al); addr_location__put(&al);
...@@ -103,7 +103,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine) ...@@ -103,7 +103,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
if (machine__resolve(machine, &al, &sample) < 0) if (machine__resolve(machine, &al, &sample) < 0)
goto out; goto out;
he = __hists__add_entry(hists, &al, NULL, he = hists__add_entry(hists, &al, NULL,
NULL, NULL, &sample, true); NULL, NULL, &sample, true);
if (he == NULL) { if (he == NULL) {
addr_location__put(&al); addr_location__put(&al);
......
...@@ -531,13 +531,13 @@ static struct hist_entry *hists__findnew_entry(struct hists *hists, ...@@ -531,13 +531,13 @@ static struct hist_entry *hists__findnew_entry(struct hists *hists,
return he; return he;
} }
struct hist_entry *__hists__add_entry(struct hists *hists, struct hist_entry *hists__add_entry(struct hists *hists,
struct addr_location *al, struct addr_location *al,
struct symbol *sym_parent, struct symbol *sym_parent,
struct branch_info *bi, struct branch_info *bi,
struct mem_info *mi, struct mem_info *mi,
struct perf_sample *sample, struct perf_sample *sample,
bool sample_self) bool sample_self)
{ {
struct hist_entry entry = { struct hist_entry entry = {
.thread = al->thread, .thread = al->thread,
...@@ -622,8 +622,8 @@ iter_add_single_mem_entry(struct hist_entry_iter *iter, struct addr_location *al ...@@ -622,8 +622,8 @@ iter_add_single_mem_entry(struct hist_entry_iter *iter, struct addr_location *al
*/ */
sample->period = cost; sample->period = cost;
he = __hists__add_entry(hists, al, iter->parent, NULL, mi, he = hists__add_entry(hists, al, iter->parent, NULL, mi,
sample, true); sample, true);
if (!he) if (!he)
return -ENOMEM; return -ENOMEM;
...@@ -727,8 +727,8 @@ iter_add_next_branch_entry(struct hist_entry_iter *iter, struct addr_location *a ...@@ -727,8 +727,8 @@ iter_add_next_branch_entry(struct hist_entry_iter *iter, struct addr_location *a
sample->period = 1; sample->period = 1;
sample->weight = bi->flags.cycles ? bi->flags.cycles : 1; sample->weight = bi->flags.cycles ? bi->flags.cycles : 1;
he = __hists__add_entry(hists, al, iter->parent, &bi[i], NULL, he = hists__add_entry(hists, al, iter->parent, &bi[i], NULL,
sample, true); sample, true);
if (he == NULL) if (he == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -764,8 +764,8 @@ iter_add_single_normal_entry(struct hist_entry_iter *iter, struct addr_location ...@@ -764,8 +764,8 @@ iter_add_single_normal_entry(struct hist_entry_iter *iter, struct addr_location
struct perf_sample *sample = iter->sample; struct perf_sample *sample = iter->sample;
struct hist_entry *he; struct hist_entry *he;
he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
sample, true); sample, true);
if (he == NULL) if (he == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -825,8 +825,8 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter, ...@@ -825,8 +825,8 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
struct hist_entry *he; struct hist_entry *he;
int err = 0; int err = 0;
he = __hists__add_entry(hists, al, iter->parent, NULL, NULL, he = hists__add_entry(hists, al, iter->parent, NULL, NULL,
sample, true); sample, true);
if (he == NULL) if (he == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -900,8 +900,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, ...@@ -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, he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL,
sample, false); sample, false);
if (he == NULL) if (he == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -120,13 +120,13 @@ extern const struct hist_iter_ops hist_iter_branch; ...@@ -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_mem;
extern const struct hist_iter_ops hist_iter_cumulative; extern const struct hist_iter_ops hist_iter_cumulative;
struct hist_entry *__hists__add_entry(struct hists *hists, struct hist_entry *hists__add_entry(struct hists *hists,
struct addr_location *al, struct addr_location *al,
struct symbol *parent, struct symbol *parent,
struct branch_info *bi, struct branch_info *bi,
struct mem_info *mi, struct mem_info *mi,
struct perf_sample *sample, struct perf_sample *sample,
bool sample_self); bool sample_self);
int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
int max_stack_depth, void *arg); int max_stack_depth, void *arg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment