aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/litmus/trace.h6
-rw-r--r--kernel/sched.c2
-rw-r--r--litmus/trace.c12
3 files changed, 17 insertions, 3 deletions
diff --git a/include/litmus/trace.h b/include/litmus/trace.h
index 4fe4aadea8eb..db91ff69b51e 100644
--- a/include/litmus/trace.h
+++ b/include/litmus/trace.h
@@ -12,7 +12,8 @@
12enum task_type_marker { 12enum task_type_marker {
13 TSK_BE, 13 TSK_BE,
14 TSK_RT, 14 TSK_RT,
15 TSK_UNKNOWN 15 TSK_UNKNOWN,
16 TSK_LVLA
16}; 17};
17 18
18struct timestamp { 19struct timestamp {
@@ -111,6 +112,9 @@ feather_callback void save_timestamp_time(unsigned long event, unsigned long tim
111#define TS_LVLA_RELEASE_START DTIMESTAMP(112, TSK_RT) 112#define TS_LVLA_RELEASE_START DTIMESTAMP(112, TSK_RT)
112#define TS_LVLA_RELEASE_END DTIMESTAMP(113, TSK_RT) 113#define TS_LVLA_RELEASE_END DTIMESTAMP(113, TSK_RT)
113 114
115#define TS_LVLA_SCHED_START DTIMESTAMP(114, TSK_UNKNOWN)
116#define TS_LVLA_SCHED_END(t) TTIMESTAMP(115, t)
117
114 118
115#define TS_PLUGIN_SCHED_START /* TIMESTAMP(120) */ /* currently unused */ 119#define TS_PLUGIN_SCHED_START /* TIMESTAMP(120) */ /* currently unused */
116#define TS_PLUGIN_SCHED_END /* TIMESTAMP(121) */ 120#define TS_PLUGIN_SCHED_END /* TIMESTAMP(121) */
diff --git a/kernel/sched.c b/kernel/sched.c
index c5d775079027..71907dcd8112 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3810,6 +3810,7 @@ need_resched:
3810 release_kernel_lock(prev); 3810 release_kernel_lock(prev);
3811need_resched_nonpreemptible: 3811need_resched_nonpreemptible:
3812 TS_SCHED_START; 3812 TS_SCHED_START;
3813 TS_LVLA_SCHED_START;
3813 sched_trace_task_switch_away(prev); 3814 sched_trace_task_switch_away(prev);
3814 3815
3815 schedule_debug(prev); 3816 schedule_debug(prev);
@@ -3859,6 +3860,7 @@ need_resched_nonpreemptible:
3859 rq->curr = next; 3860 rq->curr = next;
3860 ++*switch_count; 3861 ++*switch_count;
3861 3862
3863 TS_LVLA_SCHED_END(next);
3862 TS_SCHED_END(next); 3864 TS_SCHED_END(next);
3863 TS_CXS_START(next); 3865 TS_CXS_START(next);
3864 context_switch(rq, prev, next); /* unlocks the rq */ 3866 context_switch(rq, prev, next); /* unlocks the rq */
diff --git a/litmus/trace.c b/litmus/trace.c
index 49f8246cda50..417422d2f16d 100644
--- a/litmus/trace.c
+++ b/litmus/trace.c
@@ -4,6 +4,7 @@
4#include <litmus/ftdev.h> 4#include <litmus/ftdev.h>
5#include <litmus/litmus.h> 5#include <litmus/litmus.h>
6#include <litmus/trace.h> 6#include <litmus/trace.h>
7#include <litmus/sched_mc.h>
7 8
8/******************************************************************************/ 9/******************************************************************************/
9/* Allocation */ 10/* Allocation */
@@ -81,8 +82,15 @@ feather_callback void save_timestamp_def(unsigned long event,
81feather_callback void save_timestamp_task(unsigned long event, 82feather_callback void save_timestamp_task(unsigned long event,
82 unsigned long t_ptr) 83 unsigned long t_ptr)
83{ 84{
84 int rt = is_realtime((struct task_struct *) t_ptr); 85 struct task_struct *ts = t_ptr;
85 __save_timestamp(event, rt ? TSK_RT : TSK_BE); 86 int rt = is_realtime(ts);
87 uint8_t type = rt ? TSK_RT : TSK_BE;
88
89 if (TS_LVLA_SCHED_END == event) {
90 if (rt && CRIT_LEVEL_A == tsk_mc_crit(ts))
91 type = TSK_LVLA;
92 }
93 __save_timestamp(event, type);
86} 94}
87 95
88feather_callback void save_timestamp_cpu(unsigned long event, 96feather_callback void save_timestamp_cpu(unsigned long event,