kernel/trace/trace_recursion_record.c
Source file repositories/reference/linux-study-clean/kernel/trace/trace_recursion_record.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/trace/trace_recursion_record.c- Extension
.c- Size
- 6094 bytes
- Lines
- 232
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/seq_file.hlinux/kallsyms.hlinux/module.hlinux/ftrace.hlinux/fs.htrace_output.h
Detected Declarations
struct recursed_functionsfunction ftrace_record_recursionfunction recursed_function_seq_stopfunction recursed_function_seq_showfunction recursed_function_openfunction recursed_function_writefunction recursed_function_releasefunction create_recursed_functionsmodule init create_recursed_functionsexport ftrace_record_recursion
Annotated Snippet
static const struct file_operations recursed_functions_fops = {
.open = recursed_function_open,
.write = recursed_function_write,
.read = seq_read,
.llseek = seq_lseek,
.release = recursed_function_release,
};
__init static int create_recursed_functions(void)
{
trace_create_file("recursed_functions", TRACE_MODE_WRITE,
NULL, NULL, &recursed_functions_fops);
return 0;
}
fs_initcall(create_recursed_functions);
Annotation
- Immediate include surface: `linux/seq_file.h`, `linux/kallsyms.h`, `linux/module.h`, `linux/ftrace.h`, `linux/fs.h`, `trace_output.h`.
- Detected declarations: `struct recursed_functions`, `function ftrace_record_recursion`, `function recursed_function_seq_stop`, `function recursed_function_seq_show`, `function recursed_function_open`, `function recursed_function_write`, `function recursed_function_release`, `function create_recursed_functions`, `module init create_recursed_functions`, `export ftrace_record_recursion`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- 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.