lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Jul 2015 18:49:40 +0800
From:	"Wangnan (F)" <wangnan0@...wei.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
CC:	<ast@...mgrid.com>, <linux-kernel@...r.kernel.org>,
	<lizefan@...wei.com>, <hekuang@...wei.com>, <xiakaixu@...wei.com>,
	<pi3orama@....com>
Subject: Re: perf test LLVM was: Re: [GIT PULL 00/39] perf tools: filtering
 events using eBPF programs



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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ