arch/um/kernel/kmsg_dump.c
Source file repositories/reference/linux-study-clean/arch/um/kernel/kmsg_dump.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/kernel/kmsg_dump.c- Extension
.c- Size
- 1480 bytes
- Lines
- 66
- Domain
- Architecture Layer
- Bucket
- arch/um
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- 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/kmsg_dump.hlinux/spinlock.hlinux/console.hlinux/string.hshared/init.hshared/kern.hos.h
Detected Declarations
function kmsg_dumper_stdoutfunction kmsg_dumper_stdout_init
Annotated Snippet
console_is_usable(con, console_srcu_read_flags(con), true)) {
break;
}
}
console_srcu_read_unlock(cookie);
if (con)
return;
if (!spin_trylock_irqsave(&lock, flags))
return;
kmsg_dump_rewind(&iter);
printf("kmsg_dump:\n");
while (kmsg_dump_get_line(&iter, true, line, sizeof(line), &len)) {
line[len] = '\0';
printf("%s", line);
}
spin_unlock_irqrestore(&lock, flags);
}
static struct kmsg_dumper kmsg_dumper = {
.dump = kmsg_dumper_stdout
};
static int __init kmsg_dumper_stdout_init(void)
{
return kmsg_dump_register(&kmsg_dumper);
}
__uml_postsetup(kmsg_dumper_stdout_init);
Annotation
- Immediate include surface: `linux/kmsg_dump.h`, `linux/spinlock.h`, `linux/console.h`, `linux/string.h`, `shared/init.h`, `shared/kern.h`, `os.h`.
- Detected declarations: `function kmsg_dumper_stdout`, `function kmsg_dumper_stdout_init`.
- Atlas domain: Architecture Layer / arch/um.
- Implementation status: source 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.