summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-sched_stat_runtime-changed-in-linux-6.8.0-rc1.patch
blob: a0d932c7b7ca1389ec43be1a14eb8fecc605863e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 9e59c2f6387aeb832ae3af3095f987529722e08f Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 22 Jan 2024 11:10:37 -0500
Subject: [PATCH 1/5] Fix: sched_stat_runtime changed in linux 6.8.0-rc1

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.

Upstream-Status: Backport [Uhttps://review.lttng.org/c/lttng-modules/+/11700]

Change-Id: I24ebb4e06dbb646a1af75ac62b74f3821ff197de
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 include/instrumentation/events/sched.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h
index 066a0f8..24cf37c 100644
--- a/include/instrumentation/events/sched.h
+++ b/include/instrumentation/events/sched.h
@@ -646,6 +646,24 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_blocked,
 	     TP_ARGS(tsk, delay))
 #endif
 
+#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).
@@ -663,6 +681,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) || \
-- 
2.39.2