linux/kernel/trace
Lorenz Bauer 9436ef6e86 bpf: Allow specifying a BTF ID per argument in function protos
Function prototypes using ARG_PTR_TO_BTF_ID currently use two ways to signal
which BTF IDs are acceptable. First, bpf_func_proto.btf_id is an array of
IDs, one for each argument. This array is only accessed up to the highest
numbered argument that uses ARG_PTR_TO_BTF_ID and may therefore be less than
five arguments long. It usually points at a BTF_ID_LIST. Second, check_btf_id
is a function pointer that is called by the verifier if present. It gets the
actual BTF ID of the register, and the argument number we're currently checking.
It turns out that the only user check_arg_btf_id ignores the argument, and is
simply used to check whether the BTF ID has a struct sock_common at it's start.

Replace both of these mechanisms with an explicit BTF ID for each argument
in a function proto. Thanks to btf_struct_ids_match this is very flexible:
check_arg_btf_id can be replaced by requiring struct sock_common.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200921121227.255763-5-lmb@cloudflare.com
2020-09-21 15:00:40 -07:00
..
blktrace.c blktrace: Provide event for request merging 2020-06-25 21:06:11 -06:00
bpf_trace.c bpf: Allow specifying a BTF ID per argument in function protos 2020-09-21 15:00:40 -07:00
bpf_trace.h bpf: Use dedicated bpf_trace_printk event instead of trace_printk() 2020-07-13 16:55:49 -07:00
fgraph.c
ftrace.c Tracing updates for 5.9 2020-08-07 18:29:15 -07:00
ftrace_internal.h
Kconfig
kprobe_event_gen_test.c
Makefile Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
power-traces.c
preemptirq_delay_test.c
ring_buffer.c Tracing updates for 5.9 2020-08-07 18:29:15 -07:00
ring_buffer_benchmark.c sched,tracing: Convert to sched_set_fifo() 2020-07-29 11:43:53 +02:00
rpm-traces.c
synth_event_gen_test.c
trace.c Tracing updates for 5.9 2020-08-07 18:29:15 -07:00
trace.h ftrace: Fix ftrace_trace_task return value 2020-08-03 16:12:31 -04:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c tracing/boottime: Fix kprobe multiple events 2020-06-23 21:51:50 -04:00
trace_branch.c
trace_clock.c
trace_dynevent.c
trace_dynevent.h
trace_entries.h tracing: Make ftrace packed events have align of 1 2020-06-16 21:21:02 -04:00
trace_event_perf.c
trace_events.c tracing: Use trace_sched_process_free() instead of exit() for pid tracing 2020-08-04 20:15:07 -04:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c
trace_events_inject.c
trace_events_synth.c
trace_events_trigger.c tracing: Fix event trigger to accept redundant spaces 2020-06-23 21:51:40 -04:00
trace_export.c tracing: Make ftrace packed events have align of 1 2020-06-16 21:21:02 -04:00
trace_functions.c trace: Fix typo in allocate_ftrace_ops()'s comment 2020-06-16 21:21:02 -04:00
trace_functions_graph.c
trace_hwlat.c tracing/hwlat: Honor the tracing_cpumask 2020-07-30 19:35:04 -04:00
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault 2020-06-17 10:57:41 -07:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Save one trace_event->type by using __TRACE_LAST_TYPE 2020-07-09 18:14:58 -04:00
trace_output.h
trace_preemptirq.c x86/entry: Rename trace_hardirqs_off_prepare() 2020-06-11 15:15:24 +02:00
trace_printk.c
trace_probe.c tracing/probe: Fix memleak in fetch_op_data operations 2020-06-16 21:21:02 -04:00
trace_probe.h tracing/probe: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
trace_probe_tmpl.h
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_synth.h
trace_syscalls.c
trace_uprobe.c tracing/uprobe: Remove dead code in trace_uprobe_register() 2020-08-03 16:16:46 -04:00
tracing_map.c
tracing_map.h