kernel/trace/trace_functions_graph.c
Source file repositories/reference/linux-study-clean/kernel/trace/trace_functions_graph.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/trace/trace_functions_graph.c- Extension
.c- Size
- 45932 bytes
- Lines
- 1839
- 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.
- 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/uaccess.hlinux/ftrace.hlinux/interrupt.hlinux/slab.hlinux/fs.htrace.htrace_output.h
Detected Declarations
struct fgraph_cpu_datastruct fgraph_ent_argsstruct fgraph_retaddr_ent_argsstruct fgraph_datastruct fgraph_timesfunction tracer_flags_is_setfunction __graph_entryfunction __trace_graph_entryfunction __trace_graph_retaddr_entryfunction __trace_graph_retaddr_entryfunction ftrace_graph_ignore_irqsfunction graph_entryfunction tracer_flags_is_setfunction trace_graph_entryfunction trace_graph_entry_argsfunction __trace_graph_functionfunction trace_graph_functionfunction __trace_graph_returnfunction handle_nosleeptimefunction trace_graph_returnfunction trace_graph_thresh_returnfunction allocate_fgraph_opsfunction free_fgraph_opsfunction init_array_fgraph_opsfunction graph_trace_initfunction ftrace_graph_trace_argsfunction graph_trace_resetfunction graph_trace_update_threshfunction print_graph_cpufunction print_graph_procfunction print_graph_lat_fmtfunction verif_pidfunction get_return_for_leaffunction print_graph_abs_timefunction print_graph_rel_timefunction print_graph_irqfunction trace_print_graph_durationfunction print_graph_durationfunction print_graph_retaddrfunction print_graph_retvalfunction print_graph_entry_leaffunction print_graph_entry_nestedfunction print_graph_prologuefunction check_irq_entryfunction check_irq_returnfunction print_graph_entryfunction print_graph_returnfunction print_graph_comment
Annotated Snippet
static const struct file_operations graph_depth_fops = {
.open = tracing_open_generic,
.write = graph_depth_write,
.read = graph_depth_read,
.llseek = generic_file_llseek,
};
static __init int init_graph_tracefs(void)
{
int ret;
ret = tracing_init_dentry();
if (ret)
return 0;
trace_create_file("max_graph_depth", TRACE_MODE_WRITE, NULL,
NULL, &graph_depth_fops);
return 0;
}
fs_initcall(init_graph_tracefs);
static __init int init_graph_trace(void)
{
max_bytes_for_cpu = snprintf(NULL, 0, "%u", nr_cpu_ids - 1);
if (!register_trace_event(&graph_trace_entry_event)) {
pr_warn("Warning: could not register graph trace events\n");
return 1;
}
#ifdef CONFIG_FUNCTION_GRAPH_RETADDR
if (!register_trace_event(&graph_trace_retaddr_entry_event)) {
pr_warn("Warning: could not register graph trace retaddr events\n");
return 1;
}
#endif
if (!register_trace_event(&graph_trace_ret_event)) {
pr_warn("Warning: could not register graph trace events\n");
return 1;
}
return register_tracer(&graph_trace);
}
core_initcall(init_graph_trace);
Annotation
- Immediate include surface: `linux/uaccess.h`, `linux/ftrace.h`, `linux/interrupt.h`, `linux/slab.h`, `linux/fs.h`, `trace.h`, `trace_output.h`.
- Detected declarations: `struct fgraph_cpu_data`, `struct fgraph_ent_args`, `struct fgraph_retaddr_ent_args`, `struct fgraph_data`, `struct fgraph_times`, `function tracer_flags_is_set`, `function __graph_entry`, `function __trace_graph_entry`, `function __trace_graph_retaddr_entry`, `function __trace_graph_retaddr_entry`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- Implementation status: pattern 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.