diff options
author | Yonghong Song <yhs@fb.com> | 2017-08-04 16:00:09 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-07 14:09:48 -0700 |
commit | cf5f5cea270655dd49370760576c64b228583b79 (patch) | |
tree | 5758e9d56b94542d082d40ed66f8d8effa6287f9 /crypto/twofish_common.c | |
parent | d226a2b84d0528da7e35e7e19e052293889cdd21 (diff) | |
download | linux-stable-cf5f5cea270655dd49370760576c64b228583b79.tar.gz linux-stable-cf5f5cea270655dd49370760576c64b228583b79.tar.bz2 linux-stable-cf5f5cea270655dd49370760576c64b228583b79.zip |
bpf: add support for sys_enter_* and sys_exit_* tracepoints
Currently, bpf programs cannot be attached to sys_enter_* and sys_exit_*
style tracepoints. The iovisor/bcc issue #748
(https://github.com/iovisor/bcc/issues/748) documents this issue.
For example, if you try to attach a bpf program to tracepoints
syscalls/sys_enter_newfstat, you will get the following error:
# ./tools/trace.py t:syscalls:sys_enter_newfstat
Ioctl(PERF_EVENT_IOC_SET_BPF): Invalid argument
Failed to attach BPF to tracepoint
The main reason is that syscalls/sys_enter_* and syscalls/sys_exit_*
tracepoints are treated differently from other tracepoints and there
is no bpf hook to it.
This patch adds bpf support for these syscalls tracepoints by
. permitting bpf attachment in ioctl PERF_EVENT_IOC_SET_BPF
. calling bpf programs in perf_syscall_enter and perf_syscall_exit
The legality of bpf program ctx access is also checked.
Function trace_event_get_offsets returns correct max offset for each
specific syscall tracepoint, which is compared against the maximum offset
access in bpf program.
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/twofish_common.c')
0 files changed, 0 insertions, 0 deletions