[COMMON] sched/rt: trace: add tracepoint for RT task
authorJohnlay Park <jonglae.park@samsung.com>
Fri, 2 Mar 2018 04:32:13 +0000 (13:32 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:08 +0000 (20:22 +0300)
Change-Id: I82c5fe708671e00b8f655f40459272c0dcc8b584
Signed-off-by: Johnlay Park <jonglae.park@samsung.com>
include/trace/events/sched.h

index 30145bcd1a32fa57619d86df3d393ea413af4c4d..f1cb20ce68924e38987c18385241ce74a2944ac0 100644 (file)
@@ -667,6 +667,91 @@ extern bool walt_disabled;
        }
 #endif
 
+/*
+ * Tracepoint for accounting sched averages for fair tasks.
+ */
+TRACE_EVENT(sched_load_avg_task,
+
+       TP_PROTO(struct task_struct *tsk, struct sched_avg *avg),
+
+       TP_ARGS(tsk, avg),
+
+       TP_STRUCT__entry(
+               __array( char,  comm,   TASK_COMM_LEN           )
+               __field( pid_t, pid                             )
+               __field( int,   cpu                             )
+               __field( unsigned long, load_avg                )
+               __field( unsigned long, util_avg                )
+               __field( u64,           load_sum                )
+               __field( u32,           util_sum                )
+               __field( u32,           period_contrib          )
+       ),
+
+       TP_fast_assign(
+               memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
+               __entry->pid                    = tsk->pid;
+               __entry->cpu                    = task_cpu(tsk);
+               __entry->load_avg               = avg->load_avg;
+               __entry->util_avg               = avg->util_avg;
+               __entry->load_sum               = avg->load_sum;
+               __entry->util_sum               = avg->util_sum;
+               __entry->period_contrib         = avg->period_contrib;
+       ),
+       TP_printk("fair: comm=%s pid=%d cpu=%d load_avg=%lu util_avg=%lu "
+                       "load_sum=%llu util_sum=%u period_contrib=%u",
+                 __entry->comm,
+                 __entry->pid,
+                 __entry->cpu,
+                 __entry->load_avg,
+                 __entry->util_avg,
+                 (u64)__entry->load_sum,
+                 (u32)__entry->util_sum,
+                 (u32)__entry->period_contrib)
+);
+
+/*
+ * Tracepoint for accounting sched averages for tasks.
+ */
+TRACE_EVENT(sched_rt_load_avg_task,
+
+       TP_PROTO(struct task_struct *tsk, struct sched_avg *avg),
+
+       TP_ARGS(tsk, avg),
+
+       TP_STRUCT__entry(
+               __array( char,  comm,   TASK_COMM_LEN           )
+               __field( pid_t, pid                             )
+               __field( int,   cpu                             )
+               __field( unsigned long, load_avg                )
+               __field( unsigned long, util_avg                )
+               __field( u64,           load_sum                )
+               __field( u32,           util_sum                )
+               __field( u32,           period_contrib          )
+       ),
+
+       TP_fast_assign(
+               memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
+               __entry->pid                    = tsk->pid;
+               __entry->cpu                    = task_cpu(tsk);
+               __entry->load_avg               = avg->load_avg;
+               __entry->util_avg               = avg->util_avg;
+               __entry->load_sum               = avg->load_sum;
+               __entry->util_sum               = avg->util_sum;
+               __entry->period_contrib         = avg->period_contrib;
+       ),
+       TP_printk("rt: comm=%s pid=%d cpu=%d load_avg=%lu util_avg=%lu "
+                       "load_sum=%llu util_sum=%u period_contrib=%u",
+                 __entry->comm,
+                 __entry->pid,
+                 __entry->cpu,
+                 __entry->load_avg,
+                 __entry->util_avg,
+                 (u64)__entry->load_sum,
+                 (u32)__entry->util_sum,
+                 (u32)__entry->period_contrib)
+);
+
+
 /*
  * Tracepoint for cfs_rq load tracking:
  */