Skip to content

Commit 456857b

Browse files
Ingo Molnaracmel
Ingo Molnar
authored andcommitted
perf tools: Fill in new definitions for madvise()/mmap() flags
builtin-trace.c started using various new syscall features not defined in the header files of older distros - resulting in build failures. Fill in the (ABI) constants if they are not defined. (There might be a better place to put this than builtin-trace.c, into a compat header or so.) Signed-off-by: Ingo Molnar <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 33cbbdc commit 456857b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/perf/builtin-trace.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@
1616
#include <sys/mman.h>
1717
#include <linux/futex.h>
1818

19+
/* For older distros: */
20+
#ifndef MAP_STACK
21+
# define MAP_STACK 0x20000
22+
#endif
23+
24+
#ifndef MADV_HWPOISON
25+
# define MADV_HWPOISON 100
26+
#endif
27+
28+
#ifndef MADV_MERGEABLE
29+
# define MADV_MERGEABLE 12
30+
#endif
31+
32+
#ifndef MADV_UNMERGEABLE
33+
# define MADV_UNMERGEABLE 13
34+
#endif
35+
1936
static size_t syscall_arg__scnprintf_hex(char *bf, size_t size,
2037
unsigned long arg,
2138
u8 arg_idx __maybe_unused,

0 commit comments

Comments
 (0)