Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf trace beauty mmap: Fix defines for non !x86_64

Several defines have different values in different arches, so we can't
just define it to the x86_64 value, use uapi/linux/mmap.h that was
recently introduced to reliably find those, not using possibly outdated
libc headers.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Link: http://lkml.kernel.org/n/tip-4eajp5yp8i2fuw44n7jmcg5t@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+1 -70
+1 -70
tools/perf/trace/beauty/mmap.c
··· 1 - #include <sys/mman.h> 2 - 3 - #ifndef PROT_SEM 4 - #define PROT_SEM 0x8 5 - #endif 1 + #include <uapi/linux/mman.h> 6 2 7 3 static size_t syscall_arg__scnprintf_mmap_prot(char *bf, size_t size, 8 4 struct syscall_arg *arg) ··· 28 32 } 29 33 30 34 #define SCA_MMAP_PROT syscall_arg__scnprintf_mmap_prot 31 - 32 - #ifndef MAP_FIXED 33 - #define MAP_FIXED 0x10 34 - #endif 35 - 36 - #ifndef MAP_ANONYMOUS 37 - #define MAP_ANONYMOUS 0x20 38 - #endif 39 - 40 - #ifndef MAP_32BIT 41 - #define MAP_32BIT 0x40 42 - #endif 43 - 44 - #ifndef MAP_STACK 45 - #define MAP_STACK 0x20000 46 - #endif 47 - 48 - #ifndef MAP_HUGETLB 49 - #define MAP_HUGETLB 0x40000 50 - #endif 51 - 52 - #ifndef MAP_UNINITIALIZED 53 - #define MAP_UNINITIALIZED 0x4000000 54 - #endif 55 - 56 35 57 36 static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size, 58 37 struct syscall_arg *arg) ··· 66 95 67 96 #define SCA_MMAP_FLAGS syscall_arg__scnprintf_mmap_flags 68 97 69 - #ifndef MREMAP_MAYMOVE 70 - #define MREMAP_MAYMOVE 1 71 - #endif 72 - #ifndef MREMAP_FIXED 73 - #define MREMAP_FIXED 2 74 - #endif 75 - 76 98 static size_t syscall_arg__scnprintf_mremap_flags(char *bf, size_t size, 77 99 struct syscall_arg *arg) 78 100 { ··· 88 124 } 89 125 90 126 #define SCA_MREMAP_FLAGS syscall_arg__scnprintf_mremap_flags 91 - 92 - #ifndef MADV_HWPOISON 93 - #define MADV_HWPOISON 100 94 - #endif 95 - 96 - #ifndef MADV_SOFT_OFFLINE 97 - #define MADV_SOFT_OFFLINE 101 98 - #endif 99 - 100 - #ifndef MADV_MERGEABLE 101 - #define MADV_MERGEABLE 12 102 - #endif 103 - 104 - #ifndef MADV_UNMERGEABLE 105 - #define MADV_UNMERGEABLE 13 106 - #endif 107 - 108 - #ifndef MADV_HUGEPAGE 109 - #define MADV_HUGEPAGE 14 110 - #endif 111 - 112 - #ifndef MADV_NOHUGEPAGE 113 - #define MADV_NOHUGEPAGE 15 114 - #endif 115 - 116 - #ifndef MADV_DONTDUMP 117 - #define MADV_DONTDUMP 16 118 - #endif 119 - 120 - #ifndef MADV_DODUMP 121 - #define MADV_DODUMP 17 122 - #endif 123 - 124 127 125 128 static size_t syscall_arg__scnprintf_madvise_behavior(char *bf, size_t size, 126 129 struct syscall_arg *arg)