tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/verifier_global_subprogs.c- Extension
.c- Size
- 10401 bytes
- Lines
- 522
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmlinux.hbpf/bpf_helpers.hbpf/bpf_tracing.hbpf_misc.hxdp_metadata.hbpf_kfuncs.herr.h
Detected Declarations
struct whateverfunction global_badfunction global_goodfunction global_calls_badfunction global_calls_good_onlyfunction global_deadfunction __log_levelfunction __log_levelfunction global_unsuppfunction guarded_unsupp_global_calledfunction __log_levelfunction subprog_nullable_ptr_badfunction __log_levelfunction subprog_user_anon_memfunction __log_levelfunction __log_levelfunction subprog_user_anon_mem_hugefunction __log_levelfunction subprog_nonnull_ptr_goodfunction __log_levelfunction subprog_ctx_tagfunction raw_tp_canonicalfunction raw_tp_u64_arrayfunction __log_levelfunction __log_levelfunction __log_levelfunction tp_whateverfunction __log_levelfunction kprobe_subprog_pt_regsfunction kprobe_subprog_typedeffunction __log_levelfunction perf_subprog_regsfunction perf_subprog_typedeffunction perf_subprog_canonicalfunction __log_levelfunction iter_subprog_voidfunction iter_subprog_typedfunction __log_levelfunction tracing_subprog_voidfunction tracing_subprog_u64function __log_levelfunction __log_levelfunction __log_levelfunction __log_levelfunction __log_levelfunction __log_levelfunction syscall_array_bpf_forfunction __log_level
Annotated Snippet
struct whatever { };
__weak int tp_whatever(struct whatever *ctx __arg_ctx)
{
return 0;
}
SEC("?tp")
__success __log_level(2)
int arg_tag_ctx_tp(void *ctx)
{
return subprog_ctx_tag(ctx) + tp_whatever(ctx);
}
__weak int kprobe_subprog_pt_regs(struct pt_regs *ctx __arg_ctx)
{
return 0;
}
__weak int kprobe_subprog_typedef(bpf_user_pt_regs_t *ctx __arg_ctx)
{
return 0;
}
SEC("?kprobe")
__success __log_level(2)
int arg_tag_ctx_kprobe(void *ctx)
{
return subprog_ctx_tag(ctx) +
kprobe_subprog_pt_regs(ctx) +
kprobe_subprog_typedef(ctx);
}
__weak int perf_subprog_regs(
#if defined(bpf_target_riscv)
struct user_regs_struct *ctx __arg_ctx
#elif defined(bpf_target_s390)
/* user_pt_regs typedef is anonymous struct, so only `void *` works */
void *ctx __arg_ctx
#elif defined(bpf_target_loongarch) || defined(bpf_target_arm64) || defined(bpf_target_powerpc)
struct user_pt_regs *ctx __arg_ctx
#else
struct pt_regs *ctx __arg_ctx
#endif
)
{
return 0;
}
__weak int perf_subprog_typedef(bpf_user_pt_regs_t *ctx __arg_ctx)
{
return 0;
}
__weak int perf_subprog_canonical(struct bpf_perf_event_data *ctx __arg_ctx)
{
return 0;
}
SEC("?perf_event")
__success __log_level(2)
int arg_tag_ctx_perf(void *ctx)
{
return subprog_ctx_tag(ctx) +
perf_subprog_regs(ctx) +
perf_subprog_typedef(ctx) +
perf_subprog_canonical(ctx);
}
__weak int iter_subprog_void(void *ctx __arg_ctx)
{
return 0;
}
__weak int iter_subprog_typed(struct bpf_iter__task *ctx __arg_ctx)
{
return 0;
}
SEC("?iter/task")
__success __log_level(2)
int arg_tag_ctx_iter_task(struct bpf_iter__task *ctx)
{
return (iter_subprog_void(ctx) + iter_subprog_typed(ctx)) & 1;
}
__weak int tracing_subprog_void(void *ctx __arg_ctx)
{
return 0;
}
Annotation
- Immediate include surface: `vmlinux.h`, `bpf/bpf_helpers.h`, `bpf/bpf_tracing.h`, `bpf_misc.h`, `xdp_metadata.h`, `bpf_kfuncs.h`, `err.h`.
- Detected declarations: `struct whatever`, `function global_bad`, `function global_good`, `function global_calls_bad`, `function global_calls_good_only`, `function global_dead`, `function __log_level`, `function __log_level`, `function global_unsupp`, `function guarded_unsupp_global_called`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.