From patchwork Tue Jun 20 18:32:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 105814 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp802952qgd; Mon, 19 Jun 2017 03:28:17 -0700 (PDT) X-Received: by 10.84.231.15 with SMTP id f15mr29190687plk.131.1497868097588; Mon, 19 Jun 2017 03:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497868097; cv=none; d=google.com; s=arc-20160816; b=P9vDHieyLviDdqywXi49JyFB1hTIhiRCRtiKbFyEvhljSqbetjPKi7fzMlWzMJyMRy zgf4VaoDfcokwRCP/w8KZRCXlLOideYX5ishBN9G0Nae+n8dGSSwHp+GLdgQ2FiNoNsH weyL8jTCSAntNtSdn5rjyb7nM1JUzwc3G4DECRIdL/zKtQW0PEFB9NEAIiPEIGgfaWHK JPaMbwXZabmXxpbVZQzvf7KrzdqJQ+VphHOe6yTaBgLvJptzfUmQbYfwMPPuvTzWSeXx TDo9t9K8e4ESMOkET9h4nJrqjjz918DqACZrQs1/m6R0llke6bW9mKZrWa/aBf8b1iP6 Hedg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=XMKbVSncE8x/0KkuJBPIIYez0ba4AKqYqfSO+UXVON0=; b=pVvhqcMtzhrUU6QnO0+7r+WF8Fdrmt68yElBfEdj8tdkdKVG0OHxx/mobKeStXvqw/ O50gLmgrj4fBWPZmJv4OYt29T6ov7nayMR+obg2yPObzFjIJRh5Oppb7Mk+JAgT19U/R zI6AjMVGQivYvY+C+4ocol79t0iIGUHI5qfckcLtYhjePAhOTe/LbK1Nm/6NCa4CL8kG jAGQKSifRO2bCoFDFziplkkuJd8QuEectu/uAktKGmswblYbUqhdbOyoWboqyvtuY4J9 nGfqcruIH3sHQ1MdjoGrX8durSF/btV4jHinBlgBsD9kG5jV86/njrQQmOFO64I8g3rf w4uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si7614494pgc.578.2017.06.19.03.28.17; Mon, 19 Jun 2017 03:28:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987AbdFSK17 (ORCPT + 25 others); Mon, 19 Jun 2017 06:27:59 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7906 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753682AbdFSK15 (ORCPT ); Mon, 19 Jun 2017 06:27:57 -0400 Received: from 172.30.72.53 (EHLO DGGEML401-HUB.china.huawei.com) ([172.30.72.53]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id APR06326; Mon, 19 Jun 2017 18:27:44 +0800 (CST) Received: from localhost.localdomain (10.110.60.55) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server id 14.3.301.0; Mon, 19 Jun 2017 18:27:33 +0800 From: Wang Nan To: , CC: , Wang Nan , "Arnaldo Carvalho de Melo" , Hendrik Brueckner , Alexei Starovoitov , Li Zefan Subject: [PATCH] perf test llvm: Avoid error when PROFILE_ALL_BRANCHES is set Date: Wed, 21 Jun 2017 02:32:03 +0800 Message-ID: <20170620183203.2517-1-wangnan0@huawei.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [10.110.60.55] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.5947A720.01D2, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 115d147b313a6642201ba20c83a86eb1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org '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 Cc: Arnaldo Carvalho de Melo Cc: Thomas-Mich Richter Cc: Hendrik Brueckner Cc: Alexei Starovoitov Cc: Li Zefan --- tools/perf/tests/bpf-script-test-prologue.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.9.3 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 +/* + * 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