diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2011-10-11 23:34:45 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2011-10-11 23:34:45 -0400 |
commit | 9bbedd1b59b55650767395eabf093e0400d4bd97 (patch) | |
tree | 0e82521f31f5b94dcf34aec3a2d01a09e03eb0a8 | |
parent | 657e11dcb9ec8e8ed7ffcbd490d845072bcb4be4 (diff) |
add level-A scheduling event
-rw-r--r-- | include/litmus/trace.h | 6 | ||||
-rw-r--r-- | kernel/sched.c | 2 | ||||
-rw-r--r-- | litmus/trace.c | 12 |
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 @@ | |||
12 | enum task_type_marker { | 12 | enum 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 | ||
18 | struct timestamp { | 19 | struct 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); |
3811 | need_resched_nonpreemptible: | 3811 | need_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, | |||
81 | feather_callback void save_timestamp_task(unsigned long event, | 82 | feather_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 | ||
88 | feather_callback void save_timestamp_cpu(unsigned long event, | 96 | feather_callback void save_timestamp_cpu(unsigned long event, |