aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-11-03 12:21:02 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-11-03 12:21:02 -0500
commit6a8420e414527560e2b946799eef374475cbda18 (patch)
treee43faa386eee38b22c74f133854d1af67d28d996 /litmus
parentf3ebf83bd0d3c53edba8034dfb03838c015d13fc (diff)
sched_trace: add task system release tracing
Diffstat (limited to 'litmus')
-rw-r--r--litmus/litmus.c2
-rw-r--r--litmus/sched_task_trace.c11
-rw-r--r--litmus/sync.c4
3 files changed, 16 insertions, 1 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 3d903c526d..51c98f3ea0 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -556,12 +556,12 @@ long litmus_admit_task(struct task_struct* tsk)
556 spin_unlock_irqrestore(&task_transition_lock, flags); 556 spin_unlock_irqrestore(&task_transition_lock, flags);
557 557
558 return retval; 558 return retval;
559
560} 559}
561 560
562void litmus_exit_task(struct task_struct* tsk) 561void litmus_exit_task(struct task_struct* tsk)
563{ 562{
564 if (is_realtime(tsk)) { 563 if (is_realtime(tsk)) {
564 sched_trace_task_completion(tsk, 1);
565 litmus->task_exit(tsk); 565 litmus->task_exit(tsk);
566 BUG_ON(heap_node_in_heap(tsk_rt(tsk)->heap_node)); 566 BUG_ON(heap_node_in_heap(tsk_rt(tsk)->heap_node));
567 kmem_cache_free(heap_node_cache, tsk_rt(tsk)->heap_node); 567 kmem_cache_free(heap_node_cache, tsk_rt(tsk)->heap_node);
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c
index fa71ef7bd0..32d1445967 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -179,3 +179,14 @@ feather_callback void do_sched_trace_task_resume(unsigned long id, unsigned long
179 put_record(rec); 179 put_record(rec);
180 } 180 }
181} 181}
182
183feather_callback void do_sched_trace_sys_release(unsigned long id, unsigned long _start)
184{
185 lt_t *start = (lt_t*) _start;
186 struct st_event_record* rec = get_record(ST_SYS_RELEASE, NULL);
187 if (rec) {
188 rec->data.sys_release.when = now();
189 rec->data.sys_release.release = *start;
190 put_record(rec);
191 }
192}
diff --git a/litmus/sync.c b/litmus/sync.c
index c16f1dd2ab..8b0ebea49a 100644
--- a/litmus/sync.c
+++ b/litmus/sync.c
@@ -14,6 +14,8 @@
14#include <litmus/sched_plugin.h> 14#include <litmus/sched_plugin.h>
15#include <litmus/jobs.h> 15#include <litmus/jobs.h>
16 16
17#include <litmus/sched_trace.h>
18
17static DECLARE_COMPLETION(ts_release); 19static DECLARE_COMPLETION(ts_release);
18 20
19static long do_wait_for_ts_release(void) 21static long do_wait_for_ts_release(void)
@@ -43,12 +45,14 @@ static long do_release_ts(lt_t start)
43 spin_lock_irqsave(&ts_release.wait.lock, flags); 45 spin_lock_irqsave(&ts_release.wait.lock, flags);
44 TRACE("<<<<<< synchronous task system release >>>>>>\n"); 46 TRACE("<<<<<< synchronous task system release >>>>>>\n");
45 47
48 sched_trace_sys_release(&start);
46 list_for_each(pos, &ts_release.wait.task_list) { 49 list_for_each(pos, &ts_release.wait.task_list) {
47 t = (struct task_struct*) list_entry(pos, 50 t = (struct task_struct*) list_entry(pos,
48 struct __wait_queue, 51 struct __wait_queue,
49 task_list)->private; 52 task_list)->private;
50 task_count++; 53 task_count++;
51 litmus->release_at(t, start + t->rt_param.task_params.phase); 54 litmus->release_at(t, start + t->rt_param.task_params.phase);
55 sched_trace_task_release(t);
52 } 56 }
53 57
54 spin_unlock_irqrestore(&ts_release.wait.lock, flags); 58 spin_unlock_irqrestore(&ts_release.wait.lock, flags);