arch/csky/kernel/ftrace.c
Source file repositories/reference/linux-study-clean/arch/csky/kernel/ftrace.c
File Facts
- System
- Linux kernel
- Corpus path
arch/csky/kernel/ftrace.c- Extension
.c- Size
- 5463 bytes
- Lines
- 235
- Domain
- Architecture Layer
- Bucket
- arch/csky
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ftrace.hlinux/uaccess.hlinux/stop_machine.hasm/cacheflush.h
Detected Declarations
struct ftrace_modify_paramfunction thefunction ftrace_check_current_nopfunction ftrace_modify_codefunction ftrace_make_callfunction ftrace_make_nopfunction ftrace_update_ftrace_funcfunction ftrace_modify_callfunction prepare_ftrace_returnfunction ftrace_enable_ftrace_graph_callerfunction ftrace_disable_ftrace_graph_callerfunction __ftrace_modify_codefunction arch_ftrace_update_codeexport _mcount
Annotated Snippet
struct ftrace_modify_param {
int command;
atomic_t cpu_count;
};
static int __ftrace_modify_code(void *data)
{
struct ftrace_modify_param *param = data;
if (atomic_inc_return(¶m->cpu_count) == 1) {
ftrace_modify_all_code(param->command);
atomic_inc(¶m->cpu_count);
} else {
while (atomic_read(¶m->cpu_count) <= num_online_cpus())
cpu_relax();
local_icache_inv_all(NULL);
}
return 0;
}
void arch_ftrace_update_code(int command)
{
struct ftrace_modify_param param = { command, ATOMIC_INIT(0) };
stop_machine(__ftrace_modify_code, ¶m, cpu_online_mask);
}
#endif
#endif /* CONFIG_DYNAMIC_FTRACE */
/* _mcount is defined in abi's mcount.S */
EXPORT_SYMBOL(_mcount);
Annotation
- Immediate include surface: `linux/ftrace.h`, `linux/uaccess.h`, `linux/stop_machine.h`, `asm/cacheflush.h`.
- Detected declarations: `struct ftrace_modify_param`, `function the`, `function ftrace_check_current_nop`, `function ftrace_modify_code`, `function ftrace_make_call`, `function ftrace_make_nop`, `function ftrace_update_ftrace_func`, `function ftrace_modify_call`, `function prepare_ftrace_return`, `function ftrace_enable_ftrace_graph_caller`.
- Atlas domain: Architecture Layer / arch/csky.
- Implementation status: integration 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.