linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Wangnan (F)" <wangnan0@huawei.com>
To: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	<linux-kernel@vger.kernel.org>, <pi3orama@163.com>,
	David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@gmail.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: Tue, 21 Jun 2016 09:57:52 +0800	[thread overview]
Message-ID: <57689F20.9060409@huawei.com> (raw)
In-Reply-To: <20160620143818.GA3050@redhat.com>



On 2016/6/20 22:38, 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:

[SNIP]

>> 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?
> Well there is a namespace issue here, if we say:
>
> 	perf record -e cycles
>
> then this is well known, we want PERF_TYPE_HARDWARE,
> PERF_COUNT_HW_CPU_CYCLES. If we instead use:
>
> 	perf record -e cycles.c
>
> Then this also is well known, we need to build this somehow, and right
> now the only way to do this is to use the llvm/clang infrastructure and
> then load it into the kernel via sys_bpf.
>
> If we say:
>
> 	perf record -e cycles.bpf
>
> Then we don't have anything associated with this and may go on trying to
> map it to a PERF_TYPE_HARDWARE, PERF_TYPE_SOFTWARE, etc till we find a
> suitable event, i.e. if it doesn't match anything, we would end up
> looking at a file in the current directory, figure out it is an ELF file
> and that its contents are a BPF proggie, that we would load via sys_bpf,
> etc.

cycles.bpf is not a good example. See tools/perf/util/parse-events.l:
   ...
   bpf_object      .*\.(o|bpf)
   ...

currently '.o' equals to '.bpf'.

Thank you.

  parent reply	other threads:[~2016-06-21  1:58 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)
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) [this message]
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=57689F20.9060409@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ast@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --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).