From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: perf trace + BPF
Date: Thu, 31 Mar 2016 15:08:03 -0300 [thread overview]
Message-ID: <20160331180803.GB10112@kernel.org> (raw)
Hi Wang,
Trying to get back at working with 'perf trace' + BPF and I'm
noticing that the perf_event_attr->sample_type for the BPF events are
different than the ones for the raw_syscalls:sys_{enter,exit} or to
other tracepoint events we may ask 'perf trace' to set up, for instance,
for:
perf trace -vv -T --ev sched:sched_switch --ev bpf-output/no-inherit,name=evt/ --ev /home/acme/bpf/test_bpf_trace.c/map:channel.event=evt/ usleep 10
We get these sample types (full perf_event_attr dump at the end of this
message):
sched:sched_switch:
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
[root@jouet ~]# perf probe -l
perf_bpf_probe:func_begin (on SyS_nanosleep@linux/kernel/time/hrtimer.c)
perf_bpf_probe:func_end (on SyS_nanosleep%return@linux/kernel/time/hrtimer.c)
sample_type IP|TID|RAW|IDENTIFIER
raw_syscalls:sys_{enter,exit}:
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
I guess this is an interaction with that "no-inherit" part, probably we need to
set PERF_SAMPLE_TIME by some other means...
- Arnaldo
------------------------------------------------------------
perf_event_attr:
type 2
size 112
config 0x110
{ sample_period, sample_freq } 1
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
read_format ID
disabled 1
inherit 1
mmap 1
comm 1
enable_on_exec 1
task 1
sample_id_all 1
exclude_guest 1
mmap2 1
comm_exec 1
{ wakeup_events, wakeup_watermark } 1
------------------------------------------------------------
sys_perf_event_open: pid 32425 cpu 0 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 1 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 2 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 3 group_fd -1 flags 0x8
------------------------------------------------------------
perf_event_attr:
type 1
size 112
config 0xa
{ sample_period, sample_freq } 1
sample_type IP|TID|RAW|IDENTIFIER
read_format ID
disabled 1
enable_on_exec 1
sample_id_all 1
exclude_guest 1
{ wakeup_events, wakeup_watermark } 1
------------------------------------------------------------
sys_perf_event_open: pid 32425 cpu 0 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 1 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 2 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 3 group_fd -1 flags 0x8
------------------------------------------------------------
perf_event_attr:
type 2
size 112
config 0x7c5
{ sample_period, sample_freq } 1
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
read_format ID
disabled 1
inherit 1
enable_on_exec 1
sample_id_all 1
exclude_guest 1
{ wakeup_events, wakeup_watermark } 1
------------------------------------------------------------
sys_perf_event_open: pid 32425 cpu 0 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 1 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 2 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 3 group_fd -1 flags 0x8
------------------------------------------------------------
perf_event_attr:
type 2
size 112
config 0x7c4
{ sample_period, sample_freq } 1
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
read_format ID
disabled 1
inherit 1
enable_on_exec 1
sample_id_all 1
exclude_guest 1
{ wakeup_events, wakeup_watermark } 1
------------------------------------------------------------
sys_perf_event_open: pid 32425 cpu 0 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 1 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 2 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 3 group_fd -1 flags 0x8
------------------------------------------------------------
perf_event_attr:
type 2
size 112
config 0x11
{ sample_period, sample_freq } 1
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
read_format ID
disabled 1
inherit 1
enable_on_exec 1
sample_id_all 1
exclude_guest 1
{ wakeup_events, wakeup_watermark } 1
------------------------------------------------------------
sys_perf_event_open: pid 32425 cpu 0 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 1 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 2 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 3 group_fd -1 flags 0x8
------------------------------------------------------------
perf_event_attr:
type 2
size 112
config 0x10
{ sample_period, sample_freq } 1
sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER
read_format ID
disabled 1
inherit 1
enable_on_exec 1
sample_id_all 1
exclude_guest 1
{ wakeup_events, wakeup_watermark } 1
------------------------------------------------------------
sys_perf_event_open: pid 32425 cpu 0 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 1 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 2 group_fd -1 flags 0x8
sys_perf_event_open: pid 32425 cpu 3 group_fd -1 flags 0x8
mmap size 528384B
next reply other threads:[~2016-03-31 18:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 18:08 Arnaldo Carvalho de Melo [this message]
2016-04-01 13:29 ` perf trace + BPF Wangnan (F)
2016-04-01 13:50 ` Arnaldo Carvalho de Melo
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=20160331180803.GB10112@kernel.org \
--to=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.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