From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752829AbcFUGWF (ORCPT ); Tue, 21 Jun 2016 02:22:05 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:23736 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751775AbcFUGVo (ORCPT ); Tue, 21 Jun 2016 02:21:44 -0400 Subject: Re: [PATCH 2/2] perf record: Add --dry-run option to check cmdline options To: Alexei Starovoitov , "Arnaldo Carvalho de Melo" References: <1466064161-48553-1-git-send-email-wangnan0@huawei.com> <1466064161-48553-3-git-send-email-wangnan0@huawei.com> <20160616164815.GE13337@kernel.org> <57676309.8000907@huawei.com> <20160620143818.GA3050@redhat.com> <20160620162208.GA67352@ast-mbp.thefacebook.com> CC: Arnaldo Carvalho de Melo , , , David Ahern , Namhyung Kim , Alexei Starovoitov , Jiri Olsa From: "Wangnan (F)" Message-ID: <5768DAD6.4020005@huawei.com> Date: Tue, 21 Jun 2016 14:12:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160620162208.GA67352@ast-mbp.thefacebook.com> 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.0A020202.5768DAE3.0028,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3f040d16b1cf5e5a1e2bc6aded2bb5f8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/6/21 0:22, Alexei Starovoitov wrote: > On Mon, Jun 20, 2016 at 11:38:18AM -0300, Arnaldo Carvalho de Melo wrote: >> Em Mon, Jun 20, 2016 at 11:29:13AM +0800, Wangnan (F) escreveu: >>> On 2016/6/17 0:48, Arnaldo Carvalho de Melo wrote: >>>> Em Thu, Jun 16, 2016 at 08:02:41AM +0000, Wang Nan escreveu: >>>>> With '--dry-run', 'perf record' doesn't do reall recording. Combine with >>>>> llvm.dump-obj option, --dry-run can be used to help compile BPF objects for >>>>> embedded platform. >>>> So these are nice and have value, but can we have a subcommand to do all >>>> this with an expressive name, Something like: >>>> perf bpfcc foo.c -o foo >>>> or shorter: >>>> perf bcc foo.c -o foo >>>> Just like one would use gcc or some other compiler to generate something >>>> for later use? >>> I'll try it today. I thought a subcommand require a bigger feature, >>> and wrapping clang is not big enough. >> Not really, we may have as many as we like, given that they provide >> something useful, like I think is the case here. >> >> Having to edit ~/.perfconfig, create a new section, a variable in it >> with a boolean value (at first, just reading the changeset comment, I >> thought I had to provide a directory where to store the objects >> "dumped"), to then use a tool to record a .c event, but not recording >> (use dry-run, which is useful to test the command line, etc), to then >> get, on the current directory, the end result looked to me a convoluted >> way to ask perf to compile the given .c file into a .o for later use. >> >> Doing: >> >> perf bcc -c foo.c >> >> Looks so much simpler and similar to an existing compile source code >> into object file workflow (gcc's, any C compiler) that I think it would >> fit in the workflow being discussed really nicely. > I'm hopeful that eventually we'll be able merge iovisor/bcc project > with perf, so would be good to reserve 'perf bcc' command for that > future use. Also picking a different name for compiling would be less > confusing to users who already familiar with bcc. Instead we can use: > perf bpfcc foo.c -o foo.o > perf cc foo.c > perf compile foo.c > I think finally we should make perf independent with LLVM runtime. I suggest 'perf bpf' subcommand to deal with all BPF related things, include compiling, configuration and potential cache. Thank you.