diff options
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/sched_trace.h | 105 |
1 files changed, 82 insertions, 23 deletions
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index 7ca34cb13881..82bde8241298 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -164,34 +164,93 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
164 | 164 | ||
165 | #endif | 165 | #endif |
166 | 166 | ||
167 | #ifdef CONFIG_SCHED_LITMUS_TRACEPOINT | ||
168 | |||
169 | #include <trace/events/litmus.h> | ||
170 | |||
171 | #else | ||
172 | |||
173 | /* Override trace macros to actually do nothing */ | ||
174 | #define trace_litmus_task_param(t) | ||
175 | #define trace_litmus_task_release(t) | ||
176 | #define trace_litmus_switch_to(t) | ||
177 | #define trace_litmus_switch_away(prev) | ||
178 | #define trace_litmus_task_completion(t, forced) | ||
179 | #define trace_litmus_task_block(t) | ||
180 | #define trace_litmus_task_resume(t) | ||
181 | #define trace_litmus_sys_release(start) | ||
182 | |||
183 | #endif | ||
184 | |||
167 | 185 | ||
168 | #define SCHED_TRACE_BASE_ID 500 | 186 | #define SCHED_TRACE_BASE_ID 500 |
169 | 187 | ||
170 | 188 | ||
171 | #define sched_trace_task_name(t) \ | 189 | #define sched_trace_task_name(t) \ |
172 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 1, do_sched_trace_task_name, t) | 190 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 1, \ |
173 | #define sched_trace_task_param(t) \ | 191 | do_sched_trace_task_name, t) |
174 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 2, do_sched_trace_task_param, t) | 192 | |
175 | #define sched_trace_task_release(t) \ | 193 | #define sched_trace_task_param(t) \ |
176 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 3, do_sched_trace_task_release, t) | 194 | do { \ |
177 | #define sched_trace_task_switch_to(t) \ | 195 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 2, \ |
178 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 4, do_sched_trace_task_switch_to, t) | 196 | do_sched_trace_task_param, t); \ |
179 | #define sched_trace_task_switch_away(t) \ | 197 | trace_litmus_task_param(t); \ |
180 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 5, do_sched_trace_task_switch_away, t) | 198 | } while (0) |
181 | #define sched_trace_task_completion(t, forced) \ | 199 | |
182 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 6, do_sched_trace_task_completion, t, \ | 200 | #define sched_trace_task_release(t) \ |
183 | (unsigned long) forced) | 201 | do { \ |
184 | #define sched_trace_task_block(t) \ | 202 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 3, \ |
185 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, do_sched_trace_task_block, t) | 203 | do_sched_trace_task_release, t); \ |
186 | #define sched_trace_task_resume(t) \ | 204 | trace_litmus_task_release(t); \ |
187 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, do_sched_trace_task_resume, t) | 205 | } while (0) |
188 | #define sched_trace_action(t, action) \ | 206 | |
189 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 9, do_sched_trace_action, t, \ | 207 | #define sched_trace_task_switch_to(t) \ |
190 | (unsigned long) action); | 208 | do { \ |
191 | /* when is a pointer, it does not need an explicit cast to unsigned long */ | 209 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 4, \ |
192 | #define sched_trace_sys_release(when) \ | 210 | do_sched_trace_task_switch_to, t); \ |
193 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 10, do_sched_trace_sys_release, when) | 211 | trace_litmus_switch_to(t); \ |
212 | } while (0) | ||
213 | |||
214 | #define sched_trace_task_switch_away(t) \ | ||
215 | do { \ | ||
216 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 5, \ | ||
217 | do_sched_trace_task_switch_away, t); \ | ||
218 | trace_litmus_switch_away(t); \ | ||
219 | } while (0) | ||
220 | |||
221 | #define sched_trace_task_completion(t, forced) \ | ||
222 | do { \ | ||
223 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 6, \ | ||
224 | do_sched_trace_task_completion, t, \ | ||
225 | (unsigned long) forced); \ | ||
226 | trace_litmus_task_completion(t, forced); \ | ||
227 | } while (0) | ||
228 | |||
229 | #define sched_trace_task_block(t) \ | ||
230 | do { \ | ||
231 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, \ | ||
232 | do_sched_trace_task_block, t); \ | ||
233 | trace_litmus_task_block(t); \ | ||
234 | } while (0) | ||
235 | |||
236 | #define sched_trace_task_resume(t) \ | ||
237 | do { \ | ||
238 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, \ | ||
239 | do_sched_trace_task_resume, t); \ | ||
240 | trace_litmus_task_resume(t); \ | ||
241 | } while (0) | ||
242 | |||
243 | #define sched_trace_action(t, action) \ | ||
244 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 9, \ | ||
245 | do_sched_trace_action, t, (unsigned long) action); | ||
194 | 246 | ||
247 | /* when is a pointer, it does not need an explicit cast to unsigned long */ | ||
248 | #define sched_trace_sys_release(when) \ | ||
249 | do { \ | ||
250 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 10, \ | ||
251 | do_sched_trace_sys_release, when); \ | ||
252 | trace_litmus_sys_release(when); \ | ||
253 | } while (0) | ||
195 | 254 | ||
196 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ | 255 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ |
197 | 256 | ||