• Qing Zhang's avatar
    LoongArch: modules/ftrace: Initialize PLT at load time · 28ac0a9e
    Qing Zhang authored
    This patch implements ftrace trampolines through plt entry.
    
    Tested by forcing ftrace_make_call() to use the module PLT, and then
    loading up a module after setting up ftrace with:
    
    | echo ":mod:<module-name>" > set_ftrace_filter;
    | echo function > current_tracer;
    | modprobe <module-name>
    
    Since FTRACE_ADDR/FTRACE_REGS_ADDR is only defined when CONFIG_DYNAMIC_
    FTRACE is selected, we wrap their usage in module_init_ftrace_plt() with
    ifdeffery rather than using IS_ENABLED().
    Signed-off-by: default avatarQing Zhang <zhangqing@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    28ac0a9e
ftrace.h 1.54 KB