Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1436538
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jiri Olsa <jolsa@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/4] perf tools: Introduce hists__add_entry_ops function |
| Date | Mon, 04 Jul 2016 16:10:02 +0200 |
| Message-ID | <rRcJs-6B7-29@gated-at.bofh.it> (permalink) |
| References | <rRcJs-6B7-21@gated-at.bofh.it> |
| X-Scanned-By | MIMEDefang 2.68 on 10.5.11.23 |
| X-Greylist | Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 04 Jul 2016 14:01:50 +0000 (UTC) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 106 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | lkml <linux-kernel@vger.kernel.org>, David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Peter Zijlstra <a.p.zijlstra@chello.nl> |
| X-Original-Date | Mon, 4 Jul 2016 16:01:39 +0200 |
| X-Original-Message-ID | <1467640899-3776-5-git-send-email-jolsa@kernel.org> |
| X-Original-References | <1467640899-3776-1-git-send-email-jolsa@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1436538 |
Show key headers only | View raw
Introducing hists__add_entry_ops function to allow using
the allocation callbacks externally.
Link: http://lkml.kernel.org/n/tip-r4bumbbg5st7p38hjm2z16b5@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/hist.c | 42 +++++++++++++++++++++++++++++++++++-------
tools/perf/util/hist.h | 11 +++++++++++
2 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 355b7601ddb7..a18d142cdca3 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -559,13 +559,15 @@ 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)
+static 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_ops *ops)
{
struct hist_entry entry = {
.thread = al->thread,
@@ -592,11 +594,37 @@ struct hist_entry *hists__add_entry(struct hists *hists,
.transaction = sample->transaction,
.raw_data = sample->raw_data,
.raw_size = sample->raw_size,
+ .ops = ops,
};
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
iter_next_nop_entry(struct hist_entry_iter *iter __maybe_unused,
struct addr_location *al __maybe_unused)
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 0a03e08be503..49aa4fac148f 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -10,6 +10,7 @@
#include "ui/progress.h"
struct hist_entry;
+struct hist_entry_ops;
struct addr_location;
struct symbol;
@@ -127,6 +128,16 @@ struct hist_entry *hists__add_entry(struct hists *hists,
struct mem_info *mi,
struct perf_sample *sample,
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 max_stack_depth, void *arg);
--
2.4.11
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC 0/4] perf tools: Add hist_entry allocation callbacks Jiri Olsa <jolsa@kernel.org> - 2016-07-04 16:10 +0200
[PATCH 1/4] perf tools: Introduce hist_entry__init function Jiri Olsa <jolsa@kernel.org> - 2016-07-04 16:10 +0200
Re: [PATCH 1/4] perf tools: Introduce hist_entry__init function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-04 21:10 +0200
[PATCH 2/4] perf tools: Do the error path hist_entry release in hist_entry__new Jiri Olsa <jolsa@kernel.org> - 2016-07-04 16:10 +0200
Re: [PATCH 2/4] perf tools: Do the error path hist_entry release in hist_entry__new Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-04 21:10 +0200
Re: [PATCH 2/4] perf tools: Do the error path hist_entry release in hist_entry__new Jiri Olsa <jolsa@redhat.com> - 2016-07-05 08:40 +0200
[PATCH 3/4] perf tools: Introduce hist_entry_ops Jiri Olsa <jolsa@kernel.org> - 2016-07-04 16:10 +0200
[PATCH 4/4] perf tools: Introduce hists__add_entry_ops function Jiri Olsa <jolsa@kernel.org> - 2016-07-04 16:10 +0200
csiph-web