Skip to contentSkip to conversation

riscv: enable syscalls tracepoints

PATCH In review David Abdurachmanov 2 participants 5 messages Dec 6, 2018 – Dec 10, 2018

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

cover riscv: enable syscalls tracepoints

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

audit patch is already merged into linux-next.

This simply fixes compilation error in do_syscall_trace_exit() and enables syscalls tracepoints.

David Abdurachmanov (2):
riscv: fix trace_sys_exit hook
riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig

 arch/riscv/Kconfig         | 1 +
 arch/riscv/kernel/ptrace.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/2 riscv: fix trace_sys_exit hook

Fix compilation error.

---
 arch/riscv/kernel/ptrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/ptrace.c +1 -1
index c1b51539c3e2..2fd9ec48106b 100644
@@ -177,6 +177,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.19.2
#2 lore raw

PATCH 2/2 riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig

In reply to David Abdurachmanov

I looked into Documentation/trace/ftrace-design.rst and, I think, we check all the boxes needed for HAVE_SYSCALL_TRACEPOINTS.

---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
index a4f48f757204..6749c22ee656 100644
@@ -34,6 +34,7 @@ config RISCV
 	select HAVE_FUTEX_CMPXCHG if FUTEX
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_PERF_EVENTS
+	select HAVE_SYSCALL_TRACEPOINTS
 	select IRQ_DOMAIN
 	select RISCV_ISA_A if SMP
 	select SPARSE_IRQ
Signature · 1 line
2.19.2
#3 lore raw
In reply to David Abdurachmanov
Quoted 8 lines · On Thu, 06 Dec 2018 07:26:33 PST (-0800), [email protected] wrote:

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

audit patch is already merged into linux-next.

This simply fixes compilation error in do_syscall_trace_exit() and enables syscalls tracepoints.

Quoted 7 lines

David Abdurachmanov (2):
riscv: fix trace_sys_exit hook
riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig

 arch/riscv/Kconfig         | 1 +
 arch/riscv/kernel/ptrace.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

I've attempted to add this on top of next-audit, which I've merged into for-next. Let me know if something went wrong.

#4 lore raw
Quoted 14 lines · Palmer Dabbelt
Quoted 12 lines · On Thu, 06 Dec 2018 07:26:33 PST (-0800), [email protected] wrote:

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

audit patch is already merged into linux-next.

This simply fixes compilation error in do_syscall_trace_exit() and enables syscalls tracepoints.

David Abdurachmanov (2):
riscv: fix trace_sys_exit hook
riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig

Quoted 6 lines
Quoted 3 lines
 arch/riscv/Kconfig         | 1 +
 arch/riscv/kernel/ptrace.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

I've attempted to add this on top of next-audit, which I've merged into for-next. Let me know if something went wrong.

Two things:
- The order of commits are wrong. Right now the commits are in reverse order, i.e. audit patches are on top.
- Intel kbuild test bot found compilation errors with riscv-allmodconfig config. I fixed those and posted two patches:
http://lists.infradead.org/pipermail/linux-riscv/2018-December/002508.html