Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbcLEQvH (ORCPT ); Mon, 5 Dec 2016 11:51:07 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36132 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbcLEQvF (ORCPT ); Mon, 5 Dec 2016 11:51:05 -0500 Date: Mon, 5 Dec 2016 08:51:01 -0800 From: Alexei Starovoitov To: Arnaldo Carvalho de Melo Cc: Wang Nan , ast@fb.com, lizefan@huawei.com, hekuang@huawei.com, Ingo Molnar , linux-kernel@vger.kernel.org, pi3orama@163.com, joe@ovn.org, Jiri Olsa , acme@kernel.org Subject: Re: [PATCH v3 10/30] perf clang: Add builtin clang support ant test case Message-ID: <20161205165055.GB79989@ast-mbp.thefacebook.com> References: <20161126070354.141764-1-wangnan0@huawei.com> <20161126070354.141764-11-wangnan0@huawei.com> <20161202154440.GB5931@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161202154440.GB5931@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2129 Lines: 60 On Fri, Dec 02, 2016 at 01:44:40PM -0200, Arnaldo Carvalho de Melo wrote: > Em Sat, Nov 26, 2016 at 07:03:34AM +0000, Wang Nan escreveu: > > Add basic clang support in clang.cpp and test__clang() testcase. The > > first testcase checks if builtin clang is able to generate LLVM IR. > > > > tests/clang.c is a proxy. Real testcase resides in > > utils/c++/clang-test.cpp in c++ and exports C interface to perf test > > subsystem. > > > > Test result: > > > > $ perf test -v clang > > 51: Test builtin clang support : > > 51.1: Test builtin clang compile C source to IR : > > --- start --- > > test child forked, pid 13215 > > test child finished with 0 > > ---- end ---- > > Test builtin clang support subtest 0: Ok > > While testing this I noticed that the perf binary got huge, can't this > be done in some other way, i.e. using dynamic library? > > [root@jouet ~]# size /tmp/perf > text data bss dec hex filename > 75333688 1421584 23962176 100717448 600d388 /tmp/perf > [root@jouet ~]# > > I've built it with this: > > make LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin > > the resulting binary: > > [acme@jouet linux]$ > [acme@jouet linux]$ ls -la ~/bin/perf > -rwxr-xr-x. 2 acme acme 131689136 Dec 2 12:31 /home/acme/bin/perf > [acme@jouet linux]$ ls -lah ~/bin/perf > -rwxr-xr-x. 2 acme acme 126M Dec 2 12:31 /home/acme/bin/perf > [acme@jouet linux]$ > > Huge, after stripping it: > > [acme@jouet linux]$ ls -la /tmp/perf > -rwxr-xr-x. 1 root root 76759056 Dec 2 12:33 /tmp/perf > [acme@jouet linux]$ ls -lah /tmp/perf > -rwxr-xr-x. 1 root root 74M Dec 2 12:33 /tmp/perf > [acme@jouet linux]$ > > Still huge :-\ yeah. it's kinda high. I'm guessing rpm llvm libs are in debug mode. Try llvm-config --build-mode --assertion-mode it should be Release OFF > But being a n00b on llvm/clang libraries, etc, my question goes back to: > can we have this using a libllvm.so or libclang.so dynamic libraries? that can also work. The reason we build iovisor/bcc into single binary is to ease operational headache.