diff options
author | 2024-09-16 02:17:09 -0700 | |
---|---|---|
committer | 2024-10-03 17:47:53 -0700 | |
commit | 48b13cab1e7cb77def27cb89711fb5e3b04db972 (patch) | |
tree | 0238a2ac2f6849e78399b96773776d8846a87391 /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | Merge branch 'libbpf-selftests-bpf-support-cross-endian-usage' (diff) | |
download | wireguard-linux-48b13cab1e7cb77def27cb89711fb5e3b04db972.tar.xz wireguard-linux-48b13cab1e7cb77def27cb89711fb5e3b04db972.zip |
bpf: Allow specifying bpf_fastcall attribute for BPF helpers
Allow a new optional 'Attributes' section to be specified for helper
functions description, e.g.:
* u32 bpf_get_smp_processor_id(void)
* ...
* Return
* ...
* Attributes
* __bpf_fastcall
*
Generated header for the example above:
#ifndef __bpf_fastcall
#if __has_attribute(__bpf_fastcall)
#define __bpf_fastcall __attribute__((bpf_fastcall))
#else
#define __bpf_fastcall
#endif
#endif
...
__bpf_fastcall
static __u32 (* const bpf_get_smp_processor_id)(void) = (void *) 8;
The following rules apply:
- when present, section must follow 'Return' section;
- attribute names are specified on the line following 'Attribute'
keyword;
- attribute names are separated by spaces;
- section ends with an "empty" line (" *\n").
Valid attribute names are recorded in the ATTRS map.
ATTRS maps shortcut attribute name to correct C syntax.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240916091712.2929279-2-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