@@ -197,7 +197,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
197197 * it_func[0] is never NULL because there is at least one element in the array
198198 * when the array itself is non NULL.
199199 */
200- #define __DO_TRACE (name , args , cond ) \
200+ #define __DO_TRACE (name , args , cond , syscall ) \
201201 do { \
202202 int __maybe_unused __idx = 0; \
203203 \
@@ -222,21 +222,10 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
222222 * site if it is not watching, as it will need to be active when the
223223 * tracepoint is enabled.
224224 */
225- #define __DECLARE_TRACE (name , proto , args , cond , data_proto ) \
225+ #define __DECLARE_TRACE_COMMON (name , proto , args , cond , data_proto ) \
226226 extern int __traceiter_##name(data_proto); \
227227 DECLARE_STATIC_CALL(tp_func_##name, __traceiter_##name); \
228228 extern struct tracepoint __tracepoint_##name; \
229- static inline void trace_##name(proto) \
230- { \
231- if (static_branch_unlikely(&__tracepoint_##name.key)) \
232- __DO_TRACE(name, \
233- TP_ARGS(args), \
234- TP_CONDITION(cond)); \
235- if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \
236- WARN_ONCE(!rcu_is_watching(), \
237- "RCU not watching for tracepoint"); \
238- } \
239- } \
240229 static inline int \
241230 register_trace_##name(void (*probe)(data_proto), void *data) \
242231 { \
@@ -266,6 +255,34 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
266255 return static_branch_unlikely(&__tracepoint_##name.key);\
267256 }
268257
258+ #define __DECLARE_TRACE (name , proto , args , cond , data_proto ) \
259+ __DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), cond, PARAMS(data_proto)) \
260+ static inline void trace_##name(proto) \
261+ { \
262+ if (static_branch_unlikely(&__tracepoint_##name.key)) \
263+ __DO_TRACE(name, \
264+ TP_ARGS(args), \
265+ TP_CONDITION(cond), 0); \
266+ if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \
267+ WARN_ONCE(!rcu_is_watching(), \
268+ "RCU not watching for tracepoint"); \
269+ } \
270+ }
271+
272+ #define __DECLARE_TRACE_SYSCALL (name , proto , args , cond , data_proto ) \
273+ __DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), cond, PARAMS(data_proto)) \
274+ static inline void trace_##name(proto) \
275+ { \
276+ if (static_branch_unlikely(&__tracepoint_##name.key)) \
277+ __DO_TRACE(name, \
278+ TP_ARGS(args), \
279+ TP_CONDITION(cond), 1); \
280+ if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \
281+ WARN_ONCE(!rcu_is_watching(), \
282+ "RCU not watching for tracepoint"); \
283+ } \
284+ }
285+
269286/*
270287 * We have no guarantee that gcc and the linker won't up-align the tracepoint
271288 * structures, so we create an array of pointers that will be used for iteration
@@ -348,6 +365,8 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
348365 return false; \
349366 }
350367
368+ #define __DECLARE_TRACE_SYSCALL __DECLARE_TRACE
369+
351370#define DEFINE_TRACE_FN (name , reg , unreg , proto , args )
352371#define DEFINE_TRACE (name , proto , args )
353372#define EXPORT_TRACEPOINT_SYMBOL_GPL (name )
@@ -409,6 +428,11 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
409428 cpu_online(raw_smp_processor_id()) && (PARAMS(cond)), \
410429 PARAMS(void *__data, proto))
411430
431+ #define DECLARE_TRACE_SYSCALL (name , proto , args ) \
432+ __DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args), \
433+ cpu_online(raw_smp_processor_id()), \
434+ PARAMS(void *__data, proto))
435+
412436#define TRACE_EVENT_FLAGS (event , flag )
413437
414438#define TRACE_EVENT_PERF_PERM (event , expr ...)
@@ -546,6 +570,9 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
546570 struct , assign , print ) \
547571 DECLARE_TRACE_CONDITION(name, PARAMS(proto), \
548572 PARAMS(args), PARAMS(cond))
573+ #define TRACE_EVENT_SYSCALL (name , proto , args , struct , assign , \
574+ print , reg , unreg ) \
575+ DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args))
549576
550577#define TRACE_EVENT_FLAGS (event , flag )
551578
0 commit comments