/* * The graph frame test is not possible if CONFIG_FRAME_POINTER is not enabled. * Check arch/riscv/kernel/mcount.S for detail.
*/ #ifdefined(CONFIG_FUNCTION_GRAPH_TRACER) && defined(CONFIG_FRAME_POINTER) #define HAVE_FUNCTION_GRAPH_FP_TEST #endif
/* * Let's do like x86/arm64 and ignore the compat syscalls.
*/ #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS staticinlinebool arch_trace_is_compat_syscall(struct pt_regs *regs)
{ return is_compat_task();
}
#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME staticinlinebool arch_syscall_match_sym_name(constchar *sym, constchar *name)
{ /* * Since all syscall functions have __riscv_ prefix, we must skip it. * However, as we described above, we decided to ignore compat * syscalls, so we don't care about __riscv_compat_ prefix here.
*/ return !strcmp(sym + 8, name);
}
struct dyn_arch_ftrace {
}; #endif
#ifdef CONFIG_DYNAMIC_FTRACE /* * A general call in RISC-V is a pair of insts: * 1) auipc: setting high-20 pc-related bits to ra register * 2) jalr: setting low-12 offset to ra, jump to ra, and set ra to * return address (original pc + 4) * * The first 2 instructions for each tracable function is compiled to 2 nop * instructions. Then, the kernel initializes the first instruction to auipc at * boot time (<ftrace disable>). The second instruction is patched to jalr to * start the trace. * *<Image>: * 0: nop * 4: nop * *<ftrace enable>: * 0: auipc t0, 0x? * 4: jalr t0, ?(t0) * *<ftrace disable>: * 0: auipc t0, 0x? * 4: nop * * Dynamic ftrace generates probes to call sites, so we must deal with * both auipc and jalr at the same time.
*/
/* * Only the jalr insn in the auipc+jalr is patched, so we make it 4 * bytes here.
*/ #define MCOUNT_INSN_SIZE 4 #define MCOUNT_AUIPC_SIZE 4 #define MCOUNT_JALR_SIZE 4 #define MCOUNT_NOP4_SIZE 4
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.