From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbbGOLIg (ORCPT ); Wed, 15 Jul 2015 07:08:36 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:44572 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752821AbbGOLIf (ORCPT ); Wed, 15 Jul 2015 07:08:35 -0400 Message-ID: <55A63AC4.6040701@huawei.com> Date: Wed, 15 Jul 2015 18:49:40 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: , , , , , Subject: Re: perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering events using eBPF programs References: <1436445342-1402-1-git-send-email-wangnan0@huawei.com> <20150714153657.GL2885@kernel.org> In-Reply-To: <20150714153657.GL2885@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.55A63AF4.0023,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d4c48e4eb0bc08dd2a79cc99743ba2ae Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/7/14 23:36, Arnaldo Carvalho de Melo wrote: > Em Thu, Jul 09, 2015 at 12:35:03PM +0000, Wang Nan escreveu: >> Hi Arnaldo, >> >> The following changes since commit 3381a29cbec5447086c0f726ee9a88c02e60becc: >> >> bpf tools: Collect map definitions from 'maps' section (2015-07-07 13:41:45 -0300) >> >> are available in the git repository at: >> >> https://github.com/WangNan0/linux.git perf/ebpf-for-acme >> >> for you to fetch changes up to 072b826c5dc6b2031f4f21c59c57eb6ca1dfa7c0: > So, this is really nice: > > 38: Test LLVM searching and compiling :ERROR: unable to find clang. > Hint: Try to install latest clang/llvm to support BPF. Check your $PATH > and 'clang-path' option in [llvm] section of ~/.perfconfig. > LLVM 3.7 or newer is required. Which can be found from http://llvm.org > You may want to try git trunk: > git clone http://llvm.org/git/llvm.git > and > git clone http://llvm.org/git/clang.git > > Or fetch the latest clang/llvm 3.7 from pre-built llvm packages for > debian/ubuntu: > http://llvm.org/apt > > If you are using old version of clang, change 'clang-bpf-cmd-template' > option in [llvm] section of ~/.perfconfig to: > > "$CLANG_EXEC $CLANG_OPTIONS $KERNEL_INC_OPTIONS \ > -working-directory $WORKING_DIR -c $CLANG_SOURCE \ > -emit-llvm -o - | /path/to/llc -march=bpf -filetype=obj -o -" > (Replace /path/to/llc with path to your llc) > > FAILED! > [acme@zoo linux]$ > > I have the trees cloned and plan to follow these instructions to have this test > passing, to then move on to the next patches, but one request, please change > the above to produce: > > 38: Test LLVM searching and compiling :(no clang) Ok run 'perf test -v LLVM' for instructions on having a clang environment The output format you desire is hard to implement, because 'Ok' is printed by the parent process. We have to find a way to allow child process to pass 'run 'perf test -v LLVM' for ...' to parent, then parent can print it after 'Ok'. I change this test as follow: *Case 1* When user don't set any [llvm] option in his/her ~/.perfconfig, and 'clang' is not found in $PATH: # perf test 'LLVM' 38: Test LLVM searching and compiling : (no clang, try 'perf test -v LLVM') Skip and: # perf test -v 'LLVM' 38: Test LLVM searching and compiling : --- start --- test child forked, pid 163505 ERROR: unable to find clang. Hint: Try to install latest clang/llvm to support BPF. Check your $PATH ... test child finished with -1 ---- end ---- Test LLVM searching and compiling: FAILED! *Case 2* If clang can be found or user set something in his/her ~/.perfconfig: # cat << EOF > ~/.perfconfig > [llvm] > clang-path = "/usr/bin/false" > EOF # perf test 'LLVM' 38: Test LLVM searching and compiling : (use -v to see error message) FAILED! # perf test -v 'LLVM' 38: Test LLVM searching and compiling : --- start --- test child forked, pid 20712 Kernel build dir is set to /lib/modules/3.12.28-4-default/build set env: KBUILD_DIR=/lib/modules/3.12.28-4-default/build ... ERROR: unable to compile - Hint: Check error message shown above. LLVM 3.7 or newer is required. Which can be found from http://llvm.org ... test child finished with -1 ---- end ---- Test LLVM searching and compiling: FAILED! *Case 3* If everything is okay: # perf test 'LLVM' 38: Test LLVM searching and compiling : Ok Here is the newest pull request: The following changes since commit 101ef9b4f5c70dbfffa0186102c1014bd81a4ec7: bpf tools: Link all bpf objects onto a list (2015-07-13 18:48:17 -0300) are available in the git repository at: https://github.com/WangNan0/linux.git perf/ebpf-for-acme for you to fetch changes up to a20f387a54aa38c3cae70775273ff9d69a16d0c6: perf tools: Support attach BPF program on uprobe events (2015-07-15 10:39:24 +0000) ---------------------------------------------------------------- I'll posted a new 'perf tests: Add LLVM test for eBPF on-the-fly compiling' by replying the old one, so you can leave your comment message there if you want. Thank you. > 'perf test' will accept either '38' or any substring in the test description and > will run just the ones specified, and with -v we will spare people not interested > in this eBPF support of these nice verbose instructions :-) > > If we find clang but then fail to build, ok, then this is a hard error, I think, > and 'perf test' should FAIL that test. > > Regards, > > - Arnaldo