From: Steven Rostedt <rostedt@goodmis.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: mingo@redhat.com, peterz@infradead.org, paulmck@linux.ibm.com,
josh@joshtriplett.org, mathieu.desnoyers@efficios.com,
jiangshanlai@gmail.com, joel@joelfernandes.org,
linux-kernel@vger.kernel.org, shaoyafang@didiglobal.com
Subject: Re: [PATCH v2 2/3] sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set
Date: Tue, 26 Mar 2019 08:21:57 -0400 [thread overview]
Message-ID: <20190326082157.1d0c01cb@gandalf.local.home> (raw)
In-Reply-To: <1553602391-11926-3-git-send-email-laoar.shao@gmail.com>
Peter, Ingo,
Are you OK with this patch? If you ack it, I'll pull it in through my
tree.
-- Steve
On Tue, 26 Mar 2019 20:13:10 +0800
Yafang Shao <laoar.shao@gmail.com> wrote:
> The tracepoints trace_sched_stat_{iowait, blocked, wait, sleep} should
> be not exposed to user if CONFIG_SCHEDSTATS is not set.
>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
> include/trace/events/sched.h | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
> index 9a4bdfa..c8c7c7e 100644
> --- a/include/trace/events/sched.h
> +++ b/include/trace/events/sched.h
> @@ -241,7 +241,6 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
> DEFINE_EVENT(sched_process_template, sched_process_free,
> TP_PROTO(struct task_struct *p),
> TP_ARGS(p));
> -
>
> /*
> * Tracepoint for a task exiting:
> @@ -336,11 +335,20 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
> __entry->pid, __entry->old_pid)
> );
>
> +
> +#ifdef CONFIG_SCHEDSTATS
> +#define DEFINE_EVENT_SCHEDSTAT DEFINE_EVENT
> +#define DECLARE_EVENT_CLASS_SCHEDSTAT DECLARE_EVENT_CLASS
> +#else
> +#define DEFINE_EVENT_SCHEDSTAT DEFINE_EVENT_NOP
> +#define DECLARE_EVENT_CLASS_SCHEDSTAT DECLARE_EVENT_CLASS_NOP
> +#endif
> +
> /*
> * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE
> * adding sched_stat support to SCHED_FIFO/RR would be welcome.
> */
> -DECLARE_EVENT_CLASS(sched_stat_template,
> +DECLARE_EVENT_CLASS_SCHEDSTAT(sched_stat_template,
>
> TP_PROTO(struct task_struct *tsk, u64 delay),
>
> @@ -363,12 +371,11 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
> (unsigned long long)__entry->delay)
> );
>
> -
> /*
> * Tracepoint for accounting wait time (time the task is runnable
> * but not actually running due to scheduler contention).
> */
> -DEFINE_EVENT(sched_stat_template, sched_stat_wait,
> +DEFINE_EVENT_SCHEDSTAT(sched_stat_template, sched_stat_wait,
> TP_PROTO(struct task_struct *tsk, u64 delay),
> TP_ARGS(tsk, delay));
>
> @@ -376,7 +383,7 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
> * Tracepoint for accounting sleep time (time the task is not runnable,
> * including iowait, see below).
> */
> -DEFINE_EVENT(sched_stat_template, sched_stat_sleep,
> +DEFINE_EVENT_SCHEDSTAT(sched_stat_template, sched_stat_sleep,
> TP_PROTO(struct task_struct *tsk, u64 delay),
> TP_ARGS(tsk, delay));
>
> @@ -384,14 +391,14 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
> * Tracepoint for accounting iowait time (time the task is not runnable
> * due to waiting on IO to complete).
> */
> -DEFINE_EVENT(sched_stat_template, sched_stat_iowait,
> +DEFINE_EVENT_SCHEDSTAT(sched_stat_template, sched_stat_iowait,
> TP_PROTO(struct task_struct *tsk, u64 delay),
> TP_ARGS(tsk, delay));
>
> /*
> * Tracepoint for accounting blocked time (time the task is in uninterruptible).
> */
> -DEFINE_EVENT(sched_stat_template, sched_stat_blocked,
> +DEFINE_EVENT_SCHEDSTAT(sched_stat_template, sched_stat_blocked,
> TP_PROTO(struct task_struct *tsk, u64 delay),
> TP_ARGS(tsk, delay));
>
next prev parent reply other threads:[~2019-03-26 12:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 12:13 [PATCH v2 0/3] tracing: introduce TRACE_EVENT_NOP and use it Yafang Shao
2019-03-26 12:13 ` [PATCH v2 1/3] tracing: introduce TRACE_EVENT_NOP() Yafang Shao
2019-03-26 12:13 ` [PATCH v2 2/3] sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set Yafang Shao
2019-03-26 12:21 ` Steven Rostedt [this message]
2019-04-01 10:31 ` Peter Zijlstra
2019-03-26 12:13 ` [PATCH v2 3/3] rcu: validate arguments for rcu tracepoints Yafang Shao
2019-03-26 12:22 ` Steven Rostedt
2019-03-26 15:18 ` Paul E. McKenney
2019-03-26 15:29 ` Steven Rostedt
2019-03-27 1:17 ` Yafang Shao
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=20190326082157.1d0c01cb@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=paulmck@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=shaoyafang@didiglobal.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).