lib/nmi_backtrace.c
Source file repositories/reference/linux-study-clean/lib/nmi_backtrace.c
File Facts
- System
- Linux kernel
- Corpus path
lib/nmi_backtrace.c- Extension
.c- Size
- 3821 bytes
- Lines
- 133
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpumask.hlinux/delay.hlinux/kprobes.hlinux/stringify.hlinux/nmi.hlinux/cpu.hlinux/sched/debug.h
Detected Declarations
function raisefunction nmi_cpu_backtrace
Annotated Snippet
if (!READ_ONCE(backtrace_idle) && regs && cpu_in_idle(instruction_pointer(regs))) {
pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n",
cpu, (void *)instruction_pointer(regs));
} else {
pr_warn("NMI backtrace for cpu %d\n", cpu);
if (regs)
show_regs(regs);
else
dump_stack();
}
printk_cpu_sync_put_irqrestore(flags);
cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask));
return true;
}
return false;
}
NOKPROBE_SYMBOL(nmi_cpu_backtrace);
#endif
Annotation
- Immediate include surface: `linux/cpumask.h`, `linux/delay.h`, `linux/kprobes.h`, `linux/stringify.h`, `linux/nmi.h`, `linux/cpu.h`, `linux/sched/debug.h`.
- Detected declarations: `function raise`, `function nmi_cpu_backtrace`.
- Atlas domain: Kernel Services / lib.
- Implementation status: source 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.