[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1553564407-1162-3-git-send-email-laoar.shao@gmail.com>
Date: Tue, 26 Mar 2019 09:40:06 +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 2/3] sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set
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@...il.com>
---
include/trace/events/sched.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 9a4bdfa..4686c7f 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -336,6 +336,7 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
__entry->pid, __entry->old_pid)
);
+#ifdef CONFIG_SCHEDSTATS
/*
* XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE
* adding sched_stat support to SCHED_FIFO/RR would be welcome.
@@ -395,6 +396,19 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
TP_PROTO(struct task_struct *tsk, u64 delay),
TP_ARGS(tsk, delay));
+#else /* CONFIG_SCHEDSTATS */
+
+TRACE_EVENT_NONE(sched_stat_wait,
+ TP_PROTO(struct task_struct *tsk, u64 delay));
+TRACE_EVENT_NONE(sched_stat_sleep,
+ TP_PROTO(struct task_struct *tsk, u64 delay));
+TRACE_EVENT_NONE(sched_stat_iowait,
+ TP_PROTO(struct task_struct *tsk, u64 delay));
+TRACE_EVENT_NONE(sched_stat_blocked,
+ TP_PROTO(struct task_struct *tsk, u64 delay));
+
+#endif /* CONFIG_SCHEDSTATS */
+
/*
* Tracepoint for accounting runtime (time the task is executing
* on a CPU).
--
1.8.3.1
Powered by blists - more mailing lists