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

perf hists: Introduce hists__add_entry_ops function

Introducing hists__add_entry_ops function to allow using the allocation
callbacks externally.
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/1467701765-26194-4-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f542e767
...@@ -559,13 +559,15 @@ static struct hist_entry *hists__findnew_entry(struct hists *hists, ...@@ -559,13 +559,15 @@ static struct hist_entry *hists__findnew_entry(struct hists *hists,
return he; return he;
} }
struct hist_entry *hists__add_entry(struct hists *hists, static struct hist_entry*
struct addr_location *al, __hists__add_entry(struct hists *hists,
struct symbol *sym_parent, struct addr_location *al,
struct branch_info *bi, struct symbol *sym_parent,
struct mem_info *mi, struct branch_info *bi,
struct perf_sample *sample, struct mem_info *mi,
bool sample_self) struct perf_sample *sample,
bool sample_self,
struct hist_entry_ops *ops)
{ {
struct hist_entry entry = { struct hist_entry entry = {
.thread = al->thread, .thread = al->thread,
...@@ -592,11 +594,37 @@ struct hist_entry *hists__add_entry(struct hists *hists, ...@@ -592,11 +594,37 @@ struct hist_entry *hists__add_entry(struct hists *hists,
.transaction = sample->transaction, .transaction = sample->transaction,
.raw_data = sample->raw_data, .raw_data = sample->raw_data,
.raw_size = sample->raw_size, .raw_size = sample->raw_size,
.ops = ops,
}; };
return hists__findnew_entry(hists, &entry, al, sample_self); return hists__findnew_entry(hists, &entry, al, 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)
{
return __hists__add_entry(hists, al, sym_parent, bi, mi,
sample, sample_self, NULL);
}
struct hist_entry *hists__add_entry_ops(struct hists *hists,
struct hist_entry_ops *ops,
struct addr_location *al,
struct symbol *sym_parent,
struct branch_info *bi,
struct mem_info *mi,
struct perf_sample *sample,
bool sample_self)
{
return __hists__add_entry(hists, al, sym_parent, bi, mi,
sample, sample_self, ops);
}
static int static int
iter_next_nop_entry(struct hist_entry_iter *iter __maybe_unused, iter_next_nop_entry(struct hist_entry_iter *iter __maybe_unused,
struct addr_location *al __maybe_unused) struct addr_location *al __maybe_unused)
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "ui/progress.h" #include "ui/progress.h"
struct hist_entry; struct hist_entry;
struct hist_entry_ops;
struct addr_location; struct addr_location;
struct symbol; struct symbol;
...@@ -127,6 +128,16 @@ struct hist_entry *hists__add_entry(struct hists *hists, ...@@ -127,6 +128,16 @@ struct hist_entry *hists__add_entry(struct hists *hists,
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 *hists__add_entry_ops(struct hists *hists,
struct hist_entry_ops *ops,
struct addr_location *al,
struct symbol *sym_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 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