Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030224AbbFDWIL (ORCPT ); Thu, 4 Jun 2015 18:08:11 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:35151 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030196AbbFDWHa (ORCPT ); Thu, 4 Jun 2015 18:07:30 -0400 Message-ID: <5570CC1E.2070901@plumgrid.com> Date: Thu, 04 Jun 2015 15:07:26 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Masami Hiramatsu , Ingo Molnar , pi3orama CC: "Wangnan (F)" , Arnaldo Carvalho de Melo , "linux-kernel@vger.kernel.org" , Adrian Hunter , Brendan Gregg , Daniel Borkmann , David Ahern , He Kuang , Jiri Olsa , Kaixu Xia , Madhavan Srinivasan , Michael Ellerman , Namhyung Kim , Peter Zijlstra , Sukadev Bhattiprolu , Zefan Li , Arnaldo Carvalho de Melo , Alexei Starovoitov , cti.systems-productivity-manager.ts@hitachi.com Subject: Re: [GIT PULL 0/6] perf/core improvements and fixes References: <1433371238-14572-1-git-send-email-acme@kernel.org> <20150604054854.GA10969@gmail.com> <556FEB32.8040909@huawei.com> <20150604072153.GA18983@gmail.com> <557021D3.7070900@huawei.com> <20150604124033.GA10580@gmail.com> <0108CD89-BFFA-4A68-90AE-A34597777641@163.com> <20150604140412.GB14445@gmail.com> <55707B3F.2070704@plumgrid.com> <5570C7C2.9030900@hitachi.com> In-Reply-To: <5570C7C2.9030900@hitachi.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2097 Lines: 58 On 6/4/15 2:48 PM, Masami Hiramatsu wrote: > On 2015/06/05 1:22, Alexei Starovoitov wrote: >> On 6/4/15 7:04 AM, Ingo Molnar wrote: >>>>> # perf record -e bpf_source.c cmdline >>>>> >>>>> to create a eBPF filter from source, >>>>> >>>>> Use >>>>> >>>>> # perf record -e bpf_object.o cmdline >>>>> >>>>> to create a eBPF filter from object intermedia. >>>>> >>>>> Use >>>>> >>>>> # perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o >>>>> >>>>> to create the .o >>>>> >>>>> I think this should be enough. Currently only the second case has been implemented. >>> So if users cannot actually generate .o files then it's premature to merge this in >>> such an incomplete form! >>> >>> It should be possible to use a feature that we are merging. >> >> of course it's usable :) There is some confusion here. >> To compile .c into .o one can easily use >> clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o >> any version of clang is ok, >> llc needs to be fresh with bpf backend. >> >> For a lot of cases kernel headers are not needed, so above >> will work fine. >> For our TC examples we recommend to use 'bcc' alias: >> bcc() { >> clang -O2 -emit-llvm -c $1 -o - | llc -march=bpf -filetype=obj -o >> "`basename $1 .c`.o" >> } >> then compiling as easy as 'bcc file.c' >> >> What Wang mentioned that we're working on is fully integrated 'bcc'. >> It will use clang/llvm as libraries, so no intermediate steps will >> be needed, but some folks will always have concerns about >> ultra-embedded environments where even 20Mb of libllvm.so is too much. >> >> So I think we need to support both 'perf record -e file.[co]' > > I think we'd better make 'perf record -e file.c' default and '-e file.o' > should be an option. what do you mean 'default' ? It's a command line :) .c is easier to use of course, no question. -- 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/