2018-12-06 15:27:52

by David Abdurachmanov

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
2.19.2



2018-12-06 15:27:54

by David Abdurachmanov

[permalink] [raw]
Subject: [PATCH 1/2] riscv: fix trace_sys_exit hook

Fix compilation error.

Signed-off-by: David Abdurachmanov <[email protected]>
---
arch/riscv/kernel/ptrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
index c1b51539c3e2..2fd9ec48106b 100644
--- a/arch/riscv/kernel/ptrace.c
+++ b/arch/riscv/kernel/ptrace.c
@@ -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
}
--
2.19.2


2018-12-06 15:29:46

by David Abdurachmanov

[permalink] [raw]
Subject: [PATCH 2/2] riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig

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

Signed-off-by: David Abdurachmanov <[email protected]>
---
arch/riscv/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index a4f48f757204..6749c22ee656 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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
--
2.19.2


2018-12-07 20:34:45

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 0/2] riscv: enable syscalls tracepoints

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
>
> 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.

2018-12-10 21:03:23

by David Abdurachmanov

[permalink] [raw]
Subject: Re: [PATCH 0/2] riscv: enable syscalls tracepoints

On Fri, Dec 7, 2018 at 9:32 PM Palmer Dabbelt <[email protected]> wrote:
>
> 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
> >
> > 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