* perf fails to mmap data file (JFFS2)
@ 2015-09-03 7:49 Kenth Eriksson
2015-09-03 18:57 ` Andi Kleen
0 siblings, 1 reply; 3+ messages in thread
From: Kenth Eriksson @ 2015-09-03 7:49 UTC (permalink / raw)
To: linux-kernel
perf on 4.1 fails to mmap the perf data file (in __perf_session__process_events) with error code 22 (invalid argument). I believe the JFFS2 file system does not support PROT_READ and MAP_SHARED. How can this be fixed? Can we change from MAP_SHARED to MAP_PRIVATE, or is there a reason to make it shared?
Thanks,
Kenth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: perf fails to mmap data file (JFFS2)
2015-09-03 7:49 perf fails to mmap data file (JFFS2) Kenth Eriksson
@ 2015-09-03 18:57 ` Andi Kleen
2015-09-04 7:00 ` [PATCH] Fix mmap error for perf data file. Not all file systems, e.g. JFFS2, support MAP_SHARED Kenth Eriksson
0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2015-09-03 18:57 UTC (permalink / raw)
To: Kenth Eriksson; +Cc: linux-kernel
Kenth Eriksson <kenth.eriksson@transmode.com> writes:
> perf on 4.1 fails to mmap the perf data file (in
> __perf_session__process_events) with error code 22 (invalid
> argument). I believe the JFFS2 file system does not support PROT_READ
> and MAP_SHARED. How can this be fixed? Can we change from MAP_SHARED
> to MAP_PRIVATE, or is there a reason to make it shared?
MAP_PRIVATE should be fine.
-Andi
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Fix mmap error for perf data file. Not all file systems, e.g. JFFS2, support MAP_SHARED.
2015-09-03 18:57 ` Andi Kleen
@ 2015-09-04 7:00 ` Kenth Eriksson
0 siblings, 0 replies; 3+ messages in thread
From: Kenth Eriksson @ 2015-09-04 7:00 UTC (permalink / raw)
To: linux-kernel, andi; +Cc: Kenth Eriksson
Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
---
tools/perf/util/session.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 0c74012..c6617fe 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1338,11 +1338,10 @@ static int __perf_session__process_events(struct perf_session *session,
memset(mmaps, 0, sizeof(mmaps));
mmap_prot = PROT_READ;
- mmap_flags = MAP_SHARED;
+ mmap_flags = MAP_PRIVATE;
if (session->header.needs_swap) {
mmap_prot |= PROT_WRITE;
- mmap_flags = MAP_PRIVATE;
}
remap:
buf = mmap(NULL, mmap_size, mmap_prot, mmap_flags, fd,
--
2.3.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-04 7:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-03 7:49 perf fails to mmap data file (JFFS2) Kenth Eriksson
2015-09-03 18:57 ` Andi Kleen
2015-09-04 7:00 ` [PATCH] Fix mmap error for perf data file. Not all file systems, e.g. JFFS2, support MAP_SHARED Kenth Eriksson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.