Skip to content

tracing: introduce TRACE_EVENT_NOP and use it

Yafang Shao lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesIn review
  2. v13 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tracing: introduce TRACE_EVENT_NOP()include/linux/tracepoint.h include/trace/define_trace.h+23 -00 replies
2/3sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not setinclude/trace/events/sched.h+14 -72 replies
3/3rcu: validate arguments for rcu tracepointsinclude/trace/events/rcu.h kernel/rcu/rcu.h kernel/rcu/tree.c+31 -674 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchPaul E. McKenneyPeter Zijlstra (Intel)
1/3
2/3A-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] tracing: introduce TRACE_EVENT_NOP and use it

In this patchset, I introduce some new macros TRACE_EVENT_NOP, DEFINE_EVENT_NOP and DECLARE_EVENT_CLASS_NOP, which will define a tracepoint as do-nothing inline function.

	#define DECLARE_EVENT_NOP(name, proto)			\
		static inline void trace_##name(proto)		\
		{ }						\
		static inline bool trace_##name##_enabled(void)	\
		{						\
			return false;				\
		}

Let's take some examples for why these macros are needed.

- sched
The tracepoints trace_sched_stat_{iowait, blocked, wait, sleep} should be not exposed to user if CONFIG_SCHEDSTATS is not set.

- rcu
When CONFIG_RCU_TRACE is not set, some rcu tracepoints are defined as do-nothing macro without validating arguments, that is not proper. We should validate the arguments.

Yafang Shao (3):
tracing: introduce TRACE_EVENT_NOP() sched/fair: do not expose some tracepoints to user if
CONFIG_SCHEDSTATS is not set
rcu: validate arguments for rcu tracepoints

 include/linux/tracepoint.h   | 15 ++++++++
 include/trace/define_trace.h |  8 +++++
 include/trace/events/rcu.h   | 81 ++++++++++++++------------------------------
 include/trace/events/sched.h | 21 ++++++++----
 kernel/rcu/rcu.h             |  9 ++---
 kernel/rcu/tree.c            |  8 ++---
 6 files changed, 68 insertions(+), 74 deletions(-)
Signature · 1 line
1.8.3.1