diff options
author | Namhoon Kim <namhoonk@cs.unc.edu> | 2016-04-30 19:46:44 -0400 |
---|---|---|
committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2016-04-30 19:46:44 -0400 |
commit | fc35ca6c9592d43b067a45c49f98cf4b5b361b87 (patch) | |
tree | 9a7d7d6eec9ea24bea317de137cc0431ff54cb8b /include | |
parent | f0e07f0e5cba027377c57e1aa25101023640c62b (diff) |
PGM supportwip-mc2-new
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/pgm.h | 12 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 15 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 39 | ||||
-rw-r--r-- | include/trace/events/litmus.h | 53 |
4 files changed, 117 insertions, 2 deletions
diff --git a/include/litmus/pgm.h b/include/litmus/pgm.h new file mode 100644 index 000000000000..5682a76b3acb --- /dev/null +++ b/include/litmus/pgm.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _LITMUS_PGM_H_ | ||
2 | #define _LITMUS_PGM_H_ | ||
3 | |||
4 | #include <litmus/litmus.h> | ||
5 | |||
6 | #define is_pgm_waiting(t) (tsk_rt(t)->ctrl_page && tsk_rt(t)->ctrl_page->pgm_waiting) | ||
7 | #define is_pgm_sending(t) (tsk_rt(t)->ctrl_page && tsk_rt(t)->ctrl_page->pgm_sending) | ||
8 | #define is_pgm_satisfied(t) (tsk_rt(t)->ctrl_page && tsk_rt(t)->ctrl_page->pgm_satisfied) | ||
9 | |||
10 | int setup_pgm_release(struct task_struct* t); | ||
11 | |||
12 | #endif | ||
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index a3dde39753bd..fa0f5f4647bd 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -51,6 +51,14 @@ typedef enum { | |||
51 | TASK_EARLY | 51 | TASK_EARLY |
52 | } release_policy_t; | 52 | } release_policy_t; |
53 | 53 | ||
54 | typedef enum { | ||
55 | PGM_NOT_A_NODE, | ||
56 | PGM_SRC, | ||
57 | PGM_SINK, | ||
58 | PGM_SRC_SINK, | ||
59 | PGM_INTERNAL | ||
60 | } pgm_node_type_t; | ||
61 | |||
54 | /* We use the common priority interpretation "lower index == higher priority", | 62 | /* We use the common priority interpretation "lower index == higher priority", |
55 | * which is commonly used in fixed-priority schedulability analysis papers. | 63 | * which is commonly used in fixed-priority schedulability analysis papers. |
56 | * So, a numerically lower priority value implies higher scheduling priority, | 64 | * So, a numerically lower priority value implies higher scheduling priority, |
@@ -122,6 +130,8 @@ struct rt_task { | |||
122 | task_class_t cls; | 130 | task_class_t cls; |
123 | budget_policy_t budget_policy; /* ignored by pfair */ | 131 | budget_policy_t budget_policy; /* ignored by pfair */ |
124 | release_policy_t release_policy; | 132 | release_policy_t release_policy; |
133 | pgm_node_type_t pgm_type; | ||
134 | lt_t pgm_expected_etoe; | ||
125 | }; | 135 | }; |
126 | 136 | ||
127 | union np_flag { | 137 | union np_flag { |
@@ -162,6 +172,11 @@ struct control_page { | |||
162 | uint64_t irq_syscall_start; /* Snapshot of irq_count when the syscall | 172 | uint64_t irq_syscall_start; /* Snapshot of irq_count when the syscall |
163 | * started. */ | 173 | * started. */ |
164 | 174 | ||
175 | /* Flags from userspace signifying PGM wait states. */ | ||
176 | volatile uint32_t pgm_waiting; /* waiting for tokens */ | ||
177 | volatile uint32_t pgm_sending; /* sending tokens */ | ||
178 | volatile uint32_t pgm_satisfied; /* done waiting/sending */ | ||
179 | |||
165 | /* to be extended */ | 180 | /* to be extended */ |
166 | }; | 181 | }; |
167 | 182 | ||
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index 82bde8241298..d3f78a812ef3 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -80,6 +80,19 @@ struct st_sys_release_data { | |||
80 | u64 release; | 80 | u64 release; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | struct st_pgm_param_data { | ||
84 | u32 node_type; | ||
85 | u16 graph_pid; | ||
86 | u16 unused; | ||
87 | u64 expected_graph_etoe; | ||
88 | }; | ||
89 | |||
90 | struct st_pgm_release_data { | ||
91 | u64 release; /* PGM-adjusted release time */ | ||
92 | u64 deadline; /* PGM-adjusted deadline */ | ||
93 | }; | ||
94 | |||
95 | |||
83 | #define DATA(x) struct st_ ## x ## _data x; | 96 | #define DATA(x) struct st_ ## x ## _data x; |
84 | 97 | ||
85 | typedef enum { | 98 | typedef enum { |
@@ -94,7 +107,9 @@ typedef enum { | |||
94 | ST_BLOCK, | 107 | ST_BLOCK, |
95 | ST_RESUME, | 108 | ST_RESUME, |
96 | ST_ACTION, | 109 | ST_ACTION, |
97 | ST_SYS_RELEASE | 110 | ST_SYS_RELEASE, |
111 | ST_PGM_PARAM, | ||
112 | ST_PGM_RELEASE | ||
98 | } st_event_record_type_t; | 113 | } st_event_record_type_t; |
99 | 114 | ||
100 | struct st_event_record { | 115 | struct st_event_record { |
@@ -113,6 +128,8 @@ struct st_event_record { | |||
113 | DATA(resume); | 128 | DATA(resume); |
114 | DATA(action); | 129 | DATA(action); |
115 | DATA(sys_release); | 130 | DATA(sys_release); |
131 | DATA(pgm_param); | ||
132 | DATA(pgm_release); | ||
116 | } data; | 133 | } data; |
117 | }; | 134 | }; |
118 | 135 | ||
@@ -154,6 +171,10 @@ feather_callback void do_sched_trace_action(unsigned long id, | |||
154 | unsigned long action); | 171 | unsigned long action); |
155 | feather_callback void do_sched_trace_sys_release(unsigned long id, | 172 | feather_callback void do_sched_trace_sys_release(unsigned long id, |
156 | lt_t* start); | 173 | lt_t* start); |
174 | feather_callback void do_sched_trace_pgm_param(unsigned long id, | ||
175 | struct task_struct* task); | ||
176 | feather_callback void do_sched_trace_pgm_release(unsigned long id, | ||
177 | struct task_struct* task); | ||
157 | 178 | ||
158 | #endif | 179 | #endif |
159 | 180 | ||
@@ -179,6 +200,8 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
179 | #define trace_litmus_task_block(t) | 200 | #define trace_litmus_task_block(t) |
180 | #define trace_litmus_task_resume(t) | 201 | #define trace_litmus_task_resume(t) |
181 | #define trace_litmus_sys_release(start) | 202 | #define trace_litmus_sys_release(start) |
203 | #define trace_litmus_pgm_param(t) | ||
204 | #define trace_litmus_pgm_release(t) | ||
182 | 205 | ||
183 | #endif | 206 | #endif |
184 | 207 | ||
@@ -252,6 +275,20 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
252 | trace_litmus_sys_release(when); \ | 275 | trace_litmus_sys_release(when); \ |
253 | } while (0) | 276 | } while (0) |
254 | 277 | ||
278 | #define sched_trace_pgm_param(t) \ | ||
279 | do { \ | ||
280 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 11, \ | ||
281 | do_sched_trace_pgm_param, t); \ | ||
282 | trace_litmus_pgm_param(t); \ | ||
283 | } while (0) | ||
284 | |||
285 | #define sched_trace_pgm_release(t) \ | ||
286 | do { \ | ||
287 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 12, \ | ||
288 | do_sched_trace_pgm_release, t); \ | ||
289 | trace_litmus_pgm_release(t); \ | ||
290 | } while (0) | ||
291 | |||
255 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ | 292 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ |
256 | 293 | ||
257 | #endif /* __KERNEL__ */ | 294 | #endif /* __KERNEL__ */ |
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h index 0fffcee02be0..02b4b54f718c 100644 --- a/include/trace/events/litmus.h +++ b/include/trace/events/litmus.h | |||
@@ -39,7 +39,7 @@ TRACE_EVENT(litmus_task_param, | |||
39 | __entry->partition = get_partition(t); | 39 | __entry->partition = get_partition(t); |
40 | ), | 40 | ), |
41 | 41 | ||
42 | TP_printk("period(%d, %Lu).\nwcet(%d, %Lu).\n", | 42 | TP_printk("period(%u, %Lu).\nwcet(%d, %Lu).\n", |
43 | __entry->pid, __entry->period, | 43 | __entry->pid, __entry->period, |
44 | __entry->pid, __entry->wcet) | 44 | __entry->pid, __entry->wcet) |
45 | ); | 45 | ); |
@@ -225,6 +225,57 @@ TRACE_EVENT(litmus_sys_release, | |||
225 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) | 225 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) |
226 | ); | 226 | ); |
227 | 227 | ||
228 | /* Tracing PGM node parameters */ | ||
229 | TRACE_EVENT(litmus_pgm_param, | ||
230 | |||
231 | TP_PROTO(struct task_struct *t), | ||
232 | |||
233 | TP_ARGS(t), | ||
234 | |||
235 | TP_STRUCT__entry( | ||
236 | __field( pid_t, pid ) | ||
237 | __field( pgm_node_type_t, node_type ) | ||
238 | __field( pid_t, graph_pid ) | ||
239 | ), | ||
240 | |||
241 | TP_fast_assign( | ||
242 | __entry->pid = t ? t->pid : 0; | ||
243 | __entry->node_type = t ? t->rt_param.task_params.pgm_type : PGM_NOT_A_NODE; | ||
244 | __entry->graph_pid = t ? t->tgid : 0; | ||
245 | ), | ||
246 | |||
247 | TP_printk("pgm node (%u, node type = %d) in graph (%u)\n", | ||
248 | __entry->pid, __entry->node_type, __entry->graph_pid) | ||
249 | ); | ||
250 | |||
251 | /* | ||
252 | * Tracing PGM-adjusted job release | ||
253 | */ | ||
254 | TRACE_EVENT(litmus_pgm_release, | ||
255 | |||
256 | TP_PROTO(struct task_struct *t), | ||
257 | |||
258 | TP_ARGS(t), | ||
259 | |||
260 | TP_STRUCT__entry( | ||
261 | __field( pid_t, pid ) | ||
262 | __field( unsigned int, job ) | ||
263 | __field( lt_t, release ) | ||
264 | __field( lt_t, deadline ) | ||
265 | ), | ||
266 | |||
267 | TP_fast_assign( | ||
268 | __entry->pid = t ? t->pid : 0; | ||
269 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
270 | __entry->release = get_release(t); | ||
271 | __entry->deadline = get_deadline(t); | ||
272 | ), | ||
273 | |||
274 | TP_printk("release(job(%u, %u)): %Lu\ndeadline(job(%u, %u)): %Lu\n", | ||
275 | __entry->pid, __entry->job, __entry->release, | ||
276 | __entry->pid, __entry->job, __entry->deadline) | ||
277 | ); | ||
278 | |||
228 | #endif /* _SCHED_TASK_TRACEPOINT_H */ | 279 | #endif /* _SCHED_TASK_TRACEPOINT_H */ |
229 | 280 | ||
230 | /* Must stay outside the protection */ | 281 | /* Must stay outside the protection */ |