tools/testing/selftests/bpf/progs/tracing_struct.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/tracing_struct.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/tracing_struct.c- Extension
.c- Size
- 3466 bytes
- Lines
- 167
- 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_tracing.hbpf/bpf_helpers.h
Detected Declarations
struct bpf_testmod_struct_arg_1struct bpf_testmod_struct_arg_2struct bpf_testmod_struct_arg_3function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2function BPF_PROG2
Annotated Snippet
struct bpf_testmod_struct_arg_1 {
int a;
};
struct bpf_testmod_struct_arg_2 {
long a;
long b;
};
struct bpf_testmod_struct_arg_3 {
int a;
int b[];
};
union bpf_testmod_union_arg_1 {
char a;
short b;
struct bpf_testmod_struct_arg_1 arg;
};
union bpf_testmod_union_arg_2 {
int a;
long b;
struct bpf_testmod_struct_arg_2 arg;
};
long t1_a_a, t1_a_b, t1_b, t1_c, t1_ret, t1_nregs;
__u64 t1_reg0, t1_reg1, t1_reg2, t1_reg3;
long t2_a, t2_b_a, t2_b_b, t2_c, t2_ret;
long t3_a, t3_b, t3_c_a, t3_c_b, t3_ret;
long t4_a_a, t4_b, t4_c, t4_d, t4_e_a, t4_e_b, t4_ret;
long t5_ret;
int t6;
long ut1_a_a, ut1_b, ut1_c;
long ut2_a, ut2_b_a, ut2_b_b;
SEC("fentry/bpf_testmod_test_struct_arg_1")
int BPF_PROG2(test_struct_arg_1, struct bpf_testmod_struct_arg_2, a, int, b, int, c)
{
t1_a_a = a.a;
t1_a_b = a.b;
t1_b = b;
t1_c = c;
return 0;
}
SEC("fexit/bpf_testmod_test_struct_arg_1")
int BPF_PROG2(test_struct_arg_2, struct bpf_testmod_struct_arg_2, a, int, b, int, c, int, ret)
{
t1_nregs = bpf_get_func_arg_cnt(ctx);
/* a.a */
bpf_get_func_arg(ctx, 0, &t1_reg0);
/* a.b */
bpf_get_func_arg(ctx, 1, &t1_reg1);
/* b */
bpf_get_func_arg(ctx, 2, &t1_reg2);
t1_reg2 = (int)t1_reg2;
/* c */
bpf_get_func_arg(ctx, 3, &t1_reg3);
t1_reg3 = (int)t1_reg3;
t1_ret = ret;
return 0;
}
SEC("fentry/bpf_testmod_test_struct_arg_2")
int BPF_PROG2(test_struct_arg_3, int, a, struct bpf_testmod_struct_arg_2, b, int, c)
{
t2_a = a;
t2_b_a = b.a;
t2_b_b = b.b;
t2_c = c;
return 0;
}
SEC("fexit/bpf_testmod_test_struct_arg_2")
int BPF_PROG2(test_struct_arg_4, int, a, struct bpf_testmod_struct_arg_2, b, int, c, int, ret)
{
t2_ret = ret;
return 0;
}
SEC("fentry/bpf_testmod_test_struct_arg_3")
int BPF_PROG2(test_struct_arg_5, int, a, int, b, struct bpf_testmod_struct_arg_2, c)
{
t3_a = a;
t3_b = b;
t3_c_a = c.a;
t3_c_b = c.b;
return 0;
Annotation
- Immediate include surface: `vmlinux.h`, `bpf/bpf_tracing.h`, `bpf/bpf_helpers.h`.
- Detected declarations: `struct bpf_testmod_struct_arg_1`, `struct bpf_testmod_struct_arg_2`, `struct bpf_testmod_struct_arg_3`, `function BPF_PROG2`, `function BPF_PROG2`, `function BPF_PROG2`, `function BPF_PROG2`, `function BPF_PROG2`, `function BPF_PROG2`, `function BPF_PROG2`.
- 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.