linux-bl808/kernel/trace
Yonghong Song cf5f5cea27 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>
2017-08-07 14:09:48 -07:00
..
blktrace.c
bpf_trace.c bpf: extend bpf_trace_printk to support %i 2017-07-03 02:22:52 -07:00
ftrace.c trace: fix the errors caused by incompatible type of RCU variables 2017-07-20 09:27:29 -04:00
Kconfig tracing: Rename update the enum_map file 2017-06-13 17:13:06 -04:00
Makefile
power-traces.c
ring_buffer.c tracing/ring_buffer: Try harder to allocate 2017-07-19 08:22:12 -04:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Fix kmemleak in instance_rmdir 2017-07-20 09:24:25 -04:00
trace.h trace: fix the errors caused by incompatible type of RCU variables 2017-07-20 09:27:29 -04:00
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_entries.h
trace_event_perf.c
trace_events.c tracing: Add support for recording tgid of tasks 2017-06-27 13:30:28 -04:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c
trace_events_trigger.c
trace_export.c
trace_functions.c ftrace: Fix regression with module command in stack_trace_filter 2017-06-29 10:05:45 -04:00
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c A few more minor updates: 2017-07-13 13:17:19 -07:00
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Add support for display of tgid in trace output 2017-06-27 13:30:28 -04:00
trace_output.h
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c tracing: Add support for recording tgid of tasks 2017-06-27 13:30:28 -04:00
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing: Do note expose stack_trace_filter without DYNAMIC_FTRACE 2017-07-11 19:21:04 -04:00
trace_stat.c
trace_stat.h
trace_syscalls.c bpf: add support for sys_enter_* and sys_exit_* tracepoints 2017-08-07 14:09:48 -07:00
trace_uprobe.c
tracing_map.c
tracing_map.h