lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1553564407-1162-1-git-send-email-laoar.shao@gmail.com>
Date:   Tue, 26 Mar 2019 09:40:04 +0800
From:   Yafang Shao <laoar.shao@...il.com>
To:     rostedt@...dmis.org, mingo@...hat.com, peterz@...radead.org,
        paulmck@...ux.vnet.ibm.com, josh@...htriplett.org,
        mathieu.desnoyers@...icios.com, jiangshanlai@...il.com,
        joel@...lfernandes.org
Cc:     shaoyafang@...iglobal.com, linux-kernel@...r.kernel.org,
        Yafang Shao <laoar.shao@...il.com>
Subject: [PATCH 0/3] tracing: introduce TRACE_EVENT_NONE and use it

In this patchset, I introduce a new macro TRACE_EVENT_NONE(), which will
define a tracepoint as a do-nothing inline function.
	#define TRACE_EVENT_NONE(name, proto)			\
		static inline void trace_##name(proto)		\
		{ }						\
		static inline bool trace_##name##_enabled(void)	\
		{						\
			return false;				\
		}

Let's take some example for why this macro is needed.

- sched
The tracepoints trace_sched_stat_{iowait, blocked, wait, sleep} should
be not exposed to user if CONFIG_SCHEDSTATS is not set.
We can place #ifdef in the kernel/sched/fair.c to fix it, but we don't want
to sprinkle #ifdef.
So with TRACE_EVENT_NONE(), we can fix it in include/trace/events/sched.h.

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

Yafang Shao (3):
  tracing: introduce TRACE_EVENT_NONE()
  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   |  8 +++++
 include/trace/define_trace.h |  4 +++
 include/trace/events/rcu.h   | 84 ++++++++++++++++++++++++++++----------------
 include/trace/events/sched.h | 14 ++++++++
 kernel/rcu/rcu.h             |  9 ++---
 kernel/rcu/tree.c            |  8 ++---
 6 files changed, 86 insertions(+), 41 deletions(-)

-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ