drivers/ras/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/ras/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ras/debugfs.c- Extension
.c- Size
- 1277 bytes
- Lines
- 66
- Domain
- Driver Families
- Bucket
- drivers/ras
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/ras.hdebugfs.h
Detected Declarations
function ras_userspace_consumersfunction trace_showfunction trace_openfunction trace_releasefunction ras_add_daemon_tracefunction ras_debugfs_initexport ras_get_debugfs_rootexport ras_userspace_consumers
Annotated Snippet
static const struct file_operations trace_fops = {
.open = trace_open,
.read = seq_read,
.llseek = seq_lseek,
.release = trace_release,
};
int __init ras_add_daemon_trace(void)
{
struct dentry *fentry;
if (!ras_debugfs_dir)
return -ENOENT;
fentry = debugfs_create_file("daemon_active", S_IRUSR, ras_debugfs_dir,
NULL, &trace_fops);
if (IS_ERR(fentry))
return -ENODEV;
return 0;
}
void __init ras_debugfs_init(void)
{
ras_debugfs_dir = debugfs_create_dir("ras", NULL);
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/ras.h`, `debugfs.h`.
- Detected declarations: `function ras_userspace_consumers`, `function trace_show`, `function trace_open`, `function trace_release`, `function ras_add_daemon_trace`, `function ras_debugfs_init`, `export ras_get_debugfs_root`, `export ras_userspace_consumers`.
- Atlas domain: Driver Families / drivers/ras.
- 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.