lkml.org 
[lkml]   [2019]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 57/73] perf tools: Add perf_evlist__mmap_cb_idx function
Date
Adding perf_evlist__mmap_cb_idx function to call
auxtrace_mmap_params__set_idx on each new index
during perf_evlist__mmap_ops call.

Link: http://lkml.kernel.org/n/tip-26emdgzve9miryyzvcr77qgh@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/evlist.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index a9fc35d25a59..850dacf7bf97 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -714,6 +714,17 @@ static int evlist__mmap_per_evsel(struct evlist *evlist, int idx,
return 0;
}

+static void
+perf_evlist__mmap_cb_idx(struct perf_evlist *_evlist,
+ struct perf_mmap_param *_mp,
+ int idx, bool per_cpu)
+{
+ struct evlist *evlist = container_of(_evlist, struct evlist, core);
+ struct mmap_params *mp = container_of(_mp, struct mmap_params, core);
+
+ auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, idx, per_cpu);
+}
+
static int evlist__mmap_per_cpu(struct evlist *evlist,
struct mmap_params *mp)
{
@@ -910,6 +921,9 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
.flush = flush,
.comp_level = comp_level
};
+ struct perf_evlist_mmap_ops ops __maybe_unused = {
+ .idx = perf_evlist__mmap_cb_idx,
+ };

if (!evlist->mmap)
evlist->mmap = evlist__alloc_mmap(evlist, false);
--
2.21.0
\
 
 \ /
  Last update: 2019-09-13 15:28    [W:0.190 / U:1.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site