Skip to contentSkip to conversation

riscv: fix trace_sys_exit hook

PATCH In review David Abdurachmanov 2 participants 3 messages Oct 29, 2018 – Nov 13, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: fix trace_sys_exit hook

Depends on:
http://lists.infradead.org/pipermail/linux-riscv/2018-October/001931.html

Why we don't have HAVE_SYSCALL_TRACEPOINTS in arch/riscv/Kconfig?

---
 arch/riscv/kernel/ptrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/ptrace.c +1 -1
index 9f82a7e34c64..9db7d0076375 100644
@@ -120,6 +120,6 @@ void do_syscall_trace_exit(struct pt_regs *regs)
 
 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
 	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
-		trace_sys_exit(regs, regs->regs[0]);
+		trace_sys_exit(regs, regs_return_value(regs));
 #endif
 }
Signature · 1 line
2.17.2
#1 lore raw
Quoted 6 lines · David Abdurachmanov

Depends on:
http://lists.infradead.org/pipermail/linux-riscv/2018-October/001931.html

Why we don't have HAVE_SYSCALL_TRACEPOINTS in arch/riscv/Kconfig?

I looked this morning into Documentation/trace/ftrace-design.rst again.

Of all the things the document describes we are only missing HAVE_SYSCALL_TRACEPOINTS in Kconfig, yet we already have it implemented in ptrace.c (+ this minor fix). Reading document, I think, we check all the boxes needed for HAVE_SYSCALL_TRACEPOINTS.

I assume it was just missed (?) and will do v2 later on.

david

#2 lore raw
In reply to David Abdurachmanov
Quoted 15 lines · david.abdurachmanov at gmail.com

Depends on:
http://lists.infradead.org/pipermail/linux-riscv/2018-October/001931.html

Why we don't have HAVE_SYSCALL_TRACEPOINTS in arch/riscv/Kconfig?

---
 arch/riscv/kernel/ptrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/ptrace.c +0 -0
index 9f82a7e34c64..9db7d0076375 100644

arch/riscv/kernel/ptrace.c void do_syscall_trace_exit(struct pt_regs *regs) · line 125

Quoted 7 lines
arch/riscv/kernel/ptrace.c +1 -1
@@ -120,6 +120,6 @@ void do_syscall_trace_exit(struct pt_regs *regs)
 
 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
 	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
-		trace_sys_exit(regs, regs->regs[0]);
+		trace_sys_exit(regs, regs_return_value(regs));
 #endif
 }

I'm dropping this onto next-audit on top of the other two.

Thanks!