LoongArch: ptrace: Add function argument access API

Add regs_get_argument() which returns N th argument of the function
call, This enables ftrace kprobe events to access kernel function
arguments via $argN syntax for later use.

E.g.:
echo 'p bio_add_page arg1=$arg1' > kprobe_events
bash: echo: write error: Invalid argument

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
Qing Zhang 2023-02-25 15:52:57 +08:00 • committed by Huacai Chen
commit 356bd6f236
2 changed files with 35 additions and 0 deletions