arch/um/kernel/stacktrace.c
Source file repositories/reference/linux-study-clean/arch/um/kernel/stacktrace.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/kernel/stacktrace.c- Extension
.c- Size
- 1855 bytes
- Lines
- 76
- Domain
- Architecture Layer
- Bucket
- arch/um
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kallsyms.hlinux/kernel.hlinux/sched.hlinux/stacktrace.hlinux/module.hlinux/uaccess.hasm/stacktrace.h
Detected Declarations
function Copyrightfunction save_addrfunction __save_stack_tracefunction save_stack_tracefunction save_stack_trace_tskexport save_stack_traceexport save_stack_trace_tsk
Annotated Snippet
if (__kernel_text_address(addr)) {
reliable = 0;
if ((unsigned long) sp == bp + sizeof(long)) {
frame = frame ? frame->next_frame : NULL;
bp = (unsigned long)frame;
reliable = 1;
}
ops->address(data, addr, reliable);
}
sp++;
}
}
static void save_addr(void *data, unsigned long address, int reliable)
{
struct stack_trace *trace = data;
if (!reliable)
return;
if (trace->nr_entries >= trace->max_entries)
return;
trace->entries[trace->nr_entries++] = address;
}
static const struct stacktrace_ops dump_ops = {
.address = save_addr
};
static void __save_stack_trace(struct task_struct *tsk, struct stack_trace *trace)
{
dump_trace(tsk, &dump_ops, trace);
}
void save_stack_trace(struct stack_trace *trace)
{
__save_stack_trace(current, trace);
}
EXPORT_SYMBOL_GPL(save_stack_trace);
void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
{
__save_stack_trace(tsk, trace);
}
EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
Annotation
- Immediate include surface: `linux/kallsyms.h`, `linux/kernel.h`, `linux/sched.h`, `linux/stacktrace.h`, `linux/module.h`, `linux/uaccess.h`, `asm/stacktrace.h`.
- Detected declarations: `function Copyright`, `function save_addr`, `function __save_stack_trace`, `function save_stack_trace`, `function save_stack_trace_tsk`, `export save_stack_trace`, `export save_stack_trace_tsk`.
- Atlas domain: Architecture Layer / arch/um.
- Implementation status: integration implementation candidate.
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.