Skip to contentSkip to conversation

perf trace: Check if MAP_32BIT is defined (again)

PATCH In review Jiri Olsa 4 participants 4 messages Dec 15, 2016 – Dec 20, 2016 perf events

lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 perf trace: Check if MAP_32BIT is defined (again)

There might be systems where MAP_32BIT is not defined, like some some RHEL7 powerpc versions.

Cc Kyle McMartin <[email protected]>
Cc David Ahern <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 277cf08f3feb ("perf trace beauty mmap: Fix defines for non !x86_64")
---
 tools/perf/trace/beauty/mmap.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/trace/beauty/mmap.c +2 -0
index fd710ab33684..af1cfde6b97b 100644
@@ -42,7 +42,9 @@ static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size,
 
 	P_MMAP_FLAG(SHARED);
 	P_MMAP_FLAG(PRIVATE);
+#ifdef MAP_32BIT
 	P_MMAP_FLAG(32BIT);
+#endif
 	P_MMAP_FLAG(ANONYMOUS);
 	P_MMAP_FLAG(DENYWRITE);
 	P_MMAP_FLAG(EXECUTABLE);
Signature · 1 line
2.7.4
#1 lore raw

Em Thu, Dec 15, 2016 at 08:56:54PM +0100, Jiri Olsa escreveu:

Quoted 9 lines

There might be systems where MAP_32BIT is not defined, like some some RHEL7 powerpc versions.

Cc Kyle McMartin <[email protected]>
Cc David Ahern <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 277cf08f3feb ("perf trace beauty mmap: Fix defines for non !x86_64")

Ouch, so we need what was removed in:

Fixes 256763b01741 ("perf trace beauty mmap: Add more conditional defines")

I.e. the ifdef at the switch case entry, not the removal of the conditional definition expecting that it would be available in the arch header, as in some cases those are not there. So I'm replacing the Fixme cset, ok?

Thanks for taking the time to fill in that tag, appreciated!

Also this all needs a revamp to support cross 'perf trace'ing, i.e. collecting a file on arch A and doing 'perf trace -i perf.data' on a different machine with a CPU fo a different arch, where either per arch beautifiers are needed or a dynamic switch, i.e. the value for some define is different between archs....

Patch applied, thanks,

- Arnaldo

Quoted 22 lines
---
 tools/perf/trace/beauty/mmap.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/trace/beauty/mmap.c +2 -0
index fd710ab33684..af1cfde6b97b 100644
@@ -42,7 +42,9 @@ static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size,
 
 	P_MMAP_FLAG(SHARED);
 	P_MMAP_FLAG(PRIVATE);
+#ifdef MAP_32BIT
 	P_MMAP_FLAG(32BIT);
+#endif
 	P_MMAP_FLAG(ANONYMOUS);
 	P_MMAP_FLAG(DENYWRITE);
 	P_MMAP_FLAG(EXECUTABLE);
Signature · 1 line
2.7.4
#2 lore raw
Quoted 11 lines · Arnaldo Carvalho de Melo

Em Thu, Dec 15, 2016 at 08:56:54PM +0100, Jiri Olsa escreveu:

Quoted 9 lines

There might be systems where MAP_32BIT is not defined, like some some RHEL7 powerpc versions.

Cc Kyle McMartin <[email protected]>
Cc David Ahern <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 277cf08f3feb ("perf trace beauty mmap: Fix defines for non !x86_64")
Quoted 8 lines

Ouch, so we need what was removed in:

Fixes 256763b01741 ("perf trace beauty mmap: Add more conditional defines")

I.e. the ifdef at the switch case entry, not the removal of the conditional definition expecting that it would be available in the arch header, as in some cases those are not there. So I'm replacing the Fixme cset, ok?

sure, ok

Quoted 10 lines

Thanks for taking the time to fill in that tag, appreciated!

Also this all needs a revamp to support cross 'perf trace'ing, i.e. collecting a file on arch A and doing 'perf trace -i perf.data' on a different machine with a CPU fo a different arch, where either per arch beautifiers are needed or a dynamic switch, i.e. the value for some define is different between archs....

Patch applied, thanks,

thanks,
jirka

#3 lore raw
In reply to Jiri Olsa
perf trace: Check if MAP_32BIT is defined (again)
Commit-ID:  2bd42f3aaa53ebe78b9be6f898b7945dd61f9773
Gitweb:     http://git.kernel.org/tip/2bd42f3aaa53ebe78b9be6f898b7945dd61f9773
Author:     Jiri Olsa <[email protected]>
AuthorDate: Thu, 15 Dec 2016 20:56:54 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 20 Dec 2016 09:37:40 -0300

perf trace: Check if MAP_32BIT is defined (again)

There might be systems where MAP_32BIT is not defined, like some some RHEL7 powerpc versions.

Cc David Ahern <[email protected]>
Cc Kyle McMartin <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 256763b01741 ("perf trace beauty mmap: Add more conditional defines")
[ Changed the Fixme cset to the one removing the conditional switch case for MAP_32BIT ]
---
 tools/perf/trace/beauty/mmap.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/trace/beauty/mmap.c +2 -0
index fd710ab..af1cfde 100644
@@ -42,7 +42,9 @@ static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size,
 
 	P_MMAP_FLAG(SHARED);
 	P_MMAP_FLAG(PRIVATE);
+#ifdef MAP_32BIT
 	P_MMAP_FLAG(32BIT);
+#endif
 	P_MMAP_FLAG(ANONYMOUS);
 	P_MMAP_FLAG(DENYWRITE);
 	P_MMAP_FLAG(EXECUTABLE);