From: kernel test robot <lkp@intel.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Peter Zijlstra <peterz@infradead.org>,
Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
bpf@vger.kernel.org, Joel Fernandes <joel@joelfernandes.org>,
linux-trace-kernel@vger.kernel.org,
Michael Jeanson <mjeanson@efficios.com>
Subject: Re: [PATCH resend 1/8] tracing: Declare system call tracepoints with TRACE_EVENT_SYSCALL
Date: Thu, 3 Oct 2024 17:51:03 +0800 [thread overview]
Message-ID: <202410031716.sTBC2OLt-lkp@intel.com> (raw)
In-Reply-To: <20240930192357.1154417-2-mathieu.desnoyers@efficios.com>
Hi Mathieu,
kernel test robot noticed the following build errors:
[auto build test ERROR on peterz-queue/sched/core]
[also build test ERROR on linus/master v6.12-rc1 next-20241003]
[cannot apply to rostedt-trace/for-next rostedt-trace/for-next-urgent tip/core/entry]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mathieu-Desnoyers/tracing-Declare-system-call-tracepoints-with-TRACE_EVENT_SYSCALL/20241001-032827
base: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core
patch link: https://lore.kernel.org/r/20240930192357.1154417-2-mathieu.desnoyers%40efficios.com
patch subject: [PATCH resend 1/8] tracing: Declare system call tracepoints with TRACE_EVENT_SYSCALL
config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20241003/202410031716.sTBC2OLt-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241003/202410031716.sTBC2OLt-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410031716.sTBC2OLt-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/trace/syscall.h:5,
from include/linux/syscalls.h:93,
from include/linux/entry-common.h:7,
from kernel/entry/common.c:4:
include/trace/events/syscalls.h:20:18: error: expected ')' before 'struct'
20 | TP_PROTO(struct pt_regs *regs, long id),
| ^~~~~~
include/linux/tracepoint.h:106:25: note: in definition of macro 'PARAMS'
106 | #define PARAMS(args...) args
| ^~~~
include/linux/tracepoint.h:614:9: note: in expansion of macro 'DECLARE_TRACE_SYSCALL'
614 | DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args))
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/tracepoint.h:614:37: note: in expansion of macro 'PARAMS'
614 | DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args))
| ^~~~~~
include/trace/events/syscalls.h:18:1: note: in expansion of macro 'TRACE_EVENT_SYSCALL'
18 | TRACE_EVENT_SYSCALL(sys_enter,
| ^~~~~~~~~~~~~~~~~~~
include/trace/events/syscalls.h:20:9: note: in expansion of macro 'TP_PROTO'
20 | TP_PROTO(struct pt_regs *regs, long id),
| ^~~~~~~~
include/trace/events/syscalls.h:46:18: error: expected ')' before 'struct'
46 | TP_PROTO(struct pt_regs *regs, long ret),
| ^~~~~~
include/linux/tracepoint.h:106:25: note: in definition of macro 'PARAMS'
106 | #define PARAMS(args...) args
| ^~~~
include/linux/tracepoint.h:614:9: note: in expansion of macro 'DECLARE_TRACE_SYSCALL'
614 | DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args))
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/tracepoint.h:614:37: note: in expansion of macro 'PARAMS'
614 | DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args))
| ^~~~~~
include/trace/events/syscalls.h:44:1: note: in expansion of macro 'TRACE_EVENT_SYSCALL'
44 | TRACE_EVENT_SYSCALL(sys_exit,
| ^~~~~~~~~~~~~~~~~~~
include/trace/events/syscalls.h:46:9: note: in expansion of macro 'TP_PROTO'
46 | TP_PROTO(struct pt_regs *regs, long ret),
| ^~~~~~~~
kernel/entry/common.c: In function 'syscall_trace_enter':
>> kernel/entry/common.c:61:17: error: implicit declaration of function 'trace_syscall_sys_enter' [-Wimplicit-function-declaration]
61 | trace_syscall_sys_enter(regs, syscall);
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/entry/common.c: In function 'syscall_exit_work':
>> kernel/entry/common.c:169:17: error: implicit declaration of function 'trace_syscall_sys_exit' [-Wimplicit-function-declaration]
169 | trace_syscall_sys_exit(regs, syscall_get_return_value(current, regs));
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/trace_syscall_sys_enter +61 kernel/entry/common.c
27
28 long syscall_trace_enter(struct pt_regs *regs, long syscall,
29 unsigned long work)
30 {
31 long ret = 0;
32
33 /*
34 * Handle Syscall User Dispatch. This must comes first, since
35 * the ABI here can be something that doesn't make sense for
36 * other syscall_work features.
37 */
38 if (work & SYSCALL_WORK_SYSCALL_USER_DISPATCH) {
39 if (syscall_user_dispatch(regs))
40 return -1L;
41 }
42
43 /* Handle ptrace */
44 if (work & (SYSCALL_WORK_SYSCALL_TRACE | SYSCALL_WORK_SYSCALL_EMU)) {
45 ret = ptrace_report_syscall_entry(regs);
46 if (ret || (work & SYSCALL_WORK_SYSCALL_EMU))
47 return -1L;
48 }
49
50 /* Do seccomp after ptrace, to catch any tracer changes. */
51 if (work & SYSCALL_WORK_SECCOMP) {
52 ret = __secure_computing(NULL);
53 if (ret == -1L)
54 return ret;
55 }
56
57 /* Either of the above might have changed the syscall number */
58 syscall = syscall_get_nr(current, regs);
59
60 if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT)) {
> 61 trace_syscall_sys_enter(regs, syscall);
62 /*
63 * Probes or BPF hooks in the tracepoint may have changed the
64 * system call number as well.
65 */
66 syscall = syscall_get_nr(current, regs);
67 }
68
69 syscall_enter_audit(regs, syscall);
70
71 return ret ? : syscall;
72 }
73
74 noinstr void syscall_enter_from_user_mode_prepare(struct pt_regs *regs)
75 {
76 enter_from_user_mode(regs);
77 instrumentation_begin();
78 local_irq_enable();
79 instrumentation_end();
80 }
81
82 /* Workaround to allow gradual conversion of architecture code */
83 void __weak arch_do_signal_or_restart(struct pt_regs *regs) { }
84
85 /**
86 * exit_to_user_mode_loop - do any pending work before leaving to user space
87 * @regs: Pointer to pt_regs on entry stack
88 * @ti_work: TIF work flags as read by the caller
89 */
90 __always_inline unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
91 unsigned long ti_work)
92 {
93 /*
94 * Before returning to user space ensure that all pending work
95 * items have been completed.
96 */
97 while (ti_work & EXIT_TO_USER_MODE_WORK) {
98
99 local_irq_enable_exit_to_user(ti_work);
100
101 if (ti_work & _TIF_NEED_RESCHED)
102 schedule();
103
104 if (ti_work & _TIF_UPROBE)
105 uprobe_notify_resume(regs);
106
107 if (ti_work & _TIF_PATCH_PENDING)
108 klp_update_patch_state(current);
109
110 if (ti_work & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
111 arch_do_signal_or_restart(regs);
112
113 if (ti_work & _TIF_NOTIFY_RESUME)
114 resume_user_mode_work(regs);
115
116 /* Architecture specific TIF work */
117 arch_exit_to_user_mode_work(regs, ti_work);
118
119 /*
120 * Disable interrupts and reevaluate the work flags as they
121 * might have changed while interrupts and preemption was
122 * enabled above.
123 */
124 local_irq_disable_exit_to_user();
125
126 /* Check if any of the above work has queued a deferred wakeup */
127 tick_nohz_user_enter_prepare();
128
129 ti_work = read_thread_flags();
130 }
131
132 /* Return the latest work state for arch_exit_to_user_mode() */
133 return ti_work;
134 }
135
136 /*
137 * If SYSCALL_EMU is set, then the only reason to report is when
138 * SINGLESTEP is set (i.e. PTRACE_SYSEMU_SINGLESTEP). This syscall
139 * instruction has been already reported in syscall_enter_from_user_mode().
140 */
141 static inline bool report_single_step(unsigned long work)
142 {
143 if (work & SYSCALL_WORK_SYSCALL_EMU)
144 return false;
145
146 return work & SYSCALL_WORK_SYSCALL_EXIT_TRAP;
147 }
148
149 static void syscall_exit_work(struct pt_regs *regs, unsigned long work)
150 {
151 bool step;
152
153 /*
154 * If the syscall was rolled back due to syscall user dispatching,
155 * then the tracers below are not invoked for the same reason as
156 * the entry side was not invoked in syscall_trace_enter(): The ABI
157 * of these syscalls is unknown.
158 */
159 if (work & SYSCALL_WORK_SYSCALL_USER_DISPATCH) {
160 if (unlikely(current->syscall_dispatch.on_dispatch)) {
161 current->syscall_dispatch.on_dispatch = false;
162 return;
163 }
164 }
165
166 audit_syscall_exit(regs);
167
168 if (work & SYSCALL_WORK_SYSCALL_TRACEPOINT)
> 169 trace_syscall_sys_exit(regs, syscall_get_return_value(current, regs));
170
171 step = report_single_step(work);
172 if (step || work & SYSCALL_WORK_SYSCALL_TRACE)
173 ptrace_report_syscall_exit(regs, step);
174 }
175
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-10-03 9:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 19:23 [PATCH resend 0/8] tracing: Allow system call tracepoints to handle page faults Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 1/8] tracing: Declare system call tracepoints with TRACE_EVENT_SYSCALL Mathieu Desnoyers
2024-10-03 9:51 ` kernel test robot [this message]
2024-10-03 9:51 ` kernel test robot
2024-09-30 19:23 ` [PATCH resend 2/8] tracing/ftrace: guard syscall probe with preempt_notrace Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 3/8] tracing/perf: " Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 4/8] tracing/bpf: " Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 5/8] tracing: Allow system call tracepoints to handle page faults Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 6/8] tracing/ftrace: Add might_fault check to syscall probes Mathieu Desnoyers
2024-10-28 17:42 ` Thomas Gleixner
2024-10-28 19:02 ` Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 7/8] tracing/perf: " Mathieu Desnoyers
2024-09-30 19:23 ` [PATCH resend 8/8] tracing/bpf: " Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202410031716.sTBC2OLt-lkp@intel.com \
--to=lkp@intel.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=mjeanson@efficios.com \
--cc=namhyung@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.