diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-10-23 16:31:22 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-10-23 16:31:22 -0400 |
commit | c1db2ad7a69a86fb77674a2786256a4418528657 (patch) | |
tree | b499d965d163089cffb62d7cc45e9664fe601183 | |
parent | c285117cf88204007e4fce672b964c6ab015e6bc (diff) |
Output additional data in MC completion records.
-rw-r--r-- | include/litmus/rt_param.h | 2 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 4 | ||||
-rw-r--r-- | kernel/sched.c | 8 | ||||
-rw-r--r-- | litmus/rt_domain.c | 10 | ||||
-rw-r--r-- | litmus/sched_mc.c | 32 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 6 |
6 files changed, 38 insertions, 24 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 2a5cdecb4f46..42f5b4f66a3d 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -277,6 +277,8 @@ struct rt_param { | |||
277 | 277 | ||
278 | lt_t load; | 278 | lt_t load; |
279 | lt_t flush; | 279 | lt_t flush; |
280 | int load_work; | ||
281 | int flush_work; | ||
280 | 282 | ||
281 | lt_t max_exec_time; | 283 | lt_t max_exec_time; |
282 | lt_t tot_exec_time; | 284 | lt_t tot_exec_time; |
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index 2f15da3c9e36..cb8758f8aebf 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -52,7 +52,9 @@ struct st_switch_away_data { /* A process was switched away from on a given CPU. | |||
52 | }; | 52 | }; |
53 | 53 | ||
54 | struct st_completion_data { /* A job completed. */ | 54 | struct st_completion_data { /* A job completed. */ |
55 | u64 when; | 55 | u32 exec; |
56 | u16 flush_work; | ||
57 | u16 load_work; | ||
56 | u32 flush; | 58 | u32 flush; |
57 | u32 load; | 59 | u32 load; |
58 | /* u8 forced:1; /\* Set to 1 if job overran and kernel advanced to the */ | 60 | /* u8 forced:1; /\* Set to 1 if job overran and kernel advanced to the */ |
diff --git a/kernel/sched.c b/kernel/sched.c index 2739b3339ffb..b71190c2540f 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4337,10 +4337,6 @@ need_resched: | |||
4337 | * if the previous one is no longer valid after CTX. | 4337 | * if the previous one is no longer valid after CTX. |
4338 | */ | 4338 | */ |
4339 | litmus_need_resched_nonpreemptible: | 4339 | litmus_need_resched_nonpreemptible: |
4340 | TS_SCHED_START; | ||
4341 | TS_LVLA_SCHED_START; | ||
4342 | TS_LVLB_SCHED_START; | ||
4343 | TS_LVLC_SCHED_START; | ||
4344 | sched_trace_task_switch_away(prev); | 4340 | sched_trace_task_switch_away(prev); |
4345 | 4341 | ||
4346 | schedule_debug(prev); | 4342 | schedule_debug(prev); |
@@ -4399,10 +4395,6 @@ litmus_need_resched_nonpreemptible: | |||
4399 | rq->curr = next; | 4395 | rq->curr = next; |
4400 | ++*switch_count; | 4396 | ++*switch_count; |
4401 | 4397 | ||
4402 | TS_LVLA_SCHED_END(next); | ||
4403 | TS_LVLB_SCHED_END(next); | ||
4404 | TS_LVLC_SCHED_END(next); | ||
4405 | TS_SCHED_END(next); | ||
4406 | TS_CXS_START(next); | 4398 | TS_CXS_START(next); |
4407 | context_switch(rq, prev, next); /* unlocks the rq */ | 4399 | context_switch(rq, prev, next); /* unlocks the rq */ |
4408 | TS_CXS_END(current); | 4400 | TS_CXS_END(current); |
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c index 098ea000f5de..816361f9f177 100644 --- a/litmus/rt_domain.c +++ b/litmus/rt_domain.c | |||
@@ -58,20 +58,20 @@ static void do_release(struct release_heap *rh) | |||
58 | { | 58 | { |
59 | unsigned long flags; | 59 | unsigned long flags; |
60 | 60 | ||
61 | TS_RELEASE_LATENCY(rh->release_time); | ||
62 | |||
61 | #ifdef CONFIG_PLUGIN_MC | 63 | #ifdef CONFIG_PLUGIN_MC |
62 | if (CRIT_LEVEL_B == rh->dom->level) { | 64 | if (CRIT_LEVEL_B == rh->dom->level) { |
63 | TS_LVLB_RELEASE_START; | 65 | TS_LVLB_RELEASE_START; |
64 | } else { | 66 | } else { |
65 | TS_LVLC_RELEASE_START; | 67 | TS_LVLC_RELEASE_START; |
66 | } | 68 | } |
69 | #else | ||
70 | TS_RELEASE_START; | ||
67 | #endif | 71 | #endif |
68 | 72 | ||
69 | TS_RELEASE_LATENCY(rh->release_time); | ||
70 | |||
71 | VTRACE("on_release_timer starts.\n"); | 73 | VTRACE("on_release_timer starts.\n"); |
72 | 74 | ||
73 | TS_RELEASE_START; | ||
74 | |||
75 | raw_spin_lock_irqsave(&rh->dom->release_lock, flags); | 75 | raw_spin_lock_irqsave(&rh->dom->release_lock, flags); |
76 | VTRACE("CB has the release_lock 0x%p\n", &rh->dom->release_lock); | 76 | VTRACE("CB has the release_lock 0x%p\n", &rh->dom->release_lock); |
77 | /* remove from release queue */ | 77 | /* remove from release queue */ |
@@ -88,6 +88,8 @@ static void do_release(struct release_heap *rh) | |||
88 | } else { | 88 | } else { |
89 | TS_LVLC_RELEASE_END; | 89 | TS_LVLC_RELEASE_END; |
90 | } | 90 | } |
91 | #else | ||
92 | TS_RELEASE_END; | ||
91 | #endif | 93 | #endif |
92 | } | 94 | } |
93 | 95 | ||
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c index d7965aeda4c4..22d3d376d7d4 100644 --- a/litmus/sched_mc.c +++ b/litmus/sched_mc.c | |||
@@ -1289,7 +1289,7 @@ static void process_signals(struct cpu_entry *entry) | |||
1289 | static struct task_struct* mc_schedule(struct task_struct* prev) | 1289 | static struct task_struct* mc_schedule(struct task_struct* prev) |
1290 | { | 1290 | { |
1291 | lt_t start; | 1291 | lt_t start; |
1292 | int out_of_time, sleep, preempt, exists, blocks, global, lower; | 1292 | int out_of_time, sleep, preempt, exists, blocks, global, lower, work; |
1293 | struct cpu_entry* entry = &__get_cpu_var(cpus); | 1293 | struct cpu_entry* entry = &__get_cpu_var(cpus); |
1294 | struct task_struct *next = NULL; | 1294 | struct task_struct *next = NULL; |
1295 | 1295 | ||
@@ -1302,6 +1302,20 @@ static struct task_struct* mc_schedule(struct task_struct* prev) | |||
1302 | low_prio_arrival(entry->will_schedule); | 1302 | low_prio_arrival(entry->will_schedule); |
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | |||
1306 | if (prev && tsk_mc_crit(prev) == CRIT_LEVEL_B && | ||
1307 | is_realtime(prev) && get_rt_job(prev) > 1 && lock_cache) { | ||
1308 | start = litmus_clock(); | ||
1309 | work = color_sched_out_task(prev); | ||
1310 | tsk_rt(prev)->flush = litmus_clock() - start; | ||
1311 | tsk_rt(prev)->flush_work = work; | ||
1312 | } | ||
1313 | |||
1314 | TS_SCHED_START; | ||
1315 | TS_LVLA_SCHED_START; | ||
1316 | TS_LVLB_SCHED_START; | ||
1317 | TS_LVLC_SCHED_START; | ||
1318 | |||
1305 | raw_spin_lock(&entry->lock); | 1319 | raw_spin_lock(&entry->lock); |
1306 | 1320 | ||
1307 | BUG_ON(entry->scheduled && entry->scheduled != prev); | 1321 | BUG_ON(entry->scheduled && entry->scheduled != prev); |
@@ -1313,14 +1327,6 @@ static struct task_struct* mc_schedule(struct task_struct* prev) | |||
1313 | update_server_time(entry->scheduled); | 1327 | update_server_time(entry->scheduled); |
1314 | } | 1328 | } |
1315 | 1329 | ||
1316 | if (prev && tsk_mc_crit(prev) == CRIT_LEVEL_B && | ||
1317 | is_realtime(prev) && get_rt_job(prev) > 1 && lock_cache) { | ||
1318 | start = litmus_clock(); | ||
1319 | color_sched_out_task(prev); | ||
1320 | tsk_rt(prev)->flush = litmus_clock() - start; | ||
1321 | } | ||
1322 | |||
1323 | |||
1324 | /* Determine state */ | 1330 | /* Determine state */ |
1325 | exists = entry->scheduled != NULL; | 1331 | exists = entry->scheduled != NULL; |
1326 | blocks = exists && !is_running(entry->scheduled); | 1332 | blocks = exists && !is_running(entry->scheduled); |
@@ -1377,11 +1383,17 @@ static struct task_struct* mc_schedule(struct task_struct* prev) | |||
1377 | 1383 | ||
1378 | raw_spin_unlock(&entry->lock); | 1384 | raw_spin_unlock(&entry->lock); |
1379 | 1385 | ||
1386 | TS_LVLA_SCHED_END(next); | ||
1387 | TS_LVLB_SCHED_END(next); | ||
1388 | TS_LVLC_SCHED_END(next); | ||
1389 | TS_SCHED_END(next); | ||
1390 | |||
1380 | if (next != prev) { | 1391 | if (next != prev) { |
1381 | if (next && tsk_mc_crit(next) == CRIT_LEVEL_B && lock_cache) { | 1392 | if (next && tsk_mc_crit(next) == CRIT_LEVEL_B && lock_cache) { |
1382 | start = litmus_clock(); | 1393 | start = litmus_clock(); |
1383 | color_sched_in_task(next); | 1394 | work = color_sched_in_task(next); |
1384 | tsk_rt(next)->load = litmus_clock() - start; | 1395 | tsk_rt(next)->load = litmus_clock() - start; |
1396 | tsk_rt(next)->load_work = work; | ||
1385 | } | 1397 | } |
1386 | } | 1398 | } |
1387 | 1399 | ||
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index 9612ed5831a1..5a196e1b0fbd 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -198,11 +198,15 @@ feather_callback void do_sched_trace_task_completion(unsigned long id, | |||
198 | struct task_struct *t = (struct task_struct*) _task; | 198 | struct task_struct *t = (struct task_struct*) _task; |
199 | struct st_event_record* rec = get_record(ST_COMPLETION, t); | 199 | struct st_event_record* rec = get_record(ST_COMPLETION, t); |
200 | if (rec) { | 200 | if (rec) { |
201 | rec->data.completion.when = tsk_rt(t)->user_job.exec_time; | 201 | rec->data.completion.exec = tsk_rt(t)->user_job.exec_time; |
202 | rec->data.completion.flush = tsk_rt(t)->flush; | 202 | rec->data.completion.flush = tsk_rt(t)->flush; |
203 | rec->data.completion.load = tsk_rt(t)->load; | 203 | rec->data.completion.load = tsk_rt(t)->load; |
204 | rec->data.completion.flush_work = tsk_rt(t)->flush_work; | ||
205 | rec->data.completion.load_work = tsk_rt(t)->load_work; | ||
204 | tsk_rt(t)->flush = 0; | 206 | tsk_rt(t)->flush = 0; |
205 | tsk_rt(t)->load = 0; | 207 | tsk_rt(t)->load = 0; |
208 | tsk_rt(t)->flush_work = 0; | ||
209 | tsk_rt(t)->load_work = 0; | ||
206 | put_record(rec); | 210 | put_record(rec); |
207 | } | 211 | } |
208 | } | 212 | } |