[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170620183203.2517-1-wangnan0@huawei.com>
Date: Wed, 21 Jun 2017 02:32:03 +0800
From: Wang Nan <wangnan0@...wei.com>
To: <acme@...nel.org>, <tmricht@...ux.vnet.ibm.com>
CC: <linux-kernel@...r.kernel.org>, Wang Nan <wangnan0@...wei.com>,
"Arnaldo Carvalho de Melo" <acme@...hat.com>,
Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Li Zefan <lizefan@...wei.com>
Subject: [PATCH] perf test llvm: Avoid error when PROFILE_ALL_BRANCHES is set
'if' is defined to complex code when CONFIG_PROFILE_ALL_BRANCHES is
selected, which cause a 'perf test LLVM' failure like:
$ ./perf test LLVM
35: LLVM search and compile :
35.1: Basic BPF llvm compile : Ok
35.2: kbuild searching : Ok
35.3: Compile source for BPF prologue generation: FAILED!
35.4: Compile source for BPF relocation : Skip
The only affected test case is bpf-script-test-prologue.c
because it uses kernel headers and has 'if' inside.
This patch undefines 'if' to make it passes perf test.
Signed-off-by: Wang Nan <wangnan0@...wei.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Thomas-Mich Richter <tmricht@...ux.vnet.ibm.com>
Cc: Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Li Zefan <lizefan@...wei.com>
---
tools/perf/tests/bpf-script-test-prologue.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/perf/tests/bpf-script-test-prologue.c b/tools/perf/tests/bpf-script-test-prologue.c
index 7230e62..b4ebc75 100644
--- a/tools/perf/tests/bpf-script-test-prologue.c
+++ b/tools/perf/tests/bpf-script-test-prologue.c
@@ -10,6 +10,15 @@
#include <uapi/linux/fs.h>
+/*
+ * If CONFIG_PROFILE_ALL_BRANCHES is selected,
+ * 'if' is redefined after include kernel header.
+ * Recover 'if' for BPF object code.
+ */
+#ifdef if
+# undef if
+#endif
+
#define FMODE_READ 0x1
#define FMODE_WRITE 0x2
--
2.9.3
Powered by blists - more mailing lists