#if !defined(LTTNG_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
#define LTTNG_TRACE_SCHED_H
-#include "../../../probes/lttng-tracepoint-event.h"
+#include <probes/lttng-tracepoint-event.h>
#include <linux/sched.h>
#include <linux/pid_namespace.h>
#include <linux/binfmts.h>
#endif /* _TRACE_SCHED_DEF_ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0))
+LTTNG_TRACEPOINT_ENUM(lttng_sched_policy,
+ TP_ENUM_VALUES(
+ ctf_enum_value("SCHED_NORMAL", SCHED_NORMAL)
+ ctf_enum_value("SCHED_FIFO", SCHED_FIFO)
+ ctf_enum_value("SCHED_RR", SCHED_RR)
+ ctf_enum_value("SCHED_BATCH", SCHED_BATCH)
+ ctf_enum_value("SCHED_IDLE", SCHED_IDLE)
+ ctf_enum_value("SCHED_DEADLINE", SCHED_DEADLINE)
+ )
+)
+#endif
+
/*
* Tracepoint for calling kthread_stop, performed to end a kthread:
*/
/*
* Tracepoint for waking up a task:
*/
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \
+ LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0))
LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template,
TP_PROTO(struct task_struct *p),
)
#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \
+ LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0))
/*
* Tracepoint called when waking a task; this tracepoint is guaranteed to be
LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_process_free,
TP_PROTO(struct task_struct *p),
TP_ARGS(p))
-
+
/*
* Tracepoint for a task exiting:
)
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0))
+/*
+ * Tracepoint for priority changes of a task.
+ */
+LTTNG_TRACEPOINT_EVENT(sched_update_prio,
+
+ TP_PROTO(struct task_struct *tsk),
+
+ TP_ARGS(tsk),
+
+ TP_FIELDS(
+ ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN)
+ ctf_integer(pid_t, tid, tsk->pid)
+ ctf_integer(int, prio, tsk->prio - MAX_RT_PRIO)
+ ctf_enum(lttng_sched_policy, unsigned int, policy, tsk->policy)
+ ctf_integer(int, nice, task_nice(tsk))
+ ctf_integer(unsigned int, rt_priority, tsk->rt_priority)
+ ctf_integer(u64, dl_runtime, tsk->dl.dl_runtime)
+ ctf_integer(u64, dl_deadline, tsk->dl.dl_deadline)
+ ctf_integer(u64, dl_period, tsk->dl.dl_period)
+ )
+)
+#endif
+
#endif /* LTTNG_TRACE_SCHED_H */
/* This part must be outside protection */
-#include "../../../probes/define_trace.h"
+#include <probes/define_trace.h>