tools/testing/selftests/bpf/progs/verifier_subprog_topo.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/verifier_subprog_topo.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/verifier_subprog_topo.c- Extension
.c- Size
- 3778 bytes
- Lines
- 227
- 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.
Dependency Surface
linux/bpf.hbpf/bpf_helpers.hbpf_misc.h
Detected Declarations
function linear_bfunction linear_afunction __log_levelfunction diamond_cfunction diamond_bfunction diamond_afunction __log_levelfunction static_leaffunction global_afunction __log_levelfunction shared_leaffunction global_bfunction __log_levelfunction dup_leaffunction __log_levelfunction loop_cbfunction __log_levelfunction loop_cb2_leaffunction loop_cb2function __log_levelfunction __log_level
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"
/* linear chain main -> A -> B */
__naked __noinline __used
static unsigned long linear_b(void)
{
asm volatile (
"r0 = 42;"
"exit;"
);
}
__naked __noinline __used
static unsigned long linear_a(void)
{
asm volatile (
"call linear_b;"
"exit;"
);
}
SEC("?raw_tp")
__success __log_level(2)
__msg("topo_order[0] = linear_b")
__msg("topo_order[1] = linear_a")
__msg("topo_order[2] = topo_linear")
__naked int topo_linear(void)
{
asm volatile (
"call linear_a;"
"exit;"
);
}
/* diamond main -> A, main -> B, A -> C, B -> C */
__naked __noinline __used
static unsigned long diamond_c(void)
{
asm volatile (
"r0 = 1;"
"exit;"
);
}
__naked __noinline __used
static unsigned long diamond_b(void)
{
asm volatile (
"call diamond_c;"
"exit;"
);
}
__naked __noinline __used
static unsigned long diamond_a(void)
{
asm volatile (
"call diamond_c;"
"exit;"
);
}
SEC("?raw_tp")
__success __log_level(2)
__msg("topo_order[0] = diamond_c")
__msg("topo_order[3] = topo_diamond")
__naked int topo_diamond(void)
{
asm volatile (
"call diamond_a;"
"call diamond_b;"
"exit;"
);
}
/* main -> global_a (global) -> static_leaf (static, leaf) */
__naked __noinline __used
static unsigned long static_leaf(void)
{
asm volatile (
"r0 = 7;"
"exit;"
);
}
Annotation
- Immediate include surface: `linux/bpf.h`, `bpf/bpf_helpers.h`, `bpf_misc.h`.
- Detected declarations: `function linear_b`, `function linear_a`, `function __log_level`, `function diamond_c`, `function diamond_b`, `function diamond_a`, `function __log_level`, `function static_leaf`, `function global_a`, `function __log_level`.
- 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.