drivers/s390/cio/qdio_debug.c
Source file repositories/reference/linux-study-clean/drivers/s390/cio/qdio_debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/cio/qdio_debug.c- Extension
.c- Size
- 8460 bytes
- Lines
- 339
- Domain
- Driver Families
- Bucket
- drivers/s390
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/seq_file.hlinux/debugfs.hlinux/uaccess.hlinux/slab.hasm/debug.hqdio_debug.hqdio.h
Detected Declarations
struct qdio_dbf_entryfunction qdio_clear_dbf_listfunction qdio_allocate_dbffunction qstat_showfunction ssqd_showfunction qperf_showfunction qperf_seq_writefunction qperf_seq_openfunction setup_debugfs_entryfunction qdio_setup_debug_entriesfunction qdio_shutdown_debug_entriesfunction qdio_debug_initfunction qdio_debug_exit
Annotated Snippet
static const struct file_operations debugfs_perf_fops = {
.owner = THIS_MODULE,
.open = qperf_seq_open,
.read = seq_read,
.write = qperf_seq_write,
.llseek = seq_lseek,
.release = single_release,
};
static void setup_debugfs_entry(struct dentry *parent, struct qdio_q *q)
{
char name[QDIO_DEBUGFS_NAME_LEN];
snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%d",
q->is_input_q ? "input" : "output",
q->nr);
debugfs_create_file(name, 0444, parent, q, &qstat_fops);
}
void qdio_setup_debug_entries(struct qdio_irq *irq_ptr)
{
struct qdio_q *q;
int i;
irq_ptr->debugfs_dev = debugfs_create_dir(dev_name(&irq_ptr->cdev->dev),
debugfs_root);
debugfs_create_file("statistics", S_IFREG | S_IRUGO | S_IWUSR,
irq_ptr->debugfs_dev, irq_ptr, &debugfs_perf_fops);
debugfs_create_file("ssqd", 0444, irq_ptr->debugfs_dev, irq_ptr->cdev,
&ssqd_fops);
for_each_input_queue(irq_ptr, q, i)
setup_debugfs_entry(irq_ptr->debugfs_dev, q);
for_each_output_queue(irq_ptr, q, i)
setup_debugfs_entry(irq_ptr->debugfs_dev, q);
}
void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr)
{
debugfs_remove_recursive(irq_ptr->debugfs_dev);
}
int __init qdio_debug_init(void)
{
debugfs_root = debugfs_create_dir("qdio", NULL);
qdio_dbf_setup = debug_register("qdio_setup", 16, 1, 16);
debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view);
debug_set_level(qdio_dbf_setup, DBF_INFO);
DBF_EVENT("dbf created\n");
qdio_dbf_error = debug_register("qdio_error", 4, 1, 16);
debug_register_view(qdio_dbf_error, &debug_hex_ascii_view);
debug_set_level(qdio_dbf_error, DBF_INFO);
DBF_ERROR("dbf created\n");
return 0;
}
void qdio_debug_exit(void)
{
qdio_clear_dbf_list();
debugfs_remove_recursive(debugfs_root);
debug_unregister(qdio_dbf_setup);
debug_unregister(qdio_dbf_error);
}
Annotation
- Immediate include surface: `linux/seq_file.h`, `linux/debugfs.h`, `linux/uaccess.h`, `linux/slab.h`, `asm/debug.h`, `qdio_debug.h`, `qdio.h`.
- Detected declarations: `struct qdio_dbf_entry`, `function qdio_clear_dbf_list`, `function qdio_allocate_dbf`, `function qstat_show`, `function ssqd_show`, `function qperf_show`, `function qperf_seq_write`, `function qperf_seq_open`, `function setup_debugfs_entry`, `function qdio_setup_debug_entries`.
- Atlas domain: Driver Families / drivers/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.