From: "Wangnan (F)" <wangnan0@huawei.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <pi3orama@163.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
Alexei Starovoitov <ast@kernel.org>, Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH 2/2] perf record: Add --dry-run option to check cmdline options
Date: Mon, 20 Jun 2016 11:29:13 +0800 [thread overview]
Message-ID: <57676309.8000907@huawei.com> (raw)
In-Reply-To: <20160616164815.GE13337@kernel.org>
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.
> That if called as:
>
> perf bcc foo.c
>
> Would default to generating a foo.o file.
>
> Then, later, one could use this as a event name, i.e.
>
> trace --event foo
>
> Would, knowing that there is no event named "foo", look at the current
> directory (and in some other places perhaps) for a file named "foo" that
> was a bpf object file to use as it would a foo.c, shortcircuiting the
> bpf compilation code.
> If this was done instead:
>
> trace --event foo.c
>
> And foo.c wasn't present, it would fallback to the behaviour described
> in the previous paragraph: look for a foo.o or foo bpf object file, etc.
>
> What do you think?
I'm not sure how many people can be benified from this feature. The only
advantage I can understand is we can skip the '.c', '.o' or '.bpf' suffix.
I guess what you really want is introducing something like buildid-cache for
BPF object. One can compile his/her BPF scriptlets into .o using 'perf
bcc' and
insert it into cache, then he/her can use the resuling object without
remembering
the path of it.
About fallback, if user explicitly uses '.o' or '.bpf' as suffix our
parser can
be easier. Technically we need a boundary to split event name and
configuration.
'.c', '.o' and '.bpf' are boundaries. In addition, is there any
difference between
'-e mybpf' and '-e mybpf.bpf'? We can define that, when using '-e mybpf'
the search path whould be the BPF object cache, when using '-e
mybpf.bpf' the
search path is current directory. It is acceptable, but why not make '-e
mybpf.bpf'
search BPF object cache also?
Thank you.
next prev parent reply other threads:[~2016-06-20 3:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 8:02 [PATCH 0/2] perf bpf: Add helper to support generate BPF object Wang Nan
2016-06-16 8:02 ` [PATCH 1/2] perf llvm: Allow dump llvm output object file using llvm.dump-obj Wang Nan
2016-06-22 7:42 ` [tip:perf/core] " tip-bot for Wang Nan
2016-06-16 8:02 ` [PATCH 2/2] perf record: Add --dry-run option to check cmdline options Wang Nan
2016-06-16 16:48 ` Arnaldo Carvalho de Melo
2016-06-16 16:50 ` Arnaldo Carvalho de Melo
2016-06-20 3:29 ` Wangnan (F) [this message]
2016-06-20 14:38 ` Arnaldo Carvalho de Melo
2016-06-20 16:22 ` Alexei Starovoitov
2016-06-20 18:13 ` Arnaldo Carvalho de Melo
2016-06-20 18:16 ` David Ahern
2016-06-20 18:52 ` Arnaldo Carvalho de Melo
2016-06-21 2:02 ` Namhyung Kim
2016-06-21 2:49 ` David Ahern
2016-06-21 6:12 ` Wangnan (F)
2016-06-21 16:11 ` perf cc/perf bpf was: " Arnaldo Carvalho de Melo
2016-06-21 1:57 ` Wangnan (F)
2016-06-22 7:43 ` [tip:perf/core] " tip-bot for Wang Nan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57676309.8000907@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=ast@kernel.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pi3orama@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).