tools/unittests/test_cmatch.py
Source file repositories/reference/linux-study-clean/tools/unittests/test_cmatch.py
File Facts
- System
- Linux kernel
- Corpus path
tools/unittests/test_cmatch.py- Extension
.py- Size
- 28294 bytes
- Lines
- 823
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
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 tx_pkt_infostruct tx_pkt_infostruct cxl_mbox_get_sup_feats_outstruct cxl_mbox_get_sup_feats_outstruct cxl_regsstruct cxl_regsstruct cxl_component_regsstruct cxl_device_regsstruct cxl_pmu_regsstruct cxl_rch_regsstruct cxl_rcd_regsstruct page_pool_paramsstruct page_pool_paramsstruct page_pool_params_slowstruct page_pool_params_faststruct kcovstruct kcovstruct kcovfunction test_strip_multiple_acquires
Annotated Snippet
struct tx_pkt_info {
struct_group(tx_overhead,
struct tx_sop_header sop;
struct tx_segment_header seg;
);
struct tx_eop_header eop;
u16 pkt_len;
u16 seq_num;
};
"""
expected = """
struct tx_pkt_info {
struct tx_sop_header sop;
struct tx_segment_header seg;
struct tx_eop_header eop;
u16 pkt_len;
u16 seq_num;
};
"""
result = self.apply_transforms("struct", line)
self.assertLogicallyEqual(result, expected)
def test_struct_group_attr(self):
"""
Test two struct_group_attr using patterns from fs/smb/client/cifspdu.h.
"""
line = """
typedef struct smb_com_open_rsp {
struct smb_hdr hdr; /* wct = 34 BB */
__u8 AndXCommand;
__u8 AndXReserved;
__le16 AndXOffset;
__u8 OplockLevel;
__u16 Fid;
__le32 CreateAction;
struct_group_attr(common_attributes,,
__le64 CreationTime;
__le64 LastAccessTime;
__le64 LastWriteTime;
__le64 ChangeTime;
__le32 FileAttributes;
);
__le64 AllocationSize;
__le64 EndOfFile;
__le16 FileType;
__le16 DeviceState;
__u8 DirectoryFlag;
__u16 ByteCount; /* bct = 0 */
} OPEN_RSP;
typedef struct {
struct_group_attr(common_attributes,,
__le64 CreationTime;
__le64 LastAccessTime;
__le64 LastWriteTime;
__le64 ChangeTime;
__le32 Attributes;
);
__u32 Pad1;
__le64 AllocationSize;
__le64 EndOfFile;
__le32 NumberOfLinks;
__u8 DeletePending;
__u8 Directory;
__u16 Pad2;
__le32 EASize;
__le32 FileNameLength;
union {
char __pad;
DECLARE_FLEX_ARRAY(char, FileName);
Annotation
- Detected declarations: `struct tx_pkt_info`, `struct tx_pkt_info`, `struct cxl_mbox_get_sup_feats_out`, `struct cxl_mbox_get_sup_feats_out`, `struct cxl_regs`, `struct cxl_regs`, `struct cxl_component_regs`, `struct cxl_device_regs`, `struct cxl_pmu_regs`, `struct cxl_rch_regs`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
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.