aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2010-11-29 11:41:40 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2010-11-29 11:41:40 -0500
commitf2ddb884f2300cd7709237975206e5b9d9b18445 (patch)
tree76a932872cf8c42f780a3499fb76cee372ce0c91
parent4c5c517602f595092979716bacf565fc333ad5fe (diff)
Add sched_trace data for Apative EDZLwip-aedzl-revised
Added new trace event, st_task_completion_adaptive, to trace estimated execution time and estimation error when an AEDZL task completes.
-rw-r--r--include/litmus/sched_trace.h12
-rw-r--r--litmus/sched_aedzl.c1
-rw-r--r--litmus/sched_task_trace.c20
3 files changed, 33 insertions, 0 deletions
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h
index e1b0c9712b5f..237d1e1641d0 100644
--- a/include/litmus/sched_trace.h
+++ b/include/litmus/sched_trace.h
@@ -57,6 +57,12 @@ struct st_completion_data { /* A job completed. */
57 u8 __unused[3]; 57 u8 __unused[3];
58}; 58};
59 59
60struct st_completion_adaptive_data { /* Extra completion data for AEDZL */
61 u32 estimated_exe;
62 s32 accumulated_err;
63 u8 __unused[8];
64};
65
60struct st_block_data { /* A task blocks. */ 66struct st_block_data { /* A task blocks. */
61 u64 when; 67 u64 when;
62 u64 __unused; 68 u64 __unused;
@@ -86,6 +92,7 @@ typedef enum {
86 ST_BLOCK, 92 ST_BLOCK,
87 ST_RESUME, 93 ST_RESUME,
88 ST_SYS_RELEASE, 94 ST_SYS_RELEASE,
95 ST_COMPLETION_ADAPTIVE
89} st_event_record_type_t; 96} st_event_record_type_t;
90 97
91struct st_event_record { 98struct st_event_record {
@@ -100,6 +107,7 @@ struct st_event_record {
100 DATA(switch_to); 107 DATA(switch_to);
101 DATA(switch_away); 108 DATA(switch_away);
102 DATA(completion); 109 DATA(completion);
110 DATA(completion_adaptive);
103 DATA(block); 111 DATA(block);
104 DATA(resume); 112 DATA(resume);
105 DATA(sys_release); 113 DATA(sys_release);
@@ -136,6 +144,8 @@ feather_callback void do_sched_trace_task_switch_away(unsigned long id,
136feather_callback void do_sched_trace_task_completion(unsigned long id, 144feather_callback void do_sched_trace_task_completion(unsigned long id,
137 struct task_struct* task, 145 struct task_struct* task,
138 unsigned long forced); 146 unsigned long forced);
147feather_callback void do_sched_trace_task_completion_adaptive(unsigned long id,
148 struct task_struct* task);
139feather_callback void do_sched_trace_task_block(unsigned long id, 149feather_callback void do_sched_trace_task_block(unsigned long id,
140 struct task_struct* task); 150 struct task_struct* task);
141feather_callback void do_sched_trace_task_resume(unsigned long id, 151feather_callback void do_sched_trace_task_resume(unsigned long id,
@@ -175,6 +185,8 @@ feather_callback void do_sched_trace_sys_release(unsigned long id,
175/* when is a pointer, it does not need an explicit cast to unsigned long */ 185/* when is a pointer, it does not need an explicit cast to unsigned long */
176#define sched_trace_sys_release(when) \ 186#define sched_trace_sys_release(when) \
177 SCHED_TRACE(SCHED_TRACE_BASE_ID + 9, do_sched_trace_sys_release, when) 187 SCHED_TRACE(SCHED_TRACE_BASE_ID + 9, do_sched_trace_sys_release, when)
188#define sched_trace_task_completion_adaptive(t) \
189 SCHED_TRACE(SCHED_TRACE_BASE_ID + 10, do_sched_trace_task_completion_adaptive, t)
178 190
179#define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ 191#define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */
180 192
diff --git a/litmus/sched_aedzl.c b/litmus/sched_aedzl.c
index 4943e1ed7616..99c1ad02bbb4 100644
--- a/litmus/sched_aedzl.c
+++ b/litmus/sched_aedzl.c
@@ -514,6 +514,7 @@ static noinline void job_completion(struct task_struct *t, int forced)
514 BUG_ON(!t); 514 BUG_ON(!t);
515 515
516 sched_trace_task_completion(t, forced); 516 sched_trace_task_completion(t, forced);
517 sched_trace_task_completion_adaptive(t);
517 518
518 TRACE_TASK(t, "job_completion().\n"); 519 TRACE_TASK(t, "job_completion().\n");
519 520
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c
index 39a543e22d41..4ae14ac63c2e 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -169,6 +169,26 @@ feather_callback void do_sched_trace_task_completion(unsigned long id,
169 } 169 }
170} 170}
171 171
172feather_callback void do_sched_trace_task_completion_adaptive(unsigned long id,
173 unsigned long _task)
174{
175 struct task_struct *t = (struct task_struct*) _task;
176 struct st_event_record* rec = get_record(ST_COMPLETION_ADAPTIVE, t);
177 if (rec) {
178 s32 err;
179 rec->data.completion_adaptive.estimated_exe = get_exec_cost_est(t);
180
181 err = _fp_to_integer(_mul(tsk_rt(t)->zl_accum_err, _frac(get_rt_period(t), 1)));
182 if((err < 0) && _point(tsk_rt(t)->zl_accum_err) < 0)
183 {
184 err *= -1;
185 }
186 rec->data.completion_adaptive.accumulated_err = err;
187
188 put_record(rec);
189 }
190}
191
172feather_callback void do_sched_trace_task_block(unsigned long id, 192feather_callback void do_sched_trace_task_block(unsigned long id,
173 unsigned long _task) 193 unsigned long _task)
174{ 194{