aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/litmus/locking.h1
-rw-r--r--include/litmus/sched_trace.h18
-rw-r--r--include/trace/events/litmus.h67
3 files changed, 75 insertions, 11 deletions
diff --git a/include/litmus/locking.h b/include/litmus/locking.h
index 4d7b870cb443..41991d5af01b 100644
--- a/include/litmus/locking.h
+++ b/include/litmus/locking.h
@@ -9,6 +9,7 @@ struct litmus_lock_ops;
9struct litmus_lock { 9struct litmus_lock {
10 struct litmus_lock_ops *ops; 10 struct litmus_lock_ops *ops;
11 int type; 11 int type;
12 int id;
12}; 13};
13 14
14struct litmus_lock_ops { 15struct litmus_lock_ops {
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h
index c6897f799867..49972d75ef38 100644
--- a/include/litmus/sched_trace.h
+++ b/include/litmus/sched_trace.h
@@ -233,18 +233,28 @@ feather_callback void do_sched_trace_sys_release(unsigned long id,
233 trace_litmus_task_completion(t, forced); \ 233 trace_litmus_task_completion(t, forced); \
234 } while (0) 234 } while (0)
235 235
236#define sched_trace_task_block(t) \ 236#define sched_trace_task_block(t, i) \
237 do { \ 237 do { \
238 SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, \ 238 SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, \
239 do_sched_trace_task_block, t); \ 239 do_sched_trace_task_block, t); \
240 trace_litmus_task_block(t); \ 240 trace_litmus_task_block(t, i); \
241 } while (0) 241 } while (0)
242 242
243#define sched_trace_task_resume(t) \ 243#define sched_trace_task_resume(t, i) \
244 do { \ 244 do { \
245 SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, \ 245 SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, \
246 do_sched_trace_task_resume, t); \ 246 do_sched_trace_task_resume, t); \
247 trace_litmus_task_resume(t); \ 247 trace_litmus_task_resume(t, i); \
248 } while (0)
249
250#define sched_trace_resource_acquire(t, i) \
251 do { \
252 trace_litmus_resource_acquire(t, i); \
253 } while (0)
254
255#define sched_trace_resource_released(t, i) \
256 do { \
257 trace_litmus_resource_released(t, i); \
248 } while (0) 258 } while (0)
249 259
250#define sched_trace_action(t, action) \ 260#define sched_trace_action(t, action) \
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h
index 4ad053eac27d..b3a8f166e65f 100644
--- a/include/trace/events/litmus.h
+++ b/include/trace/events/litmus.h
@@ -157,21 +157,71 @@ TRACE_EVENT(litmus_task_completion,
157 */ 157 */
158TRACE_EVENT(litmus_task_block, 158TRACE_EVENT(litmus_task_block,
159 159
160 TP_PROTO(struct task_struct *t), 160 TP_PROTO(struct task_struct *t, int lid),
161 161
162 TP_ARGS(t), 162 TP_ARGS(t, lid),
163
164 TP_STRUCT__entry(
165 __field( pid_t, pid )
166 __field( int, lid )
167 __field( unsigned long long, when )
168 ),
169
170 TP_fast_assign(
171 __entry->pid = t ? t->pid : 0;
172 __entry->lid = lid;
173 __entry->when = litmus_clock();
174 ),
175
176 TP_printk("(%u) blocks on %d: %Lu\n", __entry->pid,
177 __entry->lid, __entry->when)
178);
179
180/*
181 * Lock events
182 */
183TRACE_EVENT(litmus_resource_acquire,
184
185 TP_PROTO(struct task_struct *t, int lid),
186
187 TP_ARGS(t, lid),
188
189 TP_STRUCT__entry(
190 __field( pid_t, pid )
191 __field( int, lid )
192 __field( unsigned long long, when )
193 ),
194
195 TP_fast_assign(
196 __entry->pid = t ? t->pid : 0;
197 __entry->lid = lid;
198 __entry->when = litmus_clock();
199 ),
200
201 TP_printk("(%u) acquires %d: %Lu\n", __entry->pid,
202 __entry->lid, __entry->when)
203);
204
205TRACE_EVENT(litmus_resource_release,
206
207 TP_PROTO(struct task_struct *t, int lid),
208
209 TP_ARGS(t, lid),
163 210
164 TP_STRUCT__entry( 211 TP_STRUCT__entry(
165 __field( pid_t, pid ) 212 __field( pid_t, pid )
213 __field( int, lid )
166 __field( unsigned long long, when ) 214 __field( unsigned long long, when )
167 ), 215 ),
168 216
169 TP_fast_assign( 217 TP_fast_assign(
170 __entry->pid = t ? t->pid : 0; 218 __entry->pid = t ? t->pid : 0;
219 __entry->lid = lid;
171 __entry->when = litmus_clock(); 220 __entry->when = litmus_clock();
172 ), 221 ),
173 222
174 TP_printk("(%u) blocks: %Lu\n", __entry->pid, __entry->when) 223 TP_printk("(%u) releases %d: %Lu\n", __entry->pid,
224 __entry->lid, __entry->when)
175); 225);
176 226
177/* 227/*
@@ -179,12 +229,13 @@ TRACE_EVENT(litmus_task_block,
179 */ 229 */
180TRACE_EVENT(litmus_task_resume, 230TRACE_EVENT(litmus_task_resume,
181 231
182 TP_PROTO(struct task_struct *t), 232 TP_PROTO(struct task_struct *t, int lid),
183 233
184 TP_ARGS(t), 234 TP_ARGS(t, lid),
185 235
186 TP_STRUCT__entry( 236 TP_STRUCT__entry(
187 __field( pid_t, pid ) 237 __field( pid_t, pid )
238 __field( int, lid )
188 __field( unsigned int, job ) 239 __field( unsigned int, job )
189 __field( unsigned long long, when ) 240 __field( unsigned long long, when )
190 ), 241 ),
@@ -193,10 +244,12 @@ TRACE_EVENT(litmus_task_resume,
193 __entry->pid = t ? t->pid : 0; 244 __entry->pid = t ? t->pid : 0;
194 __entry->job = t ? t->rt_param.job_params.job_no : 0; 245 __entry->job = t ? t->rt_param.job_params.job_no : 0;
195 __entry->when = litmus_clock(); 246 __entry->when = litmus_clock();
247 __entry->lid = lid;
196 ), 248 ),
197 249
198 TP_printk("resume(job(%u, %u)): %Lu\n", 250 TP_printk("resume(job(%u, %u)) on %d: %Lu\n",
199 __entry->pid, __entry->job, __entry->when) 251 __entry->pid, __entry->job,
252 __entry->lid, __entry->when)
200); 253);
201 254
202/* 255/*