arch/s390/pci/pci_debug.c
Source file repositories/reference/linux-study-clean/arch/s390/pci/pci_debug.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/pci/pci_debug.c- Extension
.c- Size
- 5024 bytes
- Lines
- 222
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/seq_file.hlinux/debugfs.hlinux/export.hlinux/pci.hasm/debug.hasm/pci_dma.h
Detected Declarations
function pci_fmb_showfunction pci_sw_counter_showfunction pci_perf_showfunction pci_perf_seq_writefunction pci_perf_seq_openfunction zpci_debug_init_devicefunction zpci_debug_exit_devicefunction zpci_debug_initfunction zpci_debug_exitexport pci_debug_msg_idexport pci_debug_err_id
Annotated Snippet
static const struct file_operations debugfs_pci_perf_fops = {
.open = pci_perf_seq_open,
.read = seq_read,
.write = pci_perf_seq_write,
.llseek = seq_lseek,
.release = single_release,
};
void zpci_debug_init_device(struct zpci_dev *zdev, const char *name)
{
zdev->debugfs_dev = debugfs_create_dir(name, debugfs_root);
debugfs_create_file("statistics", S_IFREG | S_IRUGO | S_IWUSR,
zdev->debugfs_dev, zdev, &debugfs_pci_perf_fops);
}
void zpci_debug_exit_device(struct zpci_dev *zdev)
{
debugfs_remove_recursive(zdev->debugfs_dev);
}
int __init zpci_debug_init(void)
{
/* event trace buffer */
pci_debug_msg_id = debug_register("pci_msg", 8, 1, 8 * sizeof(long));
if (!pci_debug_msg_id)
return -EINVAL;
debug_register_view(pci_debug_msg_id, &debug_sprintf_view);
debug_set_level(pci_debug_msg_id, 3);
/* error log */
pci_debug_err_id = debug_register("pci_error", 2, 1, 16);
if (!pci_debug_err_id)
return -EINVAL;
debug_register_view(pci_debug_err_id, &debug_hex_ascii_view);
debug_set_level(pci_debug_err_id, 3);
debugfs_root = debugfs_create_dir("pci", NULL);
return 0;
}
void zpci_debug_exit(void)
{
debug_unregister(pci_debug_msg_id);
debug_unregister(pci_debug_err_id);
debugfs_remove(debugfs_root);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/seq_file.h`, `linux/debugfs.h`, `linux/export.h`, `linux/pci.h`, `asm/debug.h`, `asm/pci_dma.h`.
- Detected declarations: `function pci_fmb_show`, `function pci_sw_counter_show`, `function pci_perf_show`, `function pci_perf_seq_write`, `function pci_perf_seq_open`, `function zpci_debug_init_device`, `function zpci_debug_exit_device`, `function zpci_debug_init`, `function zpci_debug_exit`, `export pci_debug_msg_id`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.