perf fails to mmap data file (JFFS2)
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
Quoted 5 lines · Kenth Eriksson
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 supportPROT_READandMAP_SHARED. How can this be fixed? Can we change fromMAP_SHAREDtoMAP_PRIVATE, or is there a reason to make it shared?
MAP_PRIVATE should be fine.
-Andi
PATCH 1/1 Fix mmap error for perf data file. Not all file systems, e.g. JFFS2, support MAP_SHARED.
Signed-off-by Kenth Eriksson <[email protected]>
--- tools/perf/util/session.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/session.c +1 -2
@@ -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,
Signature · 1 line
2.3.6