aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/sched.h')
-rw-r--r--include/trace/events/sched.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 04c308413a5d..67e1bbf83695 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -443,6 +443,93 @@ TRACE_EVENT(sched_process_hang,
443); 443);
444#endif /* CONFIG_DETECT_HUNG_TASK */ 444#endif /* CONFIG_DETECT_HUNG_TASK */
445 445
446DECLARE_EVENT_CLASS(sched_move_task_template,
447
448 TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu),
449
450 TP_ARGS(tsk, src_cpu, dst_cpu),
451
452 TP_STRUCT__entry(
453 __field( pid_t, pid )
454 __field( pid_t, tgid )
455 __field( pid_t, ngid )
456 __field( int, src_cpu )
457 __field( int, src_nid )
458 __field( int, dst_cpu )
459 __field( int, dst_nid )
460 ),
461
462 TP_fast_assign(
463 __entry->pid = task_pid_nr(tsk);
464 __entry->tgid = task_tgid_nr(tsk);
465 __entry->ngid = task_numa_group_id(tsk);
466 __entry->src_cpu = src_cpu;
467 __entry->src_nid = cpu_to_node(src_cpu);
468 __entry->dst_cpu = dst_cpu;
469 __entry->dst_nid = cpu_to_node(dst_cpu);
470 ),
471
472 TP_printk("pid=%d tgid=%d ngid=%d src_cpu=%d src_nid=%d dst_cpu=%d dst_nid=%d",
473 __entry->pid, __entry->tgid, __entry->ngid,
474 __entry->src_cpu, __entry->src_nid,
475 __entry->dst_cpu, __entry->dst_nid)
476);
477
478/*
479 * Tracks migration of tasks from one runqueue to another. Can be used to
480 * detect if automatic NUMA balancing is bouncing between nodes
481 */
482DEFINE_EVENT(sched_move_task_template, sched_move_numa,
483 TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu),
484
485 TP_ARGS(tsk, src_cpu, dst_cpu)
486);
487
488DEFINE_EVENT(sched_move_task_template, sched_stick_numa,
489 TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu),
490
491 TP_ARGS(tsk, src_cpu, dst_cpu)
492);
493
494TRACE_EVENT(sched_swap_numa,
495
496 TP_PROTO(struct task_struct *src_tsk, int src_cpu,
497 struct task_struct *dst_tsk, int dst_cpu),
498
499 TP_ARGS(src_tsk, src_cpu, dst_tsk, dst_cpu),
500
501 TP_STRUCT__entry(
502 __field( pid_t, src_pid )
503 __field( pid_t, src_tgid )
504 __field( pid_t, src_ngid )
505 __field( int, src_cpu )
506 __field( int, src_nid )
507 __field( pid_t, dst_pid )
508 __field( pid_t, dst_tgid )
509 __field( pid_t, dst_ngid )
510 __field( int, dst_cpu )
511 __field( int, dst_nid )
512 ),
513
514 TP_fast_assign(
515 __entry->src_pid = task_pid_nr(src_tsk);
516 __entry->src_tgid = task_tgid_nr(src_tsk);
517 __entry->src_ngid = task_numa_group_id(src_tsk);
518 __entry->src_cpu = src_cpu;
519 __entry->src_nid = cpu_to_node(src_cpu);
520 __entry->dst_pid = task_pid_nr(dst_tsk);
521 __entry->dst_tgid = task_tgid_nr(dst_tsk);
522 __entry->dst_ngid = task_numa_group_id(dst_tsk);
523 __entry->dst_cpu = dst_cpu;
524 __entry->dst_nid = cpu_to_node(dst_cpu);
525 ),
526
527 TP_printk("src_pid=%d src_tgid=%d src_ngid=%d src_cpu=%d src_nid=%d dst_pid=%d dst_tgid=%d dst_ngid=%d dst_cpu=%d dst_nid=%d",
528 __entry->src_pid, __entry->src_tgid, __entry->src_ngid,
529 __entry->src_cpu, __entry->src_nid,
530 __entry->dst_pid, __entry->dst_tgid, __entry->dst_ngid,
531 __entry->dst_cpu, __entry->dst_nid)
532);
446#endif /* _TRACE_SCHED_H */ 533#endif /* _TRACE_SCHED_H */
447 534
448/* This part must be outside protection */ 535/* This part must be outside protection */