diff options
-rw-r--r-- | include/litmus/rt_domain.h | 3 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 33 | ||||
-rw-r--r-- | include/trace/events/litmus.h | 79 | ||||
-rw-r--r-- | litmus/sched_gsn_edf.c | 9 |
4 files changed, 75 insertions, 49 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index 3783cdaa00c5..3a0861c1d700 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
@@ -35,7 +35,8 @@ typedef struct _rt_domain { | |||
35 | #if defined(CONFIG_MERGE_TIMERS) | 35 | #if defined(CONFIG_MERGE_TIMERS) |
36 | struct event_group* event_group; | 36 | struct event_group* event_group; |
37 | int prio; | 37 | int prio; |
38 | #elif defined(CONFIG_RELEASE_MASTER) | 38 | #endif |
39 | #if defined(CONFIG_RELEASE_MASTER) | ||
39 | int release_master; | 40 | int release_master; |
40 | #endif | 41 | #endif |
41 | 42 | ||
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index edb8afc4a994..e193267a321f 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -177,10 +177,14 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
177 | #define trace_litmus_switch_to(t) | 177 | #define trace_litmus_switch_to(t) |
178 | #define trace_litmus_switch_away(prev) | 178 | #define trace_litmus_switch_away(prev) |
179 | #define trace_litmus_task_completion(t, forced) | 179 | #define trace_litmus_task_completion(t, forced) |
180 | #define trace_litmus_task_block(t) | 180 | #define trace_litmus_task_block(t, i) |
181 | #define trace_litmus_task_resume(t) | 181 | #define trace_litmus_task_resume(t, i) |
182 | #define trace_litmus_sys_release(start) | 182 | #define trace_litmus_sys_release(start) |
183 | 183 | ||
184 | #define trace_litmus_resource_acquire(t, i); | ||
185 | #define trace_litmus_resource_release(t, i); | ||
186 | #define trace_litmus_priority_donate(t, d, i) | ||
187 | |||
184 | #define trace_litmus_container_param(cid, name) | 188 | #define trace_litmus_container_param(cid, name) |
185 | #define trace_litmus_server_param(sid, cid, wcet, time) | 189 | #define trace_litmus_server_param(sid, cid, wcet, time) |
186 | #define trace_litmus_server_switch_to(sid, job, tid) | 190 | #define trace_litmus_server_switch_to(sid, job, tid) |
@@ -248,16 +252,6 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
248 | trace_litmus_task_resume(t, i); \ | 252 | trace_litmus_task_resume(t, i); \ |
249 | } while (0) | 253 | } while (0) |
250 | 254 | ||
251 | #define sched_trace_resource_acquire(t, i) \ | ||
252 | do { \ | ||
253 | trace_litmus_resource_acquire(t, i); \ | ||
254 | } while (0) | ||
255 | |||
256 | #define sched_trace_resource_released(t, i) \ | ||
257 | do { \ | ||
258 | trace_litmus_resource_released(t, i); \ | ||
259 | } while (0) | ||
260 | |||
261 | #define sched_trace_action(t, action) \ | 255 | #define sched_trace_action(t, action) \ |
262 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 9, \ | 256 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 9, \ |
263 | do_sched_trace_action, t, (unsigned long) action); | 257 | do_sched_trace_action, t, (unsigned long) action); |
@@ -275,6 +269,21 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
275 | sched_trace_log_message("%d P%d [%s@%s:%d]: Took %llu\n\n", \ | 269 | sched_trace_log_message("%d P%d [%s@%s:%d]: Took %llu\n\n", \ |
276 | TRACE_ARGS, litmus_clock() - _qt_start) | 270 | TRACE_ARGS, litmus_clock() - _qt_start) |
277 | 271 | ||
272 | #define sched_trace_resource_acquire(t, i) \ | ||
273 | do { \ | ||
274 | trace_litmus_resource_acquire(t, i); \ | ||
275 | } while (0) | ||
276 | |||
277 | #define sched_trace_resource_release(t, i) \ | ||
278 | do { \ | ||
279 | trace_litmus_resource_release(t, i); \ | ||
280 | } while (0) | ||
281 | |||
282 | #define sched_trace_priority_donate(t, d, i) \ | ||
283 | do { \ | ||
284 | trace_litmus_priority_donate(t, d, i); \ | ||
285 | } while (0) | ||
286 | |||
278 | #define sched_trace_container_param(cid, name) \ | 287 | #define sched_trace_container_param(cid, name) \ |
279 | do { \ | 288 | do { \ |
280 | trace_litmus_container_param(cid, name); \ | 289 | trace_litmus_container_param(cid, name); \ |
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h index b3a8f166e65f..7a34a3214ae6 100644 --- a/include/trace/events/litmus.h +++ b/include/trace/events/litmus.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <litmus/litmus.h> | 12 | #include <litmus/litmus.h> |
13 | #include <litmus/rt_param.h> | 13 | #include <litmus/rt_param.h> |
14 | |||
14 | TRACE_EVENT(litmus_task_param, | 15 | TRACE_EVENT(litmus_task_param, |
15 | 16 | ||
16 | TP_PROTO(struct task_struct *t), | 17 | TP_PROTO(struct task_struct *t), |
@@ -80,20 +81,18 @@ TRACE_EVENT(litmus_switch_to, | |||
80 | TP_STRUCT__entry( | 81 | TP_STRUCT__entry( |
81 | __field( pid_t, pid ) | 82 | __field( pid_t, pid ) |
82 | __field( unsigned int, job ) | 83 | __field( unsigned int, job ) |
83 | __field( unsigned long long, when ) | ||
84 | __field( unsigned long long, exec_time ) | 84 | __field( unsigned long long, exec_time ) |
85 | ), | 85 | ), |
86 | 86 | ||
87 | TP_fast_assign( | 87 | TP_fast_assign( |
88 | __entry->pid = is_realtime(t) ? t->pid : 0; | 88 | __entry->pid = t->pid;//is_realtime(t) ? t->pid : 0; |
89 | __entry->job = is_realtime(t) ? t->rt_param.job_params.job_no : 0; | 89 | __entry->job = t->rt_param.job_params.job_no;//is_realtime(t) ? t->rt_param.job_params.job_no : 0; |
90 | __entry->when = litmus_clock(); | ||
91 | __entry->exec_time = get_exec_time(t); | 90 | __entry->exec_time = get_exec_time(t); |
92 | ), | 91 | ), |
93 | 92 | ||
94 | TP_printk("switch_to(job(%u, %u)): %Lu (exec: %Lu)\n", | 93 | TP_printk("switch_to(job(%u, %u)): (exec: %Lu)\n", |
95 | __entry->pid, __entry->job, | 94 | __entry->pid, __entry->job, |
96 | __entry->when, __entry->exec_time) | 95 | __entry->exec_time) |
97 | ); | 96 | ); |
98 | 97 | ||
99 | /* | 98 | /* |
@@ -108,20 +107,18 @@ TRACE_EVENT(litmus_switch_away, | |||
108 | TP_STRUCT__entry( | 107 | TP_STRUCT__entry( |
109 | __field( pid_t, pid ) | 108 | __field( pid_t, pid ) |
110 | __field( unsigned int, job ) | 109 | __field( unsigned int, job ) |
111 | __field( unsigned long long, when ) | ||
112 | __field( unsigned long long, exec_time ) | 110 | __field( unsigned long long, exec_time ) |
113 | ), | 111 | ), |
114 | 112 | ||
115 | TP_fast_assign( | 113 | TP_fast_assign( |
116 | __entry->pid = is_realtime(t) ? t->pid : 0; | 114 | __entry->pid = t->pid;//is_realtime(t) ? t->pid : 0; |
117 | __entry->job = is_realtime(t) ? t->rt_param.job_params.job_no : 0; | 115 | __entry->job = t->rt_param.job_params.job_no;//is_realtime(t) ? t->rt_param.job_params.job_no : 0; |
118 | __entry->when = litmus_clock(); | ||
119 | __entry->exec_time = get_exec_time(t); | 116 | __entry->exec_time = get_exec_time(t); |
120 | ), | 117 | ), |
121 | 118 | ||
122 | TP_printk("switch_away(job(%u, %u)): %Lu (exec: %Lu)\n", | 119 | TP_printk("switch_away(job(%u, %u)): (exec: %Lu)\n", |
123 | __entry->pid, __entry->job, | 120 | __entry->pid, __entry->job, |
124 | __entry->when, __entry->exec_time) | 121 | __entry->exec_time) |
125 | ); | 122 | ); |
126 | 123 | ||
127 | /* | 124 | /* |
@@ -136,20 +133,18 @@ TRACE_EVENT(litmus_task_completion, | |||
136 | TP_STRUCT__entry( | 133 | TP_STRUCT__entry( |
137 | __field( pid_t, pid ) | 134 | __field( pid_t, pid ) |
138 | __field( unsigned int, job ) | 135 | __field( unsigned int, job ) |
139 | __field( unsigned long long, when ) | ||
140 | __field( unsigned long, forced ) | 136 | __field( unsigned long, forced ) |
141 | ), | 137 | ), |
142 | 138 | ||
143 | TP_fast_assign( | 139 | TP_fast_assign( |
144 | __entry->pid = t ? t->pid : 0; | 140 | __entry->pid = t ? t->pid : 0; |
145 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | 141 | __entry->job = t ? t->rt_param.job_params.job_no : 0; |
146 | __entry->when = litmus_clock(); | ||
147 | __entry->forced = forced; | 142 | __entry->forced = forced; |
148 | ), | 143 | ), |
149 | 144 | ||
150 | TP_printk("completed(job(%u, %u)): %Lu (forced: %lu)\n", | 145 | TP_printk("completed(job(%u, %u)): (forced: %lu)\n", |
151 | __entry->pid, __entry->job, | 146 | __entry->pid, __entry->job, |
152 | __entry->when, __entry->forced) | 147 | __entry->forced) |
153 | ); | 148 | ); |
154 | 149 | ||
155 | /* | 150 | /* |
@@ -164,17 +159,15 @@ TRACE_EVENT(litmus_task_block, | |||
164 | TP_STRUCT__entry( | 159 | TP_STRUCT__entry( |
165 | __field( pid_t, pid ) | 160 | __field( pid_t, pid ) |
166 | __field( int, lid ) | 161 | __field( int, lid ) |
167 | __field( unsigned long long, when ) | ||
168 | ), | 162 | ), |
169 | 163 | ||
170 | TP_fast_assign( | 164 | TP_fast_assign( |
171 | __entry->pid = t ? t->pid : 0; | 165 | __entry->pid = t ? t->pid : 0; |
172 | __entry->lid = lid; | 166 | __entry->lid = lid; |
173 | __entry->when = litmus_clock(); | ||
174 | ), | 167 | ), |
175 | 168 | ||
176 | TP_printk("(%u) blocks on %d: %Lu\n", __entry->pid, | 169 | TP_printk("(%u) blocks on %d\n", __entry->pid, |
177 | __entry->lid, __entry->when) | 170 | __entry->lid) |
178 | ); | 171 | ); |
179 | 172 | ||
180 | /* | 173 | /* |
@@ -189,17 +182,15 @@ TRACE_EVENT(litmus_resource_acquire, | |||
189 | TP_STRUCT__entry( | 182 | TP_STRUCT__entry( |
190 | __field( pid_t, pid ) | 183 | __field( pid_t, pid ) |
191 | __field( int, lid ) | 184 | __field( int, lid ) |
192 | __field( unsigned long long, when ) | ||
193 | ), | 185 | ), |
194 | 186 | ||
195 | TP_fast_assign( | 187 | TP_fast_assign( |
196 | __entry->pid = t ? t->pid : 0; | 188 | __entry->pid = t ? t->pid : 0; |
197 | __entry->lid = lid; | 189 | __entry->lid = lid; |
198 | __entry->when = litmus_clock(); | ||
199 | ), | 190 | ), |
200 | 191 | ||
201 | TP_printk("(%u) acquires %d: %Lu\n", __entry->pid, | 192 | TP_printk("(%u) acquires %d\n", __entry->pid, |
202 | __entry->lid, __entry->when) | 193 | __entry->lid) |
203 | ); | 194 | ); |
204 | 195 | ||
205 | TRACE_EVENT(litmus_resource_release, | 196 | TRACE_EVENT(litmus_resource_release, |
@@ -211,17 +202,39 @@ TRACE_EVENT(litmus_resource_release, | |||
211 | TP_STRUCT__entry( | 202 | TP_STRUCT__entry( |
212 | __field( pid_t, pid ) | 203 | __field( pid_t, pid ) |
213 | __field( int, lid ) | 204 | __field( int, lid ) |
214 | __field( unsigned long long, when ) | ||
215 | ), | 205 | ), |
216 | 206 | ||
217 | TP_fast_assign( | 207 | TP_fast_assign( |
218 | __entry->pid = t ? t->pid : 0; | 208 | __entry->pid = t ? t->pid : 0; |
219 | __entry->lid = lid; | 209 | __entry->lid = lid; |
220 | __entry->when = litmus_clock(); | ||
221 | ), | 210 | ), |
222 | 211 | ||
223 | TP_printk("(%u) releases %d: %Lu\n", __entry->pid, | 212 | TP_printk("(%u) releases %d\n", __entry->pid, |
224 | __entry->lid, __entry->when) | 213 | __entry->lid) |
214 | ); | ||
215 | |||
216 | TRACE_EVENT(litmus_priority_donate, | ||
217 | |||
218 | TP_PROTO(struct task_struct *t, struct task_struct *donor, int lid), | ||
219 | |||
220 | TP_ARGS(t, donor, lid), | ||
221 | |||
222 | TP_STRUCT__entry( | ||
223 | __field( pid_t, t_pid ) | ||
224 | __field( pid_t, d_pid ) | ||
225 | __field( unsigned long long, prio) | ||
226 | __field( int, lid ) | ||
227 | ), | ||
228 | |||
229 | TP_fast_assign( | ||
230 | __entry->t_pid = t ? t->pid : 0; | ||
231 | __entry->d_pid = donor ? donor->pid : 0; | ||
232 | __entry->prio = get_deadline(donor); | ||
233 | __entry->lid = lid; | ||
234 | ), | ||
235 | |||
236 | TP_printk("(%u) inherits %llu from (%u) on %d\n", __entry->t_pid, | ||
237 | __entry->d_pid, __entry->prio, __entry->lid) | ||
225 | ); | 238 | ); |
226 | 239 | ||
227 | /* | 240 | /* |
@@ -237,19 +250,17 @@ TRACE_EVENT(litmus_task_resume, | |||
237 | __field( pid_t, pid ) | 250 | __field( pid_t, pid ) |
238 | __field( int, lid ) | 251 | __field( int, lid ) |
239 | __field( unsigned int, job ) | 252 | __field( unsigned int, job ) |
240 | __field( unsigned long long, when ) | ||
241 | ), | 253 | ), |
242 | 254 | ||
243 | TP_fast_assign( | 255 | TP_fast_assign( |
244 | __entry->pid = t ? t->pid : 0; | 256 | __entry->pid = t ? t->pid : 0; |
245 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | 257 | __entry->job = t ? t->rt_param.job_params.job_no : 0; |
246 | __entry->when = litmus_clock(); | ||
247 | __entry->lid = lid; | 258 | __entry->lid = lid; |
248 | ), | 259 | ), |
249 | 260 | ||
250 | TP_printk("resume(job(%u, %u)) on %d: %Lu\n", | 261 | TP_printk("resume(job(%u, %u)) on %d\n", |
251 | __entry->pid, __entry->job, | 262 | __entry->pid, __entry->job, |
252 | __entry->lid, __entry->when) | 263 | __entry->lid) |
253 | ); | 264 | ); |
254 | 265 | ||
255 | /* | 266 | /* |
@@ -263,15 +274,13 @@ TRACE_EVENT(litmus_sys_release, | |||
263 | 274 | ||
264 | TP_STRUCT__entry( | 275 | TP_STRUCT__entry( |
265 | __field( unsigned long long, rel ) | 276 | __field( unsigned long long, rel ) |
266 | __field( unsigned long long, when ) | ||
267 | ), | 277 | ), |
268 | 278 | ||
269 | TP_fast_assign( | 279 | TP_fast_assign( |
270 | __entry->rel = *start; | 280 | __entry->rel = *start; |
271 | __entry->when = litmus_clock(); | ||
272 | ), | 281 | ), |
273 | 282 | ||
274 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) | 283 | TP_printk("SynRelease(%Lu)\n", __entry->rel) |
275 | ); | 284 | ); |
276 | 285 | ||
277 | /* | 286 | /* |
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 3d32f74ff51c..0afd49155999 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -758,8 +758,11 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
758 | /* check if we need to activate priority inheritance */ | 758 | /* check if we need to activate priority inheritance */ |
759 | if (edf_higher_prio(t, sem->hp_waiter)) { | 759 | if (edf_higher_prio(t, sem->hp_waiter)) { |
760 | sem->hp_waiter = t; | 760 | sem->hp_waiter = t; |
761 | if (edf_higher_prio(t, sem->owner)) | 761 | if (edf_higher_prio(t, sem->owner)) { |
762 | sched_trace_priority_donate(sem->owner, t, l->id); | ||
762 | set_priority_inheritance(sem->owner, sem->hp_waiter); | 763 | set_priority_inheritance(sem->owner, sem->hp_waiter); |
764 | |||
765 | } | ||
763 | } | 766 | } |
764 | 767 | ||
765 | /* release lock before sleeping */ | 768 | /* release lock before sleeping */ |
@@ -789,6 +792,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
789 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 792 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
790 | } | 793 | } |
791 | 794 | ||
795 | sched_trace_resource_acquire(t, l->id); | ||
796 | |||
792 | return 0; | 797 | return 0; |
793 | } | 798 | } |
794 | 799 | ||
@@ -842,6 +847,8 @@ int gsnedf_fmlp_unlock(struct litmus_lock* l) | |||
842 | if (tsk_rt(t)->inh_task) | 847 | if (tsk_rt(t)->inh_task) |
843 | clear_priority_inheritance(t); | 848 | clear_priority_inheritance(t); |
844 | 849 | ||
850 | sched_trace_resource_release(t, l->id); | ||
851 | |||
845 | out: | 852 | out: |
846 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 853 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
847 | 854 | ||