Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1218087 > unrolled thread
| Started by | Kenth Eriksson <kenth.eriksson@transmode.com> |
|---|---|
| First post | 2015-09-03 10:00 +0200 |
| Last post | 2015-09-04 09:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
perf fails to mmap data file (JFFS2) Kenth Eriksson <kenth.eriksson@transmode.com> - 2015-09-03 10:00 +0200
Re: perf fails to mmap data file (JFFS2) Andi Kleen <andi@firstfloor.org> - 2015-09-03 21:00 +0200
[PATCH] Fix mmap error for perf data file. Not all file systems, e.g. JFFS2, support MAP_SHARED. Kenth Eriksson <kenth.eriksson@transmode.com> - 2015-09-04 09:10 +0200
| From | Kenth Eriksson <kenth.eriksson@transmode.com> |
|---|---|
| Date | 2015-09-03 10:00 +0200 |
| Subject | perf fails to mmap data file (JFFS2) |
| Message-ID | <q4xB8-5Ju-13@gated-at.bofh.it> |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2015-09-03 21:00 +0200 |
| Message-ID | <q4HTR-3EU-23@gated-at.bofh.it> |
| In reply to | #1218087 |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Kenth Eriksson <kenth.eriksson@transmode.com> |
|---|---|
| Date | 2015-09-04 09:10 +0200 |
| Subject | [PATCH] Fix mmap error for perf data file. Not all file systems, e.g. JFFS2, support MAP_SHARED. |
| Message-ID | <q4Tih-3k1-3@gated-at.bofh.it> |
| In reply to | #1218520 |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web