Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483177 > unrolled thread

[PATCH 2/2] tools include: Add mman macros needed by perf for all arch

Started byWang Nan <wangnan0@huawei.com>
First post2016-09-14 13:00 +0200
Last post2016-09-20 23:50 +0200
Articles 5 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] tools include: Add mman macros needed by perf for all arch Wang Nan <wangnan0@huawei.com> - 2016-09-14 13:00 +0200
    Re: [PATCH 2/2] tools include: Add mman macros needed by perf for  all arch "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-09-14 13:50 +0200
      Re: [PATCH 2/2] tools include: Add mman macros needed by perf for  all arch Kim Phillips <kim.phillips@arm.com> - 2016-09-17 01:20 +0200
        Re: [PATCH 2/2] tools include: Add mman macros needed by perf for  all arch Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-19 16:40 +0200
    [tip:perf/core] tools include: Add mman macros needed by perf for  all arch tip-bot for Wang Nan <tipbot@zytor.com> - 2016-09-20 23:50 +0200

#1483177 — [PATCH 2/2] tools include: Add mman macros needed by perf for all arch

FromWang Nan <wangnan0@huawei.com>
Date2016-09-14 13:00 +0200
Subject[PATCH 2/2] tools include: Add mman macros needed by perf for all arch
Message-ID<shg54-8gk-7@gated-at.bofh.it>
Some macros required by tools/perf/trace/beauty/mmap.c is not support
for all architectures. For example, MAP_32BIT is defined on x86 only,
alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.

This patch regenerates mman.h for each archs, defines these missing
macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
because they are in 'case ...' statement. For flags, define to 0.

Following is the script to generate this patch:

 macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
 rm `find ./tools/arch/ -name mman.h`
 for arch in `ls tools/arch`
 do
   [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
   src=arch/$arch/include/uapi/asm/mman.h
   target=tools/arch/$arch/include/uapi/asm/mman.h.tmp
   real_target=tools/arch/$arch/include/uapi/asm/mman.h
   guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
   rm -f $target

   [ -f $src ] &&
   for m in $macros
   do
     if grep '#define[ \t]*'$m $src > /dev/null 2>&1
     then
       grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
     fi
   done

   if [ -f $src ]
   then
      grep '#include <asm-generic' $src >> $target
   else
      echo "#include <asm-generic/mman.h>" >> $target
   fi

   touch $real_target
   for m in $macros
   do
     if cat << EOF | gcc -Itools/arch/$arch/include -Itools/arch/$arch/include/uapi -Iinclude/ -Iinclude/uapi -E - | grep $m > /dev/null 2>&1
 #include <uapi/asm/mman.h.tmp>
 #include <uapi/linux/mman.h>
 $m
 EOF
   then
     echo "Fixing $m for $arch"
     echo "/* $m is undefined on $arch, fix it for perf */" >> $target
     if echo $m | grep '^MADV_' > /dev/null 2>&1
     then
       grep -h '#define[ \t]*'$m include/uapi/asm-generic/mman-common.h | sed 's/[ \t]*\/\*.*$//g' >> $target
     else
       echo "#define $m	0" >> $target
     fi
   fi
   done

   real_target=tools/arch/$arch/include/uapi/asm/mman.h
   echo '#ifndef '$guard > $real_target
   echo '#define '$guard >> $real_target
   cat $target | sed 's|asm-generic|uapi/asm-generic|g' >> $real_target
   echo '#endif' >> $real_target
   rm $target
   echo "$real_target"
 done

 exit 0
 # Following macros are extracted from:
 # tools/perf/trace/beauty/mmap.c
 #
 # start macro list
 MADV_DODUMP
 MADV_DOFORK
 MADV_DONTDUMP
 MADV_DONTFORK
 MADV_DONTNEED
 MADV_FREE
 MADV_HUGEPAGE
 MADV_HWPOISON
 MADV_MERGEABLE
 MADV_NOHUGEPAGE
 MADV_NORMAL
 MADV_RANDOM
 MADV_REMOVE
 MADV_SEQUENTIAL
 MADV_SOFT_OFFLINE
 MADV_UNMERGEABLE
 MADV_WILLNEED
 MAP_32BIT
 MAP_ANONYMOUS
 MAP_DENYWRITE
 MAP_EXECUTABLE
 MAP_FILE
 MAP_FIXED
 MAP_GROWSDOWN
 MAP_HUGETLB
 MAP_LOCKED
 MAP_NONBLOCK
 MAP_NORESERVE
 MAP_POPULATE
 MAP_PRIVATE
 MAP_SHARED
 MAP_STACK
 MAP_UNINITIALIZED
 MREMAP_FIXED
 MREMAP_MAYMOVE
 PROT_EXEC
 PROT_GROWSDOWN
 PROT_GROWSUP
 PROT_NONE
 PROT_READ
 PROT_SEM
 PROT_WRITE

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 tools/arch/alpha/include/uapi/asm/mman.h      | 9 +++++++++
 tools/arch/arc/include/uapi/asm/mman.h        | 2 ++
 tools/arch/arm/include/uapi/asm/mman.h        | 2 ++
 tools/arch/arm64/include/uapi/asm/mman.h      | 2 ++
 tools/arch/frv/include/uapi/asm/mman.h        | 2 ++
 tools/arch/h8300/include/uapi/asm/mman.h      | 2 ++
 tools/arch/hexagon/include/uapi/asm/mman.h    | 2 ++
 tools/arch/ia64/include/uapi/asm/mman.h       | 2 ++
 tools/arch/m32r/include/uapi/asm/mman.h       | 2 ++
 tools/arch/microblaze/include/uapi/asm/mman.h | 2 ++
 tools/arch/mips/include/uapi/asm/mman.h       | 7 +++++++
 tools/arch/mn10300/include/uapi/asm/mman.h    | 2 ++
 tools/arch/parisc/include/uapi/asm/mman.h     | 9 +++++++++
 tools/arch/powerpc/include/uapi/asm/mman.h    | 2 ++
 tools/arch/s390/include/uapi/asm/mman.h       | 2 ++
 tools/arch/score/include/uapi/asm/mman.h      | 2 ++
 tools/arch/sh/include/uapi/asm/mman.h         | 2 ++
 tools/arch/sparc/include/uapi/asm/mman.h      | 2 ++
 tools/arch/tile/include/uapi/asm/mman.h       | 2 ++
 tools/arch/xtensa/include/uapi/asm/mman.h     | 9 +++++++++
 20 files changed, 66 insertions(+)

diff --git a/tools/arch/alpha/include/uapi/asm/mman.h b/tools/arch/alpha/include/uapi/asm/mman.h
index 6ed4ad4..e38b64c 100644
--- a/tools/arch/alpha/include/uapi/asm/mman.h
+++ b/tools/arch/alpha/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP   16
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED	6
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	14
 #define MADV_MERGEABLE   12
 #define MADV_NOHUGEPAGE	15
@@ -35,4 +36,12 @@
 #define PROT_READ	0x1
 #define PROT_SEM	0x8
 #define PROT_WRITE	0x2
+/* MADV_HWPOISON is undefined on alpha, fix it for perf */
+#define MADV_HWPOISON	100
+/* MADV_SOFT_OFFLINE is undefined on alpha, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on alpha, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on alpha, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
diff --git a/tools/arch/arc/include/uapi/asm/mman.h b/tools/arch/arc/include/uapi/asm/mman.h
index f76765d..aa3acd2 100644
--- a/tools/arch/arc/include/uapi/asm/mman.h
+++ b/tools/arch/arc/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_ARC_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_ARC_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on arc, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/arm/include/uapi/asm/mman.h b/tools/arch/arm/include/uapi/asm/mman.h
index f200638..478f699 100644
--- a/tools/arch/arm/include/uapi/asm/mman.h
+++ b/tools/arch/arm/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on arm, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/arm64/include/uapi/asm/mman.h b/tools/arch/arm64/include/uapi/asm/mman.h
index a7dd975..70fd311 100644
--- a/tools/arch/arm64/include/uapi/asm/mman.h
+++ b/tools/arch/arm64/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on arm64, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/frv/include/uapi/asm/mman.h b/tools/arch/frv/include/uapi/asm/mman.h
index 99bba05..5be78ac 100644
--- a/tools/arch/frv/include/uapi/asm/mman.h
+++ b/tools/arch/frv/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on frv, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/h8300/include/uapi/asm/mman.h b/tools/arch/h8300/include/uapi/asm/mman.h
index df95096..9d9ac54 100644
--- a/tools/arch/h8300/include/uapi/asm/mman.h
+++ b/tools/arch/h8300/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on h8300, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/hexagon/include/uapi/asm/mman.h b/tools/arch/hexagon/include/uapi/asm/mman.h
index f1adcce..102f3fa 100644
--- a/tools/arch/hexagon/include/uapi/asm/mman.h
+++ b/tools/arch/hexagon/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on hexagon, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/ia64/include/uapi/asm/mman.h b/tools/arch/ia64/include/uapi/asm/mman.h
index 23420eb..1d6e5ac 100644
--- a/tools/arch/ia64/include/uapi/asm/mman.h
+++ b/tools/arch/ia64/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on ia64, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/m32r/include/uapi/asm/mman.h b/tools/arch/m32r/include/uapi/asm/mman.h
index a35ebd6..1c29635 100644
--- a/tools/arch/m32r/include/uapi/asm/mman.h
+++ b/tools/arch/m32r/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on m32r, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/microblaze/include/uapi/asm/mman.h b/tools/arch/microblaze/include/uapi/asm/mman.h
index 75f460a..005cd50 100644
--- a/tools/arch/microblaze/include/uapi/asm/mman.h
+++ b/tools/arch/microblaze/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on microblaze, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/mips/include/uapi/asm/mman.h b/tools/arch/mips/include/uapi/asm/mman.h
index db88fa4..c020529 100644
--- a/tools/arch/mips/include/uapi/asm/mman.h
+++ b/tools/arch/mips/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP	16
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED	4
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	14
 #define MADV_HWPOISON	 100
 #define MADV_MERGEABLE	 12
@@ -36,4 +37,10 @@
 #define PROT_READ	0x01
 #define PROT_SEM	0x10
 #define PROT_WRITE	0x02
+/* MADV_SOFT_OFFLINE is undefined on mips, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on mips, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on mips, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
diff --git a/tools/arch/mn10300/include/uapi/asm/mman.h b/tools/arch/mn10300/include/uapi/asm/mman.h
index 81faa5d..c1ea36d 100644
--- a/tools/arch/mn10300/include/uapi/asm/mman.h
+++ b/tools/arch/mn10300/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on mn10300, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/parisc/include/uapi/asm/mman.h b/tools/arch/parisc/include/uapi/asm/mman.h
index c4a9d9f..03d8d5b 100644
--- a/tools/arch/parisc/include/uapi/asm/mman.h
+++ b/tools/arch/parisc/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP   69
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED   4
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	67
 #define MADV_MERGEABLE   65
 #define MADV_NOHUGEPAGE	68
@@ -35,4 +36,12 @@
 #define PROT_READ	0x1
 #define PROT_SEM	0x8
 #define PROT_WRITE	0x2
+/* MADV_HWPOISON is undefined on parisc, fix it for perf */
+#define MADV_HWPOISON	100
+/* MADV_SOFT_OFFLINE is undefined on parisc, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on parisc, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
diff --git a/tools/arch/powerpc/include/uapi/asm/mman.h b/tools/arch/powerpc/include/uapi/asm/mman.h
index 7a56ab9..761db43 100644
--- a/tools/arch/powerpc/include/uapi/asm/mman.h
+++ b/tools/arch/powerpc/include/uapi/asm/mman.h
@@ -10,4 +10,6 @@
 #define MAP_POPULATE	0x8000
 #define MAP_STACK	0x20000
 #include <uapi/asm-generic/mman-common.h>
+/* MAP_32BIT is undefined on powerpc, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/s390/include/uapi/asm/mman.h b/tools/arch/s390/include/uapi/asm/mman.h
index fe53b91..b03dea9 100644
--- a/tools/arch/s390/include/uapi/asm/mman.h
+++ b/tools/arch/s390/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on s390, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/score/include/uapi/asm/mman.h b/tools/arch/score/include/uapi/asm/mman.h
index ba1ee9c..2f8fb89 100644
--- a/tools/arch/score/include/uapi/asm/mman.h
+++ b/tools/arch/score/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on score, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/sh/include/uapi/asm/mman.h b/tools/arch/sh/include/uapi/asm/mman.h
index 5a47d8c..26504f6 100644
--- a/tools/arch/sh/include/uapi/asm/mman.h
+++ b/tools/arch/sh/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on sh, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/sparc/include/uapi/asm/mman.h b/tools/arch/sparc/include/uapi/asm/mman.h
index b88f3ac..8640525 100644
--- a/tools/arch/sparc/include/uapi/asm/mman.h
+++ b/tools/arch/sparc/include/uapi/asm/mman.h
@@ -10,4 +10,6 @@
 #define MAP_POPULATE	0x8000
 #define MAP_STACK	0x20000
 #include <uapi/asm-generic/mman-common.h>
+/* MAP_32BIT is undefined on sparc, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/tile/include/uapi/asm/mman.h b/tools/arch/tile/include/uapi/asm/mman.h
index b0a054f..7116c4b 100644
--- a/tools/arch/tile/include/uapi/asm/mman.h
+++ b/tools/arch/tile/include/uapi/asm/mman.h
@@ -10,4 +10,6 @@
 #define MAP_POPULATE	0x0040
 #define MAP_STACK	MAP_GROWSDOWN
 #include <uapi/asm-generic/mman-common.h>
+/* MAP_32BIT is undefined on tile, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/xtensa/include/uapi/asm/mman.h b/tools/arch/xtensa/include/uapi/asm/mman.h
index 1c89538..4453195 100644
--- a/tools/arch/xtensa/include/uapi/asm/mman.h
+++ b/tools/arch/xtensa/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP   16
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED	4
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	14
 #define MADV_MERGEABLE   12
 #define MADV_NOHUGEPAGE	15
@@ -35,4 +36,12 @@
 #define PROT_READ	0x1
 #define PROT_SEM	0x10
 #define PROT_WRITE	0x2
+/* MADV_HWPOISON is undefined on xtensa, fix it for perf */
+#define MADV_HWPOISON	100
+/* MADV_SOFT_OFFLINE is undefined on xtensa, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on xtensa, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on xtensa, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
-- 
1.8.3.4

[toc] | [next] | [standalone]


#1483214 — Re: [PATCH 2/2] tools include: Add mman macros needed by perf for all arch

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2016-09-14 13:50 +0200
SubjectRe: [PATCH 2/2] tools include: Add mman macros needed by perf for all arch
Message-ID<shgRr-k0-1@gated-at.bofh.it>
In reply to#1483177
On 2016/09/14 10:57AM, Wang Nan wrote:
> Some macros required by tools/perf/trace/beauty/mmap.c is not support
> for all architectures. For example, MAP_32BIT is defined on x86 only,
> alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.
> 
> This patch regenerates mman.h for each archs, defines these missing
> macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
> because they are in 'case ...' statement. For flags, define to 0.

This resolves the build issue on powerpc, thanks!

Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

[toc] | [prev] | [next] | [standalone]


#1485421 — Re: [PATCH 2/2] tools include: Add mman macros needed by perf for all arch

FromKim Phillips <kim.phillips@arm.com>
Date2016-09-17 01:20 +0200
SubjectRe: [PATCH 2/2] tools include: Add mman macros needed by perf for all arch
Message-ID<siaAh-30p-11@gated-at.bofh.it>
In reply to#1483214
On Wed, 14 Sep 2016 17:16:06 +0530
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:

> On 2016/09/14 10:57AM, Wang Nan wrote:
> > Some macros required by tools/perf/trace/beauty/mmap.c is not support
> > for all architectures. For example, MAP_32BIT is defined on x86 only,
> > alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.
> > 
> > This patch regenerates mman.h for each archs, defines these missing
> > macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
> > because they are in 'case ...' statement. For flags, define to 0.
> 
> This resolves the build issue on powerpc, thanks!

ditto for arm

> Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Tested-by: Kim Phillips <kim.phillips@arm.com>

Thanks,

Kim

[toc] | [prev] | [next] | [standalone]


#1486545 — Re: [PATCH 2/2] tools include: Add mman macros needed by perf for all arch

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-09-19 16:40 +0200
SubjectRe: [PATCH 2/2] tools include: Add mman macros needed by perf for all arch
Message-ID<sj7TI-6Bg-21@gated-at.bofh.it>
In reply to#1485421
Em Fri, Sep 16, 2016 at 06:17:22PM -0500, Kim Phillips escreveu:
> On Wed, 14 Sep 2016 17:16:06 +0530
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:
> 
> > On 2016/09/14 10:57AM, Wang Nan wrote:
> > > Some macros required by tools/perf/trace/beauty/mmap.c is not support
> > > for all architectures. For example, MAP_32BIT is defined on x86 only,
> > > alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.
> > > 
> > > This patch regenerates mman.h for each archs, defines these missing
> > > macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
> > > because they are in 'case ...' statement. For flags, define to 0.
> > 
> > This resolves the build issue on powerpc, thanks!
> 
> ditto for arm
> 
> > Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> 
> Tested-by: Kim Phillips <kim.phillips@arm.com>

Thanks, applied.

- Arnaldo

[toc] | [prev] | [next] | [standalone]


#1487666 — [tip:perf/core] tools include: Add mman macros needed by perf for all arch

Fromtip-bot for Wang Nan <tipbot@zytor.com>
Date2016-09-20 23:50 +0200
Subject[tip:perf/core] tools include: Add mman macros needed by perf for all arch
Message-ID<sjB5n-8g-15@gated-at.bofh.it>
In reply to#1483177
Commit-ID:  f82b77462b8680b84e8cce955b05a6629cb44b36
Gitweb:     http://git.kernel.org/tip/f82b77462b8680b84e8cce955b05a6629cb44b36
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Wed, 14 Sep 2016 10:57:29 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Sep 2016 11:30:56 -0300

tools include: Add mman macros needed by perf for all arch

Some macros required by tools/perf/trace/beauty/mmap.c is not support
for all architectures. For example, MAP_32BIT is defined on x86 only,
alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.

This patch regenerates mman.h for each arch, defines these missing
macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
because they are in a 'case ...' statement. For flags, define it to 0.

Following is the script to generate this patch:

 macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
 rm `find ./tools/arch/ -name mman.h`
 for arch in `ls tools/arch`
 do
   [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
   src=arch/$arch/include/uapi/asm/mman.h
   target=tools/arch/$arch/include/uapi/asm/mman.h.tmp
   real_target=tools/arch/$arch/include/uapi/asm/mman.h
   guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
   rm -f $target

   [ -f $src ] &&
   for m in $macros
   do
     if grep '#define[ \t]*'$m $src > /dev/null 2>&1
     then
       grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
     fi
   done

   if [ -f $src ]
   then
      grep '#include <asm-generic' $src >> $target
   else
      echo "#include <asm-generic/mman.h>" >> $target
   fi

   touch $real_target
   for m in $macros
   do
     if cat << EOF | gcc -Itools/arch/$arch/include -Itools/arch/$arch/include/uapi -Iinclude/ -Iinclude/uapi -E - | grep $m > /dev/null 2>&1
 #include <uapi/asm/mman.h.tmp>
 #include <uapi/linux/mman.h>
 $m
 EOF
   then
     echo "Fixing $m for $arch"
     echo "/* $m is undefined on $arch, fix it for perf */" >> $target
     if echo $m | grep '^MADV_' > /dev/null 2>&1
     then
       grep -h '#define[ \t]*'$m include/uapi/asm-generic/mman-common.h | sed 's/[ \t]*\/\*.*$//g' >> $target
     else
       echo "#define $m	0" >> $target
     fi
   fi
   done

   real_target=tools/arch/$arch/include/uapi/asm/mman.h
   echo '#ifndef '$guard > $real_target
   echo '#define '$guard >> $real_target
   cat $target | sed 's|asm-generic|uapi/asm-generic|g' >> $real_target
   echo '#endif' >> $real_target
   rm $target
   echo "$real_target"
 done

 exit 0
 # Following macros are extracted from:
 # tools/perf/trace/beauty/mmap.c
 #
 # start macro list
 MADV_DODUMP
 MADV_DOFORK
 MADV_DONTDUMP
 MADV_DONTFORK
 MADV_DONTNEED
 MADV_FREE
 MADV_HUGEPAGE
 MADV_HWPOISON
 MADV_MERGEABLE
 MADV_NOHUGEPAGE
 MADV_NORMAL
 MADV_RANDOM
 MADV_REMOVE
 MADV_SEQUENTIAL
 MADV_SOFT_OFFLINE
 MADV_UNMERGEABLE
 MADV_WILLNEED
 MAP_32BIT
 MAP_ANONYMOUS
 MAP_DENYWRITE
 MAP_EXECUTABLE
 MAP_FILE
 MAP_FIXED
 MAP_GROWSDOWN
 MAP_HUGETLB
 MAP_LOCKED
 MAP_NONBLOCK
 MAP_NORESERVE
 MAP_POPULATE
 MAP_PRIVATE
 MAP_SHARED
 MAP_STACK
 MAP_UNINITIALIZED
 MREMAP_FIXED
 MREMAP_MAYMOVE
 PROT_EXEC
 PROT_GROWSDOWN
 PROT_GROWSUP
 PROT_NONE
 PROT_READ
 PROT_SEM
 PROT_WRITE

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Kim Phillips <kim.phillips@arm.com>
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Fixes: 277cf08f3feb ("perf trace beauty mmap: Fix defines for non !x86_64")
Link: http://lkml.kernel.org/r/1473850649-83389-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/arch/alpha/include/uapi/asm/mman.h      | 9 +++++++++
 tools/arch/arc/include/uapi/asm/mman.h        | 2 ++
 tools/arch/arm/include/uapi/asm/mman.h        | 2 ++
 tools/arch/arm64/include/uapi/asm/mman.h      | 2 ++
 tools/arch/frv/include/uapi/asm/mman.h        | 2 ++
 tools/arch/h8300/include/uapi/asm/mman.h      | 2 ++
 tools/arch/hexagon/include/uapi/asm/mman.h    | 2 ++
 tools/arch/ia64/include/uapi/asm/mman.h       | 2 ++
 tools/arch/m32r/include/uapi/asm/mman.h       | 2 ++
 tools/arch/microblaze/include/uapi/asm/mman.h | 2 ++
 tools/arch/mips/include/uapi/asm/mman.h       | 7 +++++++
 tools/arch/mn10300/include/uapi/asm/mman.h    | 2 ++
 tools/arch/parisc/include/uapi/asm/mman.h     | 9 +++++++++
 tools/arch/powerpc/include/uapi/asm/mman.h    | 2 ++
 tools/arch/s390/include/uapi/asm/mman.h       | 2 ++
 tools/arch/score/include/uapi/asm/mman.h      | 2 ++
 tools/arch/sh/include/uapi/asm/mman.h         | 2 ++
 tools/arch/sparc/include/uapi/asm/mman.h      | 2 ++
 tools/arch/tile/include/uapi/asm/mman.h       | 2 ++
 tools/arch/xtensa/include/uapi/asm/mman.h     | 9 +++++++++
 20 files changed, 66 insertions(+)

diff --git a/tools/arch/alpha/include/uapi/asm/mman.h b/tools/arch/alpha/include/uapi/asm/mman.h
index 6ed4ad4..e38b64c 100644
--- a/tools/arch/alpha/include/uapi/asm/mman.h
+++ b/tools/arch/alpha/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP   16
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED	6
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	14
 #define MADV_MERGEABLE   12
 #define MADV_NOHUGEPAGE	15
@@ -35,4 +36,12 @@
 #define PROT_READ	0x1
 #define PROT_SEM	0x8
 #define PROT_WRITE	0x2
+/* MADV_HWPOISON is undefined on alpha, fix it for perf */
+#define MADV_HWPOISON	100
+/* MADV_SOFT_OFFLINE is undefined on alpha, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on alpha, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on alpha, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
diff --git a/tools/arch/arc/include/uapi/asm/mman.h b/tools/arch/arc/include/uapi/asm/mman.h
index f76765d..aa3acd2 100644
--- a/tools/arch/arc/include/uapi/asm/mman.h
+++ b/tools/arch/arc/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_ARC_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_ARC_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on arc, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/arm/include/uapi/asm/mman.h b/tools/arch/arm/include/uapi/asm/mman.h
index f200638..478f699 100644
--- a/tools/arch/arm/include/uapi/asm/mman.h
+++ b/tools/arch/arm/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on arm, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/arm64/include/uapi/asm/mman.h b/tools/arch/arm64/include/uapi/asm/mman.h
index a7dd975..70fd311 100644
--- a/tools/arch/arm64/include/uapi/asm/mman.h
+++ b/tools/arch/arm64/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on arm64, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/frv/include/uapi/asm/mman.h b/tools/arch/frv/include/uapi/asm/mman.h
index 99bba05..5be78ac 100644
--- a/tools/arch/frv/include/uapi/asm/mman.h
+++ b/tools/arch/frv/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on frv, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/h8300/include/uapi/asm/mman.h b/tools/arch/h8300/include/uapi/asm/mman.h
index df95096..9d9ac54 100644
--- a/tools/arch/h8300/include/uapi/asm/mman.h
+++ b/tools/arch/h8300/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on h8300, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/hexagon/include/uapi/asm/mman.h b/tools/arch/hexagon/include/uapi/asm/mman.h
index f1adcce..102f3fa 100644
--- a/tools/arch/hexagon/include/uapi/asm/mman.h
+++ b/tools/arch/hexagon/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on hexagon, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/ia64/include/uapi/asm/mman.h b/tools/arch/ia64/include/uapi/asm/mman.h
index 23420eb..1d6e5ac 100644
--- a/tools/arch/ia64/include/uapi/asm/mman.h
+++ b/tools/arch/ia64/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on ia64, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/m32r/include/uapi/asm/mman.h b/tools/arch/m32r/include/uapi/asm/mman.h
index a35ebd6..1c29635 100644
--- a/tools/arch/m32r/include/uapi/asm/mman.h
+++ b/tools/arch/m32r/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on m32r, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/microblaze/include/uapi/asm/mman.h b/tools/arch/microblaze/include/uapi/asm/mman.h
index 75f460a..005cd50 100644
--- a/tools/arch/microblaze/include/uapi/asm/mman.h
+++ b/tools/arch/microblaze/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on microblaze, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/mips/include/uapi/asm/mman.h b/tools/arch/mips/include/uapi/asm/mman.h
index db88fa4..c020529 100644
--- a/tools/arch/mips/include/uapi/asm/mman.h
+++ b/tools/arch/mips/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP	16
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED	4
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	14
 #define MADV_HWPOISON	 100
 #define MADV_MERGEABLE	 12
@@ -36,4 +37,10 @@
 #define PROT_READ	0x01
 #define PROT_SEM	0x10
 #define PROT_WRITE	0x02
+/* MADV_SOFT_OFFLINE is undefined on mips, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on mips, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on mips, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
diff --git a/tools/arch/mn10300/include/uapi/asm/mman.h b/tools/arch/mn10300/include/uapi/asm/mman.h
index 81faa5d..c1ea36d 100644
--- a/tools/arch/mn10300/include/uapi/asm/mman.h
+++ b/tools/arch/mn10300/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on mn10300, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/parisc/include/uapi/asm/mman.h b/tools/arch/parisc/include/uapi/asm/mman.h
index c4a9d9f..03d8d5b 100644
--- a/tools/arch/parisc/include/uapi/asm/mman.h
+++ b/tools/arch/parisc/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP   69
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED   4
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	67
 #define MADV_MERGEABLE   65
 #define MADV_NOHUGEPAGE	68
@@ -35,4 +36,12 @@
 #define PROT_READ	0x1
 #define PROT_SEM	0x8
 #define PROT_WRITE	0x2
+/* MADV_HWPOISON is undefined on parisc, fix it for perf */
+#define MADV_HWPOISON	100
+/* MADV_SOFT_OFFLINE is undefined on parisc, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on parisc, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif
diff --git a/tools/arch/powerpc/include/uapi/asm/mman.h b/tools/arch/powerpc/include/uapi/asm/mman.h
index 7a56ab9..761db43 100644
--- a/tools/arch/powerpc/include/uapi/asm/mman.h
+++ b/tools/arch/powerpc/include/uapi/asm/mman.h
@@ -10,4 +10,6 @@
 #define MAP_POPULATE	0x8000
 #define MAP_STACK	0x20000
 #include <uapi/asm-generic/mman-common.h>
+/* MAP_32BIT is undefined on powerpc, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/s390/include/uapi/asm/mman.h b/tools/arch/s390/include/uapi/asm/mman.h
index fe53b91..b03dea9 100644
--- a/tools/arch/s390/include/uapi/asm/mman.h
+++ b/tools/arch/s390/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on s390, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/score/include/uapi/asm/mman.h b/tools/arch/score/include/uapi/asm/mman.h
index ba1ee9c..2f8fb89 100644
--- a/tools/arch/score/include/uapi/asm/mman.h
+++ b/tools/arch/score/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on score, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/sh/include/uapi/asm/mman.h b/tools/arch/sh/include/uapi/asm/mman.h
index 5a47d8c..26504f6 100644
--- a/tools/arch/sh/include/uapi/asm/mman.h
+++ b/tools/arch/sh/include/uapi/asm/mman.h
@@ -1,4 +1,6 @@
 #ifndef TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H
 #define TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H
 #include <uapi/asm-generic/mman.h>
+/* MAP_32BIT is undefined on sh, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/sparc/include/uapi/asm/mman.h b/tools/arch/sparc/include/uapi/asm/mman.h
index b88f3ac..8640525 100644
--- a/tools/arch/sparc/include/uapi/asm/mman.h
+++ b/tools/arch/sparc/include/uapi/asm/mman.h
@@ -10,4 +10,6 @@
 #define MAP_POPULATE	0x8000
 #define MAP_STACK	0x20000
 #include <uapi/asm-generic/mman-common.h>
+/* MAP_32BIT is undefined on sparc, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/tile/include/uapi/asm/mman.h b/tools/arch/tile/include/uapi/asm/mman.h
index b0a054f..7116c4b 100644
--- a/tools/arch/tile/include/uapi/asm/mman.h
+++ b/tools/arch/tile/include/uapi/asm/mman.h
@@ -10,4 +10,6 @@
 #define MAP_POPULATE	0x0040
 #define MAP_STACK	MAP_GROWSDOWN
 #include <uapi/asm-generic/mman-common.h>
+/* MAP_32BIT is undefined on tile, fix it for perf */
+#define MAP_32BIT	0
 #endif
diff --git a/tools/arch/xtensa/include/uapi/asm/mman.h b/tools/arch/xtensa/include/uapi/asm/mman.h
index 1c89538..4453195 100644
--- a/tools/arch/xtensa/include/uapi/asm/mman.h
+++ b/tools/arch/xtensa/include/uapi/asm/mman.h
@@ -5,6 +5,7 @@
 #define MADV_DONTDUMP   16
 #define MADV_DONTFORK	10
 #define MADV_DONTNEED	4
+#define MADV_FREE	8
 #define MADV_HUGEPAGE	14
 #define MADV_MERGEABLE   12
 #define MADV_NOHUGEPAGE	15
@@ -35,4 +36,12 @@
 #define PROT_READ	0x1
 #define PROT_SEM	0x10
 #define PROT_WRITE	0x2
+/* MADV_HWPOISON is undefined on xtensa, fix it for perf */
+#define MADV_HWPOISON	100
+/* MADV_SOFT_OFFLINE is undefined on xtensa, fix it for perf */
+#define MADV_SOFT_OFFLINE 101
+/* MAP_32BIT is undefined on xtensa, fix it for perf */
+#define MAP_32BIT	0
+/* MAP_UNINITIALIZED is undefined on xtensa, fix it for perf */
+#define MAP_UNINITIALIZED	0
 #endif

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web