diff options
author | 2024-09-16 02:17:12 -0700 | |
---|---|---|
committer | 2024-10-03 17:47:53 -0700 | |
commit | bf7ce5416f68db058ac7105902adf497b3ce4e8c (patch) | |
tree | fe1bf335efa81c24a602a58f3d9acc44541056d5 /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | bpf: Use KF_FASTCALL to mark kfuncs supporting fastcall contract (diff) | |
download | wireguard-linux-bf7ce5416f68db058ac7105902adf497b3ce4e8c.tar.xz wireguard-linux-bf7ce5416f68db058ac7105902adf497b3ce4e8c.zip |
bpftool: __bpf_fastcall for kfuncs marked with special decl_tag
Generate __attribute__((bpf_fastcall)) for kfuncs marked with
"bpf_fastcall" decl tag. E.g. for the following BTF:
$ bpftool btf dump file vmlinux
...
[A] FUNC 'bpf_rdonly_cast' type_id=...
...
[B] DECL_TAG 'bpf_kfunc' type_id=A component_idx=-1
[C] DECL_TAG 'bpf_fastcall' type_id=A component_idx=-1
Generate the following vmlinux.h:
#ifndef __VMLINUX_H__
#define __VMLINUX_H__
...
#ifndef __bpf_fastcall
#if __has_attribute(bpf_fastcall)
#define __bpf_fastcall __attribute__((bpf_fastcall))
#else
#define __bpf_fastcall
#endif
#endif
...
__bpf_fastcall extern void *bpf_rdonly_cast(...) ...;
The "bpf_fastcall" / "bpf_kfunc" tags pair would generated by pahole
when constructing vmlinux BTF.
While at it, sort printed kfuncs by name for better vmlinux.h
stability.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240916091712.2929279-5-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions