Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1184687

Re: perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering events using eBPF programs

From "Wangnan (F)" <wangnan0@huawei.com>
Newsgroups linux.kernel
Subject Re: perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering events using eBPF programs
Date 2015-07-15 13:10 +0200
Message-ID <pMsJz-5F0-1@gated-at.bofh.it> (permalink)
References <pKjhn-9T-3@gated-at.bofh.it> <pMatk-4pB-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/39] perf tools: filtering events using eBPF programs Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:40 +0200
  [PATCH 36/39] perf tools: Use same BPF program if arguments are identical Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 25/39] perf tools: Attach eBPF program to perf event Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 27/39] perf record: Add clang options for compiling BPF scripts Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 34/39] perf tools: Add prologue for BPF programs for fetching arguments Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 31/39] perf tools: Move linux/filter.h to tools/include Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 26/39] perf tools: Suppress probing messages when probing by BPF loading Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 28/39] bpf tools: Load a program with different instances using preprocessor Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
    Re: [PATCH 28/39] bpf tools: Load a program with different instances  using preprocessor "Wangnan (F)" <wangnan0@huawei.com> - 2015-07-13 08:00 +0200
  [PATCH 13/39] perf tools: Call clang to compile C source to object code Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 32/39] perf tools: Add BPF_PROLOGUE config options for further patches Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 06/39] bpf tools: Create eBPF maps defined in an object file Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
    Re: [PATCH 06/39] bpf tools: Create eBPF maps defined in an object  file "Wangnan (F)" <wangnan0@huawei.com> - 2015-07-14 06:10 +0200
  [PATCH 35/39] perf tools: Generate prologue for BPF programs Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 30/39] perf probe: Reset args and nargs for probe_trace_event when failure Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 18/39] perf record: Enable passing bpf object file to --event Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 14/39] perf tools: Auto detecting kernel build directory Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 23/39] perf record: Load all eBPF object into kernel Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 24/39] perf tools: Add bpf_fd field to evsel and config it Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 22/39] perf record: Probe at kprobe points Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 15/39] perf tools: Auto detecting kernel include options Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 29/39] perf tools: Fix probe-event.h include Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 02/39] bpf tools: Collect eBPF programs from their own sections Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
    Re: [PATCH 02/39] bpf tools: Collect eBPF programs from their own  sections "Wangnan (F)" <wangnan0@huawei.com> - 2015-07-10 05:20 +0200
      Re: [PATCH 02/39] bpf tools: Collect eBPF programs from their own  sections "Wangnan (F)" <wangnan0@huawei.com> - 2015-07-14 06:10 +0200
  [PATCH 21/39] perf probe: Attach trace_probe_event with perf_probe_event Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 09/39] bpf tools: Load eBPF programs in object files into kernel Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  [PATCH 37/39] perf record: Support custom vmlinux path Wang Nan <wangnan0@huawei.com> - 2015-07-09 14:50 +0200
  perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering  events using eBPF programs Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-07-14 17:40 +0200
    Re: perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering  events using eBPF programs "Wangnan (F)" <wangnan0@huawei.com> - 2015-07-15 13:10 +0200
      Re: perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering  events using eBPF programs Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-07-15 13:30 +0200

csiph-web