linux/tools/include/uapi/linux
Jiri Olsa f92c1e1836 bpf: Add get_func_[arg|ret|arg_cnt] helpers
Adding following helpers for tracing programs:

Get n-th argument of the traced function:
  long bpf_get_func_arg(void *ctx, u32 n, u64 *value)

Get return value of the traced function:
  long bpf_get_func_ret(void *ctx, u64 *value)

Get arguments count of the traced function:
  long bpf_get_func_arg_cnt(void *ctx)

The trampoline now stores number of arguments on ctx-8
address, so it's easy to verify argument index and find
return value argument's position.

Moving function ip address on the trampoline stack behind
the number of functions arguments, so it's now stored on
ctx-16 address if it's needed.

All helpers above are inlined by verifier.

Also bit unrelated small change - using newly added function
bpf_prog_has_trampoline in check_get_func_ip.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211208193245.172141-5-jolsa@kernel.org
2021-12-13 09:25:59 -08:00
..
tc_act
bpf_common.h
bpf_perf_event.h tools, headers: Sync struct bpf_perf_event_data 2021-01-26 00:15:03 +01:00
bpf.h bpf: Add get_func_[arg|ret|arg_cnt] helpers 2021-12-13 09:25:59 -08:00
btf.h bpf: Support BTF_KIND_TYPE_TAG for btf_type_tag attributes 2021-11-11 17:41:11 -08:00
const.h tools headers UAPI: Sync linux/const.h with the kernel headers 2020-12-18 17:32:28 -03:00
erspan.h
ethtool.h tools: include: Add ethtool_drvinfo definition to UAPI header 2021-08-24 14:48:40 -07:00
fadvise.h
fcntl.h tools headers API: Update faccessat2 affected files 2020-06-09 12:40:03 -03:00
filter.h tools: bpf: Use local copy of headers including uapi/linux/filter.h 2020-07-21 10:50:35 +01:00
fs.h tools headers UAPI: Sync linux/fs.h with the kernel sources 2021-09-11 16:14:53 -03:00
fscrypt.h tools headers UAPI: Sync linux/fscrypt.h with the kernel sources 2020-12-18 17:32:28 -03:00
hw_breakpoint.h
if_link.h Bonding: add arp_missed_max option 2021-11-30 12:15:58 +00:00
if_tun.h
if_xdp.h xsk: Add new statistics 2020-07-13 15:32:56 -07:00
in.h tools headers UAPI: Sync linux/in.h copy with the kernel sources 2021-09-11 16:12:26 -03:00
kcmp.h
kvm.h tools headers UAPI: Sync linux/kvm.h with the kernel sources 2021-11-18 10:08:07 -03:00
lirc.h
mman.h tools UAPI: Update copy of linux/mman.h from the kernel sources 2020-11-03 08:36:51 -03:00
mount.h tools include UAPI: Update linux/mount.h copy 2021-09-10 18:15:22 -03:00
netlink.h
openat2.h tools headers UAPI: Sync openat2.h with the kernel sources 2021-03-06 16:54:22 -03:00
perf_event.h Merge remote-tracking branch 'torvalds/master' into perf/core 2021-11-06 15:49:33 -03:00
pkt_cls.h
pkt_sched.h sch_htb: Hierarchical QoS hardware offload 2021-01-22 20:41:29 -08:00
prctl.h tools headers UAPI: Sync linux/prctl.h with the kernel sources 2021-11-13 18:11:51 -03:00
sched.h tools headers UAPI: Sync sched.h with the kernel 2020-04-14 09:01:08 -03:00
seg6_local.h
seg6.h
stat.h tools headers UAPI: Sync linux/stat.h with the kernel sources 2020-12-17 14:40:24 -03:00
tcp.h bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE 2021-01-20 14:23:00 -08:00
tls.h
types.h
usbdevice_fs.h
vhost.h tools kvm headers: Update KVM headers from the kernel sources 2020-11-03 08:46:30 -03:00