@@ -241,7 +241,6 @@ DECLARE_EVENT_CLASS(sched_process_template,
241
241
DEFINE_EVENT (sched_process_template , sched_process_free ,
242
242
TP_PROTO (struct task_struct * p ),
243
243
TP_ARGS (p ));
244
-
245
244
246
245
/*
247
246
* Tracepoint for a task exiting:
@@ -336,11 +335,20 @@ TRACE_EVENT(sched_process_exec,
336
335
__entry -> pid , __entry -> old_pid )
337
336
);
338
337
338
+
339
+ #ifdef CONFIG_SCHEDSTATS
340
+ #define DEFINE_EVENT_SCHEDSTAT DEFINE_EVENT
341
+ #define DECLARE_EVENT_CLASS_SCHEDSTAT DECLARE_EVENT_CLASS
342
+ #else
343
+ #define DEFINE_EVENT_SCHEDSTAT DEFINE_EVENT_NOP
344
+ #define DECLARE_EVENT_CLASS_SCHEDSTAT DECLARE_EVENT_CLASS_NOP
345
+ #endif
346
+
339
347
/*
340
348
* XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE
341
349
* adding sched_stat support to SCHED_FIFO/RR would be welcome.
342
350
*/
343
- DECLARE_EVENT_CLASS (sched_stat_template ,
351
+ DECLARE_EVENT_CLASS_SCHEDSTAT (sched_stat_template ,
344
352
345
353
TP_PROTO (struct task_struct * tsk , u64 delay ),
346
354
@@ -363,35 +371,34 @@ DECLARE_EVENT_CLASS(sched_stat_template,
363
371
(unsigned long long )__entry -> delay )
364
372
);
365
373
366
-
367
374
/*
368
375
* Tracepoint for accounting wait time (time the task is runnable
369
376
* but not actually running due to scheduler contention).
370
377
*/
371
- DEFINE_EVENT (sched_stat_template , sched_stat_wait ,
378
+ DEFINE_EVENT_SCHEDSTAT (sched_stat_template , sched_stat_wait ,
372
379
TP_PROTO (struct task_struct * tsk , u64 delay ),
373
380
TP_ARGS (tsk , delay ));
374
381
375
382
/*
376
383
* Tracepoint for accounting sleep time (time the task is not runnable,
377
384
* including iowait, see below).
378
385
*/
379
- DEFINE_EVENT (sched_stat_template , sched_stat_sleep ,
386
+ DEFINE_EVENT_SCHEDSTAT (sched_stat_template , sched_stat_sleep ,
380
387
TP_PROTO (struct task_struct * tsk , u64 delay ),
381
388
TP_ARGS (tsk , delay ));
382
389
383
390
/*
384
391
* Tracepoint for accounting iowait time (time the task is not runnable
385
392
* due to waiting on IO to complete).
386
393
*/
387
- DEFINE_EVENT (sched_stat_template , sched_stat_iowait ,
394
+ DEFINE_EVENT_SCHEDSTAT (sched_stat_template , sched_stat_iowait ,
388
395
TP_PROTO (struct task_struct * tsk , u64 delay ),
389
396
TP_ARGS (tsk , delay ));
390
397
391
398
/*
392
399
* Tracepoint for accounting blocked time (time the task is in uninterruptible).
393
400
*/
394
- DEFINE_EVENT (sched_stat_template , sched_stat_blocked ,
401
+ DEFINE_EVENT_SCHEDSTAT (sched_stat_template , sched_stat_blocked ,
395
402
TP_PROTO (struct task_struct * tsk , u64 delay ),
396
403
TP_ARGS (tsk , delay ));
397
404
0 commit comments