From e779944bc6ccaa86869fcbc693ee4e9369fb322e Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Thu, 23 Jun 2016 12:32:22 +0200 Subject: LITMUS^RT core: keep track of time of last suspension This information is needed to insert ST_COMPLETION records for sporadic tasks. --- include/litmus/rt_param.h | 6 ++++++ kernel/sched/litmus.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 0070cbcbe21e..7663e0806531 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h @@ -155,6 +155,12 @@ struct rt_job { * Increase this sequence number when a job is released. */ unsigned int job_no; + +#ifdef CONFIG_SCHED_TASK_TRACE + /* Keep track of the last time the job suspended. + * -> used for tracing sporadic tasks. */ + lt_t last_suspension; +#endif }; struct pfair_param; diff --git a/kernel/sched/litmus.c b/kernel/sched/litmus.c index fdb17e958adb..979f0a946220 100644 --- a/kernel/sched/litmus.c +++ b/kernel/sched/litmus.c @@ -218,6 +218,9 @@ static void dequeue_task_litmus(struct rq *rq, struct task_struct *p, int flags) { if (flags & DEQUEUE_SLEEP) { +#ifdef CONFIG_SCHED_TASK_TRACE + tsk_rt(p)->job_params.last_suspension = litmus_clock(); +#endif litmus->task_block(p); tsk_rt(p)->present = 0; sched_trace_task_block(p); -- cgit v1.2.2