aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2011-10-13 16:17:13 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2011-10-13 16:17:13 -0400
commit0836d628227984b343e5ed53e93ebed2252776f7 (patch)
treee5c73797197ecd232c047220fa1a3a718f19d42b
parent528b42be373ca461bd8538a58385a1515c98489c (diff)
parentf5001920607dee542ff99a058c13080307de0c73 (diff)
Merge branch 'wip-mc' of ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmus2010 into wip-mc
-rw-r--r--include/litmus/rt_domain.h4
-rw-r--r--include/litmus/sched_mc.h1
-rw-r--r--include/litmus/sched_trace.h3
-rw-r--r--include/litmus/trace.h7
-rw-r--r--kernel/sched.c2
-rw-r--r--litmus/sched_task_trace.c5
-rw-r--r--litmus/trace.c15
7 files changed, 31 insertions, 6 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h
index 59350fb78d4f..f98d47ccbb0b 100644
--- a/include/litmus/rt_domain.h
+++ b/include/litmus/rt_domain.h
@@ -31,10 +31,10 @@ typedef struct _rt_domain {
31 raw_spinlock_t release_lock; 31 raw_spinlock_t release_lock;
32 struct release_queue release_queue; 32 struct release_queue release_queue;
33 33
34#ifdef CONFIG_MERGE_TIMERS 34#if defined(CONFIG_MERGE_TIMERS)
35 struct event_group* event_group; 35 struct event_group* event_group;
36 int prio; 36 int prio;
37#elif CONFIG_RELEASE_MASTER 37#elif defined(CONFIG_RELEASE_MASTER)
38 int release_master; 38 int release_master;
39#endif 39#endif
40 40
diff --git a/include/litmus/sched_mc.h b/include/litmus/sched_mc.h
index 0a1b3f0c718c..740cc11be5d7 100644
--- a/include/litmus/sched_mc.h
+++ b/include/litmus/sched_mc.h
@@ -34,6 +34,7 @@ struct mc_data {
34#define tsk_mc_data(t) (tsk_rt(t)->mc_data) 34#define tsk_mc_data(t) (tsk_rt(t)->mc_data)
35#define tsk_mc_crit(t) (tsk_mc_data(t)->mc_task.crit) 35#define tsk_mc_crit(t) (tsk_mc_data(t)->mc_task.crit)
36#define is_ghost(t) (tsk_mc_data(t)->mc_job.is_ghost) 36#define is_ghost(t) (tsk_mc_data(t)->mc_job.is_ghost)
37
37#define TS "(%s/%d:%d:%s)" 38#define TS "(%s/%d:%d:%s)"
38#define TA(t) (t) ? tsk_mc_data(t) ? is_ghost(t) ? "ghost" : t->comm \ 39#define TA(t) (t) ? tsk_mc_data(t) ? is_ghost(t) ? "ghost" : t->comm \
39 : t->comm : "NULL", \ 40 : t->comm : "NULL", \
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h
index 7179fc2745ad..5cc05be8332f 100644
--- a/include/litmus/sched_trace.h
+++ b/include/litmus/sched_trace.h
@@ -24,7 +24,8 @@ struct st_param_data { /* regular params */
24 u32 phase; 24 u32 phase;
25 u8 partition; 25 u8 partition;
26 u8 class; 26 u8 class;
27 u8 __unused[2]; 27 u8 level;
28 u8 __unused[1];
28}; 29};
29 30
30struct st_release_data { /* A job is was/is going to be released. */ 31struct st_release_data { /* A job is was/is going to be released. */
diff --git a/include/litmus/trace.h b/include/litmus/trace.h
index 4fe4aadea8eb..e0c84716d87a 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,10 @@ 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_ID 115
117#define TS_LVLA_SCHED_END(t) TTIMESTAMP(TS_LVLA_SCHED_END_ID, t)
118
114 119
115#define TS_PLUGIN_SCHED_START /* TIMESTAMP(120) */ /* currently unused */ 120#define TS_PLUGIN_SCHED_START /* TIMESTAMP(120) */ /* currently unused */
116#define TS_PLUGIN_SCHED_END /* TIMESTAMP(121) */ 121#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/sched_task_trace.c b/litmus/sched_task_trace.c
index 5ef8d09ab41f..768a2a0f9d2f 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -14,7 +14,11 @@
14#include <litmus/sched_trace.h> 14#include <litmus/sched_trace.h>
15#include <litmus/feather_trace.h> 15#include <litmus/feather_trace.h>
16#include <litmus/ftdev.h> 16#include <litmus/ftdev.h>
17#include <litmus/rt_domain.h>
18#include <litmus/domain.h>
19#include <litmus/event_group.h>
17 20
21#include <litmus/sched_mc.h>
18 22
19#define NO_EVENTS (1 << CONFIG_SCHED_TASK_TRACE_SHIFT) 23#define NO_EVENTS (1 << CONFIG_SCHED_TASK_TRACE_SHIFT)
20 24
@@ -132,6 +136,7 @@ feather_callback void do_sched_trace_task_param(unsigned long id, unsigned long
132 rec->data.param.phase = get_rt_phase(t); 136 rec->data.param.phase = get_rt_phase(t);
133 rec->data.param.partition = get_partition(t); 137 rec->data.param.partition = get_partition(t);
134 rec->data.param.class = get_class(t); 138 rec->data.param.class = get_class(t);
139 rec->data.param.level = (tsk_mc_data(t) ? tsk_mc_crit(t) : -1);
135 put_record(rec); 140 put_record(rec);
136 } 141 }
137} 142}
diff --git a/litmus/trace.c b/litmus/trace.c
index 49f8246cda50..1d4593aec71d 100644
--- a/litmus/trace.c
+++ b/litmus/trace.c
@@ -5,6 +5,10 @@
5#include <litmus/litmus.h> 5#include <litmus/litmus.h>
6#include <litmus/trace.h> 6#include <litmus/trace.h>
7 7
8#include <litmus/domain.h>
9#include <litmus/event_group.h>
10#include <litmus/sched_mc.h>
11
8/******************************************************************************/ 12/******************************************************************************/
9/* Allocation */ 13/* Allocation */
10/******************************************************************************/ 14/******************************************************************************/
@@ -81,8 +85,15 @@ feather_callback void save_timestamp_def(unsigned long event,
81feather_callback void save_timestamp_task(unsigned long event, 85feather_callback void save_timestamp_task(unsigned long event,
82 unsigned long t_ptr) 86 unsigned long t_ptr)
83{ 87{
84 int rt = is_realtime((struct task_struct *) t_ptr); 88 struct task_struct *ts = (struct task_struct*) t_ptr;
85 __save_timestamp(event, rt ? TSK_RT : TSK_BE); 89 int rt = is_realtime(ts);
90 uint8_t type = rt ? TSK_RT : TSK_BE;
91
92 if (TS_LVLA_SCHED_END_ID == event) {
93 if (rt && CRIT_LEVEL_A == tsk_mc_crit(ts))
94 type = TSK_LVLA;
95 }
96 __save_timestamp(event, type);
86} 97}
87 98
88feather_callback void save_timestamp_cpu(unsigned long event, 99feather_callback void save_timestamp_cpu(unsigned long event,