alistair23-linux/kernel/trace
Daniel Borkmann f3694e0012 bpf: add BPF_CALL_x macros for declaring helpers
This work adds BPF_CALL_<n>() macros and converts all the eBPF helper functions
to use them, in a similar fashion like we do with SYSCALL_DEFINE<n>() macros
that are used today. Motivation for this is to hide all the register handling
and all necessary casts from the user, so that it is done automatically in the
background when adding a BPF_CALL_<n>() call.

This makes current helpers easier to review, eases to write future helpers,
avoids getting the casting mess wrong, and allows for extending all helpers at
once (f.e. build time checks, etc). It also helps detecting more easily in
code reviews that unused registers are not instrumented in the code by accident,
breaking compatibility with existing programs.

BPF_CALL_<n>() internals are quite similar to SYSCALL_DEFINE<n>() ones with some
fundamental differences, for example, for generating the actual helper function
that carries all u64 regs, we need to fill unused regs, so that we always end up
with 5 u64 regs as an argument.

I reviewed several 0-5 generated BPF_CALL_<n>() variants of the .i results and
they look all as expected. No sparse issue spotted. We let this also sit for a
few days with Fengguang's kbuild test robot, and there were no issues seen. On
s390, it barked on the "uses dynamic stack allocation" notice, which is an old
one from bpf_perf_event_output{,_tp}() reappearing here due to the conversion
to the call wrapper, just telling that the perf raw record/frag sits on stack
(gcc with s390's -mwarn-dynamicstack), but that's all. Did various runtime tests
and they were fine as well. All eBPF helpers are now converted to use these
macros, getting rid of a good chunk of all the raw castings.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-09 19:36:04 -07:00
..
blktrace.c block: Fix secure erase 2016-08-16 09:16:51 -06:00
bpf_trace.c bpf: add BPF_CALL_x macros for declaring helpers 2016-09-09 19:36:04 -07:00
ftrace.c ftrace: Move toplevel init out of ftrace_init_tracefs() 2016-07-05 10:47:03 -04:00
Kconfig tracing: Have HIST_TRIGGERS select TRACING 2016-07-05 15:49:01 -04:00
Makefile Makefile: Mute warning for __builtin_return_address(>0) for tracing only 2016-08-02 12:57:48 -04:00
power-traces.c
ring_buffer.c
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Using for_each_set_bit() to simplify trace_pid_write() 2016-07-05 11:22:40 -04:00
trace.h ftrace: Reduce size of function graph entries 2016-07-05 17:28:30 -04:00
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_entries.h ftrace: Reduce size of function graph entries 2016-07-05 17:28:30 -04:00
trace_event_perf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-05-17 16:26:30 -07:00
trace_events.c tracing: Show the preempt count of when the event was called 2016-06-20 09:54:21 -04:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c tracing: Fix use-after-free in hist_register_trigger() 2016-08-02 15:16:30 -04:00
trace_events_trigger.c
trace_export.c
trace_functions.c ftrace: Have set_ftrace_pid use the bitmap like events do 2016-06-20 09:54:19 -04:00
trace_functions_graph.c tracing/function_graph: Fix filters for function_graph threshold 2016-06-27 13:29:24 -04:00
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing: expose current->comm to [ku]probe events 2016-06-20 09:54:19 -04:00
trace_mmiotrace.c tracing: Expose CPU physical addresses (resource values) for PCI devices 2016-06-20 09:54:22 -04:00
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c tracing: Handle NULL formats in hold_module_trace_bprintk_format() 2016-06-20 09:46:12 -04:00
trace_probe.c tracing: expose current->comm to [ku]probe events 2016-06-20 09:54:19 -04:00
trace_probe.h tracing: expose current->comm to [ku]probe events 2016-06-20 09:54:19 -04:00
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c
tracing_map.c
tracing_map.h