mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-22 17:52:09 +00:00
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: Qing Zhang <zhangqing@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
10 lines
235 B
C
10 lines
235 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (C) 2020-2022 Loongson Technology Corporation Limited */
|
|
SECTIONS {
|
|
. = ALIGN(4);
|
|
.got : { BYTE(0) }
|
|
.plt : { BYTE(0) }
|
|
.plt.idx : { BYTE(0) }
|
|
.ftrace_trampoline : { BYTE(0) }
|
|
}
|