diff options
-rw-r--r-- | include/litmus/rt_domain.h | 8 | ||||
-rw-r--r-- | litmus/jobs.c | 10 | ||||
-rw-r--r-- | litmus/litmus.c | 5 | ||||
-rw-r--r-- | litmus/preempt.c | 2 | ||||
-rw-r--r-- | litmus/rt_domain.c | 9 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 7 | ||||
-rw-r--r-- | litmus/trace.c | 8 |
7 files changed, 45 insertions, 4 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index cba96e25f39d..44a7c4cd52c0 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
@@ -7,8 +7,14 @@ | |||
7 | 7 | ||
8 | #include <litmus/bheap.h> | 8 | #include <litmus/bheap.h> |
9 | #include <litmus/domain.h> | 9 | #include <litmus/domain.h> |
10 | |||
11 | #ifdef CONFIG_MERGE_TIEMRS | ||
10 | #include <litmus/event_group.h> | 12 | #include <litmus/event_group.h> |
13 | #endif | ||
14 | |||
15 | #ifdef CONFIG_PLUGIN_MC | ||
11 | #include <litmus/sched_mc.h> | 16 | #include <litmus/sched_mc.h> |
17 | #endif | ||
12 | 18 | ||
13 | #define RELEASE_QUEUE_SLOTS 127 /* prime */ | 19 | #define RELEASE_QUEUE_SLOTS 127 /* prime */ |
14 | 20 | ||
@@ -53,7 +59,9 @@ typedef struct _rt_domain { | |||
53 | /* how are tasks ordered in the ready queue? */ | 59 | /* how are tasks ordered in the ready queue? */ |
54 | bheap_prio_t order; | 60 | bheap_prio_t order; |
55 | 61 | ||
62 | #ifdef CONFIG_PLUGIN_MC | ||
56 | enum crit_level level; | 63 | enum crit_level level; |
64 | #endif | ||
57 | } rt_domain_t; | 65 | } rt_domain_t; |
58 | 66 | ||
59 | struct release_heap { | 67 | struct release_heap { |
diff --git a/litmus/jobs.c b/litmus/jobs.c index 18388e1ca98d..6ba40db9639f 100644 --- a/litmus/jobs.c +++ b/litmus/jobs.c | |||
@@ -9,8 +9,16 @@ | |||
9 | #include <litmus/trace.h> | 9 | #include <litmus/trace.h> |
10 | #include <litmus/sched_trace.h> | 10 | #include <litmus/sched_trace.h> |
11 | #include <litmus/domain.h> | 11 | #include <litmus/domain.h> |
12 | |||
13 | #ifdef CONFIG_MERGE_TIMERS | ||
12 | #include <litmus/event_group.h> | 14 | #include <litmus/event_group.h> |
15 | #endif | ||
16 | |||
17 | #ifdef CONFIG_PLUGIN_MC | ||
13 | #include <litmus/sched_mc.h> | 18 | #include <litmus/sched_mc.h> |
19 | #else | ||
20 | #define TRACE_MC_TASK(t, fmt, args...) TRACE_TASK(t, fmt, ##args) | ||
21 | #endif | ||
14 | 22 | ||
15 | static inline void setup_release(struct task_struct *t, struct rt_job *job, | 23 | static inline void setup_release(struct task_struct *t, struct rt_job *job, |
16 | lt_t release) | 24 | lt_t release) |
@@ -49,8 +57,10 @@ void setup_user_release(struct task_struct *t, lt_t release) | |||
49 | { | 57 | { |
50 | setup_release(t, &tsk_rt(t)->user_job, release); | 58 | setup_release(t, &tsk_rt(t)->user_job, release); |
51 | TRACE_MC_TASK(t, "user rel=%llu, dead=%llu\n", get_user_release(t), get_user_deadline(t)); | 59 | TRACE_MC_TASK(t, "user rel=%llu, dead=%llu\n", get_user_release(t), get_user_deadline(t)); |
60 | #ifdef CONFIG_PLUGIN_MC | ||
52 | if (CRIT_LEVEL_A != tsk_mc_crit(t)) | 61 | if (CRIT_LEVEL_A != tsk_mc_crit(t)) |
53 | sched_trace_task_release(t); | 62 | sched_trace_task_release(t); |
63 | #endif | ||
54 | 64 | ||
55 | } | 65 | } |
56 | 66 | ||
diff --git a/litmus/litmus.c b/litmus/litmus.c index cb41548d3e2d..07d9d70346a0 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -13,11 +13,14 @@ | |||
13 | #include <litmus/litmus.h> | 13 | #include <litmus/litmus.h> |
14 | #include <litmus/bheap.h> | 14 | #include <litmus/bheap.h> |
15 | #include <litmus/trace.h> | 15 | #include <litmus/trace.h> |
16 | #include <litmus/event_group.h> | ||
17 | #include <litmus/rt_domain.h> | 16 | #include <litmus/rt_domain.h> |
18 | #include <litmus/litmus_proc.h> | 17 | #include <litmus/litmus_proc.h> |
19 | #include <litmus/sched_trace.h> | 18 | #include <litmus/sched_trace.h> |
20 | 19 | ||
20 | #ifdef CONFIG_MERGE_TIMERS | ||
21 | #include <litmus/event_group.h> | ||
22 | #endif | ||
23 | |||
21 | #ifdef CONFIG_PLUGIN_MC | 24 | #ifdef CONFIG_PLUGIN_MC |
22 | #include <linux/pid.h> | 25 | #include <linux/pid.h> |
23 | #include <linux/hrtimer.h> | 26 | #include <linux/hrtimer.h> |
diff --git a/litmus/preempt.c b/litmus/preempt.c index 3606cd7ffae7..8f1304afea26 100644 --- a/litmus/preempt.c +++ b/litmus/preempt.c | |||
@@ -6,8 +6,6 @@ | |||
6 | /* The rescheduling state of each processor. | 6 | /* The rescheduling state of each processor. |
7 | */ | 7 | */ |
8 | DEFINE_PER_CPU_SHARED_ALIGNED(atomic_t, resched_state); | 8 | DEFINE_PER_CPU_SHARED_ALIGNED(atomic_t, resched_state); |
9 | #define TRACE_TASK(t, fmt, args...) | ||
10 | #define TRACE(fmt, args...) | ||
11 | 9 | ||
12 | void sched_state_will_schedule(struct task_struct* tsk) | 10 | void sched_state_will_schedule(struct task_struct* tsk) |
13 | { | 11 | { |
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c index 98a30b88baab..b70c94695a58 100644 --- a/litmus/rt_domain.c +++ b/litmus/rt_domain.c | |||
@@ -12,13 +12,16 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | 13 | ||
14 | #include <litmus/litmus.h> | 14 | #include <litmus/litmus.h> |
15 | #include <litmus/event_group.h> | ||
16 | #include <litmus/sched_plugin.h> | 15 | #include <litmus/sched_plugin.h> |
17 | #include <litmus/sched_trace.h> | 16 | #include <litmus/sched_trace.h> |
18 | #include <litmus/rt_domain.h> | 17 | #include <litmus/rt_domain.h> |
19 | #include <litmus/trace.h> | 18 | #include <litmus/trace.h> |
20 | #include <litmus/bheap.h> | 19 | #include <litmus/bheap.h> |
21 | 20 | ||
21 | #ifdef CONFIG_MERGE_TIMERS | ||
22 | #include <litmus/event_group.h> | ||
23 | #endif | ||
24 | |||
22 | /* Uncomment when debugging timer races... */ | 25 | /* Uncomment when debugging timer races... */ |
23 | #if 1 | 26 | #if 1 |
24 | #define VTRACE_TASK TRACE_TASK | 27 | #define VTRACE_TASK TRACE_TASK |
@@ -53,11 +56,13 @@ static void do_release(struct release_heap *rh) | |||
53 | { | 56 | { |
54 | unsigned long flags; | 57 | unsigned long flags; |
55 | 58 | ||
59 | #ifdef CONFIG_PLUGIN_MC | ||
56 | if (CRIT_LEVEL_B == rh->dom->level) { | 60 | if (CRIT_LEVEL_B == rh->dom->level) { |
57 | TS_LVLB_RELEASE_START; | 61 | TS_LVLB_RELEASE_START; |
58 | } else { | 62 | } else { |
59 | TS_LVLC_RELEASE_START; | 63 | TS_LVLC_RELEASE_START; |
60 | } | 64 | } |
65 | #endif | ||
61 | 66 | ||
62 | TS_RELEASE_LATENCY(rh->release_time); | 67 | TS_RELEASE_LATENCY(rh->release_time); |
63 | 68 | ||
@@ -75,11 +80,13 @@ static void do_release(struct release_heap *rh) | |||
75 | /* call release callback */ | 80 | /* call release callback */ |
76 | rh->dom->release_jobs(rh->dom, &rh->heap); | 81 | rh->dom->release_jobs(rh->dom, &rh->heap); |
77 | 82 | ||
83 | #ifdef CONFIG_PLUGIN_MC | ||
78 | if (CRIT_LEVEL_B == rh->dom->level) { | 84 | if (CRIT_LEVEL_B == rh->dom->level) { |
79 | TS_LVLB_RELEASE_END; | 85 | TS_LVLB_RELEASE_END; |
80 | } else { | 86 | } else { |
81 | TS_LVLC_RELEASE_END; | 87 | TS_LVLC_RELEASE_END; |
82 | } | 88 | } |
89 | #endif | ||
83 | } | 90 | } |
84 | 91 | ||
85 | #ifdef CONFIG_MERGE_TIMERS | 92 | #ifdef CONFIG_MERGE_TIMERS |
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index a5e7f799c1a9..d6487d3b7837 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -16,9 +16,14 @@ | |||
16 | #include <litmus/ftdev.h> | 16 | #include <litmus/ftdev.h> |
17 | #include <litmus/rt_domain.h> | 17 | #include <litmus/rt_domain.h> |
18 | #include <litmus/domain.h> | 18 | #include <litmus/domain.h> |
19 | |||
20 | #ifdef CONFIG_MERGE_TIMERS | ||
19 | #include <litmus/event_group.h> | 21 | #include <litmus/event_group.h> |
22 | #endif | ||
20 | 23 | ||
24 | #ifdef CONFIG_PLUGIN_MC | ||
21 | #include <litmus/sched_mc.h> | 25 | #include <litmus/sched_mc.h> |
26 | #endif | ||
22 | 27 | ||
23 | #define NO_EVENTS (1 << CONFIG_SCHED_TASK_TRACE_SHIFT) | 28 | #define NO_EVENTS (1 << CONFIG_SCHED_TASK_TRACE_SHIFT) |
24 | 29 | ||
@@ -136,7 +141,9 @@ feather_callback void do_sched_trace_task_param(unsigned long id, unsigned long | |||
136 | rec->data.param.phase = get_rt_phase(t); | 141 | rec->data.param.phase = get_rt_phase(t); |
137 | rec->data.param.partition = get_partition(t); | 142 | rec->data.param.partition = get_partition(t); |
138 | rec->data.param.class = get_class(t); | 143 | rec->data.param.class = get_class(t); |
144 | #ifdef CONFIG_PLUGIN_MC | ||
139 | rec->data.param.level = (tsk_mc_data(t) ? tsk_mc_crit(t) : -1); | 145 | rec->data.param.level = (tsk_mc_data(t) ? tsk_mc_crit(t) : -1); |
146 | #endif | ||
140 | put_record(rec); | 147 | put_record(rec); |
141 | } | 148 | } |
142 | } | 149 | } |
diff --git a/litmus/trace.c b/litmus/trace.c index 4722ffa443c6..e3883ca61590 100644 --- a/litmus/trace.c +++ b/litmus/trace.c | |||
@@ -7,8 +7,14 @@ | |||
7 | #include <litmus/trace.h> | 7 | #include <litmus/trace.h> |
8 | 8 | ||
9 | #include <litmus/domain.h> | 9 | #include <litmus/domain.h> |
10 | |||
11 | #ifdef CONFIG_MERGE_TIMERS | ||
10 | #include <litmus/event_group.h> | 12 | #include <litmus/event_group.h> |
13 | #endif | ||
14 | |||
15 | #ifdef CONFIG_PLUGIN_MC | ||
11 | #include <litmus/sched_mc.h> | 16 | #include <litmus/sched_mc.h> |
17 | #endif | ||
12 | 18 | ||
13 | /******************************************************************************/ | 19 | /******************************************************************************/ |
14 | /* Allocation */ | 20 | /* Allocation */ |
@@ -135,6 +141,7 @@ feather_callback void save_timestamp_task(unsigned long event, | |||
135 | int rt = is_realtime(ts); | 141 | int rt = is_realtime(ts); |
136 | uint8_t type = rt ? TSK_RT : TSK_BE; | 142 | uint8_t type = rt ? TSK_RT : TSK_BE; |
137 | 143 | ||
144 | #ifdef CONFIG_PLUGIN_MC | ||
138 | if (TS_LVLA_SCHED_END_ID == event) { | 145 | if (TS_LVLA_SCHED_END_ID == event) { |
139 | if (rt && CRIT_LEVEL_A == tsk_mc_crit(ts)) | 146 | if (rt && CRIT_LEVEL_A == tsk_mc_crit(ts)) |
140 | type = TSK_LVLA; | 147 | type = TSK_LVLA; |
@@ -145,6 +152,7 @@ feather_callback void save_timestamp_task(unsigned long event, | |||
145 | if (rt && CRIT_LEVEL_C == tsk_mc_crit(ts)) | 152 | if (rt && CRIT_LEVEL_C == tsk_mc_crit(ts)) |
146 | type = TSK_LVLC; | 153 | type = TSK_LVLC; |
147 | } | 154 | } |
155 | #endif | ||
148 | __save_timestamp(event, type); | 156 | __save_timestamp(event, type); |
149 | } | 157 | } |
150 | 158 | ||