[5/6] sched, rt: support sched_stat_runtime tracepoint for RT sched class
diff mbox series

Message ID 20201201115416.26515-6-laoar.shao@gmail.com
State New, archived
Headers show
  • sched: support schedstats for RT sched class
Related show

Commit Message

Yafang Shao Dec. 1, 2020, 11:54 a.m. UTC
The runtime of a RT task has already been there, so we only need to
place the sched_stat_runtime tracepoint there.

One difference between fair task and RT task is that there is no vruntime
in RT task. To reuse the sched_stat_runtime tracepoint, '0' is passed as
vruntime for RT task.

The output of this tracepoint for RT task as follows,
          stress-9748    [039] d.h.   113.519352: sched_stat_runtime: comm=stress pid=9748 runtime=997573 [ns] vruntime=0 [ns]
          stress-9748    [039] d.h.   113.520352: sched_stat_runtime: comm=stress pid=9748 runtime=997627 [ns] vruntime=0 [ns]
          stress-9748    [039] d.h.   113.521352: sched_stat_runtime: comm=stress pid=9748 runtime=998203 [ns] vruntime=0 [ns]

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
 kernel/sched/rt.c | 2 ++
 1 file changed, 2 insertions(+)

diff mbox series

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 2d543a270dfe..da989653b0a2 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1011,6 +1011,8 @@  static void update_curr_rt(struct rq *rq)
 		      max(curr->stats.exec_max, delta_exec));
+	trace_sched_stat_runtime(curr, delta_exec, 0);
 	curr->se.sum_exec_runtime += delta_exec;
 	account_group_exec_runtime(curr, delta_exec);