From: Wang Nan <wangnan0@huawei.com>
To: <acme@kernel.org>, <tmricht@linux.vnet.ibm.com>
Cc: <linux-kernel@vger.kernel.org>, Wang Nan <wangnan0@huawei.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Li Zefan <lizefan@huawei.com>
Subject: [PATCH] perf test llvm: Avoid error when PROFILE_ALL_BRANCHES is set
Date: Wed, 21 Jun 2017 02:32:03 +0800 [thread overview]
Message-ID: <20170620183203.2517-1-wangnan0@huawei.com> (raw)
'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@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Li Zefan <lizefan@huawei.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
next reply other threads:[~2017-06-19 10:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 18:32 Wang Nan [this message]
2017-06-20 9:03 ` [tip:perf/core] " tip-bot for Wang Nan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170620183203.2517-1-wangnan0@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexei.starovoitov@gmail.com \
--cc=brueckner@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tmricht@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®