tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c- Extension
.c- Size
- 3789 bytes
- Lines
- 250
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct padded_implicitlystruct padded_explicitlystruct padded_a_lotstruct padded_cache_linestruct zone_paddingstruct zonestruct padding_wo_named_membersstruct padding_weird_1struct padding_weird_2struct exact_1bytestruct padded_1bytestruct exact_2bytesstruct padded_2bytesstruct exact_4bytesstruct padded_4bytesstruct exact_8bytesstruct padded_8bytesstruct ff_periodic_effectstruct ib_wcstruct acpi_object_methodstruct nested_unpackedstruct nested_packedstruct outer_mixed_but_unpacked
Annotated Snippet
struct padded_implicitly {
int a;
long b;
char c;
};
/* ------ END-EXPECTED-OUTPUT ------ */
/* ----- START-EXPECTED-OUTPUT ----- */
/*
*struct padded_explicitly {
* int a;
* long: 0;
* int b;
*};
*
*/
/* ------ END-EXPECTED-OUTPUT ------ */
struct padded_explicitly {
int a;
int: 1; /* algo will emit aligning `long: 0;` here */
int b;
};
/* ----- START-EXPECTED-OUTPUT ----- */
struct padded_a_lot {
int a;
long: 64;
long: 64;
int b;
};
/* ------ END-EXPECTED-OUTPUT ------ */
/* ----- START-EXPECTED-OUTPUT ----- */
/*
*struct padded_cache_line {
* int a;
* long: 64;
* long: 64;
* long: 64;
* int b;
* long: 64;
* long: 64;
* long: 64;
*};
*
*/
/* ------ END-EXPECTED-OUTPUT ------ */
struct padded_cache_line {
int a;
int b __attribute__((aligned(32)));
};
/* ----- START-EXPECTED-OUTPUT ----- */
/*
*struct zone_padding {
* char x[0];
*};
*
*struct zone {
* int a;
* short b;
* long: 0;
* struct zone_padding __pad__;
*};
*
*/
/* ------ END-EXPECTED-OUTPUT ------ */
struct zone_padding {
char x[0];
} __attribute__((__aligned__(8)));
struct zone {
int a;
short b;
struct zone_padding __pad__;
};
/* ----- START-EXPECTED-OUTPUT ----- */
struct padding_wo_named_members {
long: 64;
long: 64;
};
struct padding_weird_1 {
int a;
Annotation
- Detected declarations: `struct padded_implicitly`, `struct padded_explicitly`, `struct padded_a_lot`, `struct padded_cache_line`, `struct zone_padding`, `struct zone`, `struct padding_wo_named_members`, `struct padding_weird_1`, `struct padding_weird_2`, `struct exact_1byte`.
- 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.