Fix: sched_stat_runtime changed in linux 6.8.0-rc1
authorKienan Stewart <kstewart@efficios.com>
Mon, 22 Jan 2024 16:10:37 +0000 (11:10 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 2 Feb 2024 21:47:22 +0000 (16:47 -0500)
See upstream commit:

    commit 5fe6ec8f6ab549b6422e41551abb51802bd48bc7
    Author: Peter Zijlstra <peterz@infradead.org>
    Date:   Mon Nov 6 13:41:43 2023 +0100

        sched: Remove vruntime from trace_sched_stat_runtime()

        Tracing the runtime delta makes sense, observer can sum over time.
        Tracing the absolute vruntime makes less sense, inconsistent:
        absolute-vs-delta, but also vruntime delta can be computed from
        runtime delta.

        Removing the vruntime thing also makes the two tracepoint sites
        identical, allowing to unify the code in a later patch.

Change-Id: I24ebb4e06dbb646a1af75ac62b74f3821ff197de
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/instrumentation/events/sched.h

index f6f258ad5de2e91185b4baf1ddc55b1f31fc007a..5f994759d20350af13fcfeb088bce3be4727ff82 100644 (file)
@@ -484,6 +484,24 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_blocked,
             TP_PROTO(struct task_struct *tsk, u64 delay),
             TP_ARGS(tsk, delay))
 
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0))
+/*
+ * Tracepoint for accounting runtime (time the task is executing
+ * on a CPU).
+ */
+LTTNG_TRACEPOINT_EVENT(sched_stat_runtime,
+
+       TP_PROTO(struct task_struct *tsk, u64 runtime),
+
+       TP_ARGS(tsk, runtime),
+
+       TP_FIELDS(
+               ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN)
+               ctf_integer(pid_t, tid, tsk->pid)
+               ctf_integer(u64, runtime, runtime)
+       )
+)
+#else
 /*
  * Tracepoint for accounting runtime (time the task is executing
  * on a CPU).
@@ -501,6 +519,7 @@ LTTNG_TRACEPOINT_EVENT(sched_stat_runtime,
                ctf_integer(u64, vruntime, vruntime)
        )
 )
+#endif
 
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0) || \
        LTTNG_RT_KERNEL_RANGE(4,9,27,18, 4,10,0,0) || \
This page took 0.034659 seconds and 4 git commands to generate.