arch/arm64/include/asm/ftrace.h
Source file repositories/reference/linux-study-clean/arch/arm64/include/asm/ftrace.h
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/include/asm/ftrace.h- Extension
.h- Size
- 6111 bytes
- Lines
- 232
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/insn.hlinux/compat.h
Detected Declarations
struct dyn_arch_ftracestruct dyn_ftracestruct ftrace_opsstruct ftrace_regsstruct __arch_ftrace_regsfunction ftrace_regs_get_instruction_pointerfunction ftrace_regs_set_instruction_pointerfunction ftrace_regs_get_stack_pointerfunction ftrace_regs_get_argumentfunction ftrace_regs_get_return_valuefunction ftrace_regs_set_return_valuefunction ftrace_override_function_with_returnfunction ftrace_regs_get_frame_pointerfunction ftrace_regs_get_return_addressfunction ftrace_partial_regsfunction arch_ftrace_set_direct_callerfunction arch_trace_is_compat_syscallfunction arch_syscall_match_sym_name
Annotated Snippet
struct dyn_arch_ftrace {
/* No extra data needed for arm64 */
};
extern unsigned long ftrace_graph_call;
extern void return_to_handler(void);
unsigned long ftrace_call_adjust(unsigned long addr);
unsigned long arch_ftrace_get_symaddr(unsigned long fentry_ip);
#define ftrace_get_symaddr(fentry_ip) arch_ftrace_get_symaddr(fentry_ip)
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS
#define HAVE_ARCH_FTRACE_REGS
struct dyn_ftrace;
struct ftrace_ops;
struct ftrace_regs;
#define arch_ftrace_regs(fregs) ((struct __arch_ftrace_regs *)(fregs))
#define arch_ftrace_get_regs(regs) NULL
/*
* Note: sizeof(struct ftrace_regs) must be a multiple of 16 to ensure correct
* stack alignment
*/
struct __arch_ftrace_regs {
/* x0 - x8 */
unsigned long regs[9];
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
unsigned long direct_tramp;
#else
unsigned long __unused;
#endif
unsigned long fp;
unsigned long lr;
unsigned long sp;
unsigned long pc;
};
static __always_inline unsigned long
ftrace_regs_get_instruction_pointer(const struct ftrace_regs *fregs)
{
return arch_ftrace_regs(fregs)->pc;
}
static __always_inline void
ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs,
unsigned long pc)
{
arch_ftrace_regs(fregs)->pc = pc;
}
static __always_inline unsigned long
ftrace_regs_get_stack_pointer(const struct ftrace_regs *fregs)
{
return arch_ftrace_regs(fregs)->sp;
}
static __always_inline unsigned long
ftrace_regs_get_argument(struct ftrace_regs *fregs, unsigned int n)
{
if (n < 8)
return arch_ftrace_regs(fregs)->regs[n];
return 0;
}
static __always_inline unsigned long
ftrace_regs_get_return_value(const struct ftrace_regs *fregs)
{
return arch_ftrace_regs(fregs)->regs[0];
}
static __always_inline void
ftrace_regs_set_return_value(struct ftrace_regs *fregs,
unsigned long ret)
{
arch_ftrace_regs(fregs)->regs[0] = ret;
}
static __always_inline void
ftrace_override_function_with_return(struct ftrace_regs *fregs)
{
arch_ftrace_regs(fregs)->pc = arch_ftrace_regs(fregs)->lr;
}
static __always_inline unsigned long
ftrace_regs_get_frame_pointer(const struct ftrace_regs *fregs)
Annotation
- Immediate include surface: `asm/insn.h`, `linux/compat.h`.
- Detected declarations: `struct dyn_arch_ftrace`, `struct dyn_ftrace`, `struct ftrace_ops`, `struct ftrace_regs`, `struct __arch_ftrace_regs`, `function ftrace_regs_get_instruction_pointer`, `function ftrace_regs_set_instruction_pointer`, `function ftrace_regs_get_stack_pointer`, `function ftrace_regs_get_argument`, `function ftrace_regs_get_return_value`.
- Atlas domain: Architecture Layer / arch/arm64.
- 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.