[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180109153522.14116-8-jolsa@kernel.org>
Date: Tue, 9 Jan 2018 16:34:40 +0100
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>,
lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH 07/49] perf tools: Extend perf_evlist__mmap_ex() to use track mmap
From: Namhyung Kim <namhyung@...nel.org>
The perf_evlist__mmap_ex function creates data and auxtrace mmaps and
optionally tracking mmaps for events now. It'll be used for perf
record to save events in a separate files and build an index table.
Checking dummy tracking event in perf_evlist__mmap() alone is not
enough as users can specify a dummy event (like in keep tracking
testcase) without the index option.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Link: http://lkml.kernel.org/n/tip-hche6reuz4unv1614kj7lihz@git.kernel.org
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/builtin-record.c | 2 +-
tools/perf/util/evlist.c | 7 ++++---
tools/perf/util/evlist.h | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index a792758e9aa3..385aa9fba282 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -306,7 +306,7 @@ static int record__mmap_evlist(struct record *rec,
if (perf_evlist__mmap_ex(evlist, opts->mmap_pages,
opts->auxtrace_mmap_pages,
- opts->auxtrace_snapshot_mode) < 0) {
+ opts->auxtrace_snapshot_mode, false) < 0) {
if (errno == EPERM) {
pr_err("Permission error mapping pages.\n"
"Consider increasing "
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index bb2c74865ba3..635b0938c200 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1094,6 +1094,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
* @overwrite: overwrite older events?
* @auxtrace_pages - auxtrace map length in pages
* @auxtrace_overwrite - overwrite older auxtrace data?
+ * @use_track_mmap: use another mmaps to track meta events
*
* If @overwrite is %false the user needs to signal event consumption using
* perf_mmap__write_tail(). Using perf_evlist__mmap_read() does this
@@ -1106,7 +1107,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
*/
int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
unsigned int auxtrace_pages,
- bool auxtrace_overwrite)
+ bool auxtrace_overwrite, bool use_track_mmap)
{
struct perf_evsel *evsel;
const struct cpu_map *cpus = evlist->cpus;
@@ -1117,7 +1118,7 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
* So &mp should not be passed through const pointer.
*/
struct mmap_params mp = {
- .track_mmap = false,
+ .track_mmap = use_track_mmap,
};
if (!evlist->mmap) {
@@ -1162,7 +1163,7 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
{
- return perf_evlist__mmap_ex(evlist, pages, 0, false);
+ return perf_evlist__mmap_ex(evlist, pages, 0, false, false);
}
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index bbfe523b0509..4f7b7f68704b 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -175,7 +175,7 @@ unsigned long perf_event_mlock_kb_in_pages(void);
int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
unsigned int auxtrace_pages,
- bool auxtrace_overwrite);
+ bool auxtrace_overwrite, bool use_track_mmap);
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages);
void perf_evlist__munmap(struct perf_evlist *evlist);
--
2.13.6
Powered by blists - more mailing lists