tools/testing/selftests/bpf/progs/set_global_vars.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/set_global_vars.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/set_global_vars.c- Extension
.c- Size
- 2139 bytes
- Lines
- 107
- 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
bpf_experimental.hbpf/bpf_helpers.hbpf_misc.hstdbool.h
Detected Declarations
struct Structstruct Struct2struct Struct3enum Enumenum Enumu64enum Enums64function test_set_globals
Annotated Snippet
struct Struct {
int:16;
__u16 filler;
struct {
const __u16 filler2;
};
struct Struct2 {
__u16 filler;
volatile struct {
const int:1;
union {
const volatile u8 var_u8[3];
const volatile __s16 filler3;
const int:1;
s32 mat[7][5];
} u;
};
} struct2[2][4];
};
const volatile __u32 stru = 0; /* same prefix as below */
const volatile struct Struct struct1[3];
const volatile struct Struct struct11[11][7];
struct Struct3 {
struct {
u8 var_u8_l;
};
struct {
struct {
u8 var_u8_h;
};
};
};
typedef struct Struct3 Struct3_t;
union Union {
__u16 var_u16;
Struct3_t struct3;
};
const volatile union Union union1 = {.var_u16 = -1};
SEC("socket")
int test_set_globals(void *ctx)
{
volatile __s8 a;
a = var_s64;
a = var_u64;
a = var_s32;
a = var_u32;
a = var_s16;
a = var_u16;
a = var_s8;
a = var_u8;
a = var_ea;
a = var_eb;
a = var_ec;
a = var_b;
a = struct1[2].struct2[1][2].u.var_u8[2];
a = union1.var_u16;
a = arr[3];
a = arr[EA2];
a = enum_arr[EC2];
a = three_d[31][7][EA2];
a = struct1[2].struct2[1][2].u.mat[5][3];
a = struct11[7][5].struct2[0][1].u.mat[3][0];
return a;
}
Annotation
- Immediate include surface: `bpf_experimental.h`, `bpf/bpf_helpers.h`, `bpf_misc.h`, `stdbool.h`.
- Detected declarations: `struct Struct`, `struct Struct2`, `struct Struct3`, `enum Enum`, `enum Enumu64`, `enum Enums64`, `function test_set_globals`.
- 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.