Fix next-audit branch
Subsystems (2)
cover Fix next-audit branch
Intel kbuild test robot reported on Dec 8th, 2018 that next-audit is broken. This was with riscv-allmodconfig config.
There were two issues found:
- We don't generate functions needed for trace events;
- We are missing NR_syscalls macro used by kernel/trace.
David Abdurachmanov (2):
riscv: define NR_syscalls in unistd.h
riscv: define CREATE_TRACE_POINTS in ptrace.c
arch/riscv/include/asm/unistd.h | 2 ++ arch/riscv/kernel/ptrace.c | 2 ++ 2 files changed, 4 insertions(+)
Signature · 1 line
2.19.2
PATCH 1/2 riscv: define NR_syscalls in unistd.h
This macro is used by kernel/trace/{trace.h,trace_syscalls.c} if we have CONFIG_FTRACE_SYSCALLS enabled.
--- arch/riscv/include/asm/unistd.h | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/include/asm/unistd.h +2 -0
@@ -19,3 +19,5 @@#define __ARCH_WANT_SYS_CLONE#include <uapi/asm/unistd.h> + +#define NR_syscalls (__NR_syscalls)
Signature · 1 line
2.19.2
Re: [PATCH 1/2] riscv: define NR_syscalls in unistd.h
Quoted 6 lines · David Abdurachmanov
This macro is used by
kernel/trace/{trace.h,trace_syscalls.c}if we haveCONFIG_FTRACE_SYSCALLSenabled.Signed-off-by David Abdurachmanov <[email protected]>Fixes b78002b395b4 ("riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig")
-Olof
PATCH 2/2 riscv: define CREATE_TRACE_POINTS in ptrace.c
In reply to David AbdurachmanovDefine CREATE_TRACE_POINTS in order to create functions and structures for the trace events. This is needed if HAVE_SYSCALL_TRACEPOINTS and CONFIG_FTRACE_SYSCALLS are enabled, otherwise we get linking errors:
[..]
MODPOST vmlinux.okernel/trace/trace_syscalls.o: In function `.L0 ':
trace_syscalls.c:(.text+0x1152): undefined reference to __tracepoint_sys_enter' trace_syscalls.c:(.text+0x126c): undefined reference to __tracepoint_sys_enter' trace_syscalls.c:(.text+0x1328): undefined reference to __tracepoint_sys_enter' trace_syscalls.c:(.text+0x14aa): undefined reference to __tracepoint_sys_enter' trace_syscalls.c:(.text+0x1684): undefined reference to __tracepoint_sys_exit' trace_syscalls.c:(.text+0x17a0): undefined reference to __tracepoint_sys_exit' trace_syscalls.c:(.text+0x185c): undefined reference to __tracepoint_sys_exit' trace_syscalls.c:(.text+0x19de): undefined reference to __tracepoint_sys_exit' arch/riscv/kernel/ptrace.o: In function `.L0 ':
ptrace.c:(.text+0x4dc): undefined reference to __tracepoint_sys_enter' ptrace.c:(.text+0x632): undefined reference to __tracepoint_sys_exit'
make: *** [Makefile:1036: vmlinux] Error 1
--- arch/riscv/kernel/ptrace.c | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/kernel/ptrace.c +2 -0
@@ -24,6 +24,8 @@#include <linux/sched.h> #include <linux/sched/task_stack.h> #include <linux/tracehook.h> + +#define CREATE_TRACE_POINTS #include <trace/events/syscalls.h> enum riscv_regset {
Signature · 1 line
2.19.2