Skip to content

Commit aae9c25

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
libbpf: add __arg_xxx macros for annotating global func args
Add a set of __arg_xxx macros which can be used to augment BPF global subprogs/functions with extra information for use by BPF verifier. Acked-by: Eduard Zingerman <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent a64bfe6 commit aae9c25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/lib/bpf/bpf_helpers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ enum libbpf_tristate {
188188
!!sym; \
189189
})
190190

191+
#define __arg_ctx __attribute__((btf_decl_tag("arg:ctx")))
192+
#define __arg_nonnull __attribute((btf_decl_tag("arg:nonnull")))
193+
191194
#ifndef ___bpf_concat
192195
#define ___bpf_concat(a, b) a ## b
193196
#endif

0 commit comments

Comments
 (0)