[tip:perf/core] perf trace: Add getrandom beautifier related defines for older systems
From: tip-bot for Arnaldo Carvalho de Melo
Date: Thu Apr 14 2016 - 09:34:37 EST
Commit-ID: a355a61e43484ac02553b34b5f84ee84ca765fd6
Gitweb: http://git.kernel.org/tip/a355a61e43484ac02553b34b5f84ee84ca765fd6
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
AuthorDate: Wed, 13 Apr 2016 11:55:18 -0300
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Thu, 14 Apr 2016 08:57:53 -0300
perf trace: Add getrandom beautifier related defines for older systems
Were the detached tarball (make perf-tar-src-pkg) build was failing because
those definitions aren't available in the system headers.
On RHEL7, for instance:
builtin-trace.c: In function âsyscall_arg__scnprintf_getrandom_flagsâ:
builtin-trace.c:1113:14: error: âGRND_RANDOMâ undeclared (first use in this function)
P_FLAG(RANDOM);
^
builtin-trace.c:1114:14: error: âGRND_NONBLOCKâ undeclared (first use in this function)
P_FLAG(NONBLOCK);
^
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Milian Wolff <milian.wolff@xxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-r8496g24a3kbqynvk6617b0e@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-trace.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 246866c..653d4c7 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1110,6 +1110,13 @@ static size_t syscall_arg__scnprintf_seccomp_flags(char *bf, size_t size,
#define SCA_SECCOMP_FLAGS syscall_arg__scnprintf_seccomp_flags
+#ifndef GRND_NONBLOCK
+#define GRND_NONBLOCK 0x0001
+#endif
+#ifndef GRND_RANDOM
+#define GRND_RANDOM 0x0002
+#endif
+
static size_t syscall_arg__scnprintf_getrandom_flags(char *bf, size_t size,
struct syscall_arg *arg)
{