Commit 071dad9c authored by Qais Yousef's avatar Qais Yousef Committed by Ionela Voinescu
Browse files

sched_tp: Manage a change in a member name in struct sched_avg



We need to support both old and new version of the struct.
Signed-off-by: Qais Yousef's avatarQais Yousef <qais.yousef@arm.com>
parent bac3fc0e
......@@ -12,6 +12,17 @@
#define SPAN_SIZE (__SPAN_SIZE > MAX_SPAN_SIZE ? MAX_SPAN_SIZE : __SPAN_SIZE)
#include <linux/tracepoint.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
#define RBL_LOAD_ENTRY rbl_load
#define RBL_LOAD_MEMBER runnable_load_avg
#define RBL_LOAD_STR "rbl_load"
#else
#define RBL_LOAD_ENTRY runnable
#define RBL_LOAD_MEMBER runnable_avg
#define RBL_LOAD_STR "runnable"
#endif
TRACE_EVENT(sched_load_cfs_rq,
......@@ -23,7 +34,7 @@ TRACE_EVENT(sched_load_cfs_rq,
__field( int, cpu )
__array( char, path, PATH_SIZE )
__field( unsigned long, load )
__field( unsigned long, rbl_load )
__field( unsigned long, RBL_LOAD_ENTRY )
__field( unsigned long, util )
),
......@@ -31,13 +42,13 @@ TRACE_EVENT(sched_load_cfs_rq,
__entry->cpu = cpu;
strlcpy(__entry->path, path, PATH_SIZE);
__entry->load = avg->load_avg;
__entry->rbl_load = avg->runnable_load_avg;
__entry->RBL_LOAD_ENTRY = avg->RBL_LOAD_MEMBER;
__entry->util = avg->util_avg;
),
TP_printk("cpu=%d path=%s load=%lu rbl_load=%lu util=%lu",
TP_printk("cpu=%d path=%s load=%lu " RBL_LOAD_STR "=%lu util=%lu",
__entry->cpu, __entry->path, __entry->load,
__entry->rbl_load,__entry->util)
__entry->RBL_LOAD_ENTRY,__entry->util)
);
DECLARE_EVENT_CLASS(sched_pelt_rq_template,
......@@ -49,20 +60,20 @@ DECLARE_EVENT_CLASS(sched_pelt_rq_template,
TP_STRUCT__entry(
__field( int, cpu )
__field( unsigned long, load )
__field( unsigned long, rbl_load )
__field( unsigned long, RBL_LOAD_ENTRY )
__field( unsigned long, util )
),
TP_fast_assign(
__entry->cpu = cpu;
__entry->load = avg->load_avg;
__entry->rbl_load = avg->runnable_load_avg;
__entry->RBL_LOAD_ENTRY = avg->RBL_LOAD_MEMBER;
__entry->util = avg->util_avg;
),
TP_printk("cpu=%d load=%lu rbl_load=%lu util=%lu",
TP_printk("cpu=%d load=%lu " RBL_LOAD_STR "=%lu util=%lu",
__entry->cpu, __entry->load,
__entry->rbl_load,__entry->util)
__entry->RBL_LOAD_ENTRY,__entry->util)
);
DEFINE_EVENT(sched_pelt_rq_template, sched_pelt_rt,
......@@ -89,7 +100,7 @@ TRACE_EVENT(sched_load_se,
__array( char, comm, TASK_COMM_LEN )
__field( int, pid )
__field( unsigned long, load )
__field( unsigned long, rbl_load )
__field( unsigned long, RBL_LOAD_ENTRY )
__field( unsigned long, util )
__field( unsigned long long, update_time )
),
......@@ -100,14 +111,14 @@ TRACE_EVENT(sched_load_se,
strlcpy(__entry->comm, comm, TASK_COMM_LEN);
__entry->pid = pid;
__entry->load = avg->load_avg;
__entry->rbl_load = avg->runnable_load_avg;
__entry->RBL_LOAD_ENTRY = avg->RBL_LOAD_MEMBER;
__entry->util = avg->util_avg;
__entry->update_time = avg->last_update_time;
),
TP_printk("cpu=%d path=%s comm=%s pid=%d load=%lu rbl_load=%lu util=%lu update_time=%llu",
TP_printk("cpu=%d path=%s comm=%s pid=%d load=%lu " RBL_LOAD_STR "=%lu util=%lu update_time=%llu",
__entry->cpu, __entry->path, __entry->comm, __entry->pid,
__entry->load, __entry->rbl_load,__entry->util, __entry->update_time)
__entry->load, __entry->RBL_LOAD_ENTRY,__entry->util, __entry->update_time)
);
TRACE_EVENT(sched_overutilized,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment