arch/mips/kernel/stacktrace.c
Source file repositories/reference/linux-study-clean/arch/mips/kernel/stacktrace.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/kernel/stacktrace.c- Extension
.c- Size
- 2358 bytes
- Lines
- 94
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/sched.hlinux/sched/debug.hlinux/sched/task_stack.hlinux/stacktrace.hlinux/export.hasm/stacktrace.h
Detected Declarations
function Copyrightfunction save_context_stackfunction save_stack_tracefunction save_stack_trace_tskexport save_stack_traceexport save_stack_trace_tsk
Annotated Snippet
if (savesched || !in_sched_functions(pc)) {
if (trace->skip > 0)
trace->skip--;
else
trace->entries[trace->nr_entries++] = pc;
if (trace->nr_entries >= trace->max_entries)
break;
}
pc = unwind_stack(tsk, &sp, pc, &ra);
} while (pc);
#else
save_raw_context_stack(trace, sp, savesched);
#endif
}
/*
* Save stack-backtrace addresses into a stack_trace buffer.
*/
void save_stack_trace(struct stack_trace *trace)
{
save_stack_trace_tsk(current, trace);
}
EXPORT_SYMBOL_GPL(save_stack_trace);
void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
{
struct pt_regs dummyregs;
struct pt_regs *regs = &dummyregs;
WARN_ON(trace->nr_entries || !trace->max_entries);
if (tsk != current) {
regs->regs[29] = tsk->thread.reg29;
regs->regs[31] = 0;
regs->cp0_epc = tsk->thread.reg31;
} else
prepare_frametrace(regs);
save_context_stack(trace, tsk, regs, tsk == current);
}
EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
Annotation
- Immediate include surface: `linux/sched.h`, `linux/sched/debug.h`, `linux/sched/task_stack.h`, `linux/stacktrace.h`, `linux/export.h`, `asm/stacktrace.h`.
- Detected declarations: `function Copyright`, `function save_context_stack`, `function save_stack_trace`, `function save_stack_trace_tsk`, `export save_stack_trace`, `export save_stack_trace_tsk`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.