Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1368517 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-03-31 20:10 +0200 |
| Last post | 2016-04-01 16:00 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
perf trace + BPF Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-31 20:10 +0200
Re: perf trace + BPF "Wangnan (F)" <wangnan0@huawei.com> - 2016-04-01 15:40 +0200
Re: perf trace + BPF Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-01 16:00 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-03-31 20:10 +0200 |
| Subject | perf trace + BPF |
| Message-ID | <riPcD-uz-21@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | "Wangnan (F)" <wangnan0@huawei.com> |
|---|---|
| Date | 2016-04-01 15:40 +0200 |
| Message-ID | <rj7sS-4YN-21@gated-at.bofh.it> |
| In reply to | #1368517 |
On 2016/4/1 2:08, Arnaldo Carvalho de Melo wrote:
> 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...
Please see [1]. Not related to no-inherit, just because the bpf-output event
is not a tracepoint.
And glad to see you restart working on my patches again!
Thank you.
[1]
http://lkml.kernel.org/g/1459517202-42320-1-git-send-email-wangnan0@huawei.com
> - Arnaldo
>
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-01 16:00 +0200 |
| Message-ID | <rj7Md-56S-1@gated-at.bofh.it> |
| In reply to | #1369327 |
Em Fri, Apr 01, 2016 at 09:29:52PM +0800, Wangnan (F) escreveu:
>
>
> On 2016/4/1 2:08, Arnaldo Carvalho de Melo wrote:
> >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...
>
> Please see [1]. Not related to no-inherit, just because the bpf-output event
> is not a tracepoint.
Right, that was a dead end of mine when investigating this, thanks for
fixing this up!
> And glad to see you restart working on my patches again!
Yeah, hopefully this time we'll get most of what is outstanding merged.
I want to at some time experiment with doing things 'perf trace' needs
with BPF, behind the scenes :-)
> Thank you.
>
> [1] http://lkml.kernel.org/g/1459517202-42320-1-git-send-email-wangnan0@huawei.com
>
>
>
> >- Arnaldo
> >
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web