diff --git a/meta-luneos/recipes-kernel/lttng/lttng-modules/0001-sched.h-Fix-compile-error-with-HMP-scheduler-used-in.patch b/meta-luneos/recipes-kernel/lttng/lttng-modules/0001-sched.h-Fix-compile-error-with-HMP-scheduler-used-in.patch new file mode 100644 index 0000000000..2e019e9565 --- /dev/null +++ b/meta-luneos/recipes-kernel/lttng/lttng-modules/0001-sched.h-Fix-compile-error-with-HMP-scheduler-used-in.patch @@ -0,0 +1,39 @@ +From e9b8cd9dcd39f6f864eea2e12856e65cb3a82442 Mon Sep 17 00:00:00 2001 +From: Herrie +Date: Fri, 10 May 2024 08:34:29 +0200 +Subject: [PATCH] sched.h: Fix compile error with HMP scheduler used in the MSM + 4.9 kernels (tissot, mido, rosy, sargo) + +HMP scheduler which seems MSM kernel specific was introduced in the Mido, Tissot, Rosy and Sargo kernels with https://github.com/shr-distribution/linux/commit/dddcab78bdda9d63b5cf6ddcdc30f815d98e8d98 or similar commit such as https://github.com/shr-distribution/linux/commit/c662231a6bfe77e202254913f9c51d9377650e8f. However HMP support never made it in this way to mainline kernel in this way and lttng-modules doesn't accommodate for it. + +Simply patch it in here. + +Signed-off-by: Herman van Hazendonk +--- +Upstream-Status: Inappropriate [LuneOS Specific] + + include/instrumentation/events/sched.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h +index 24cf37c8..ef7ac2f6 100644 +--- a/include/instrumentation/events/sched.h ++++ b/include/instrumentation/events/sched.h +@@ -434,14 +434,15 @@ LTTNG_TRACEPOINT_EVENT(sched_switch, + */ + LTTNG_TRACEPOINT_EVENT(sched_migrate_task, + +- TP_PROTO(struct task_struct *p, int dest_cpu), ++ TP_PROTO(struct task_struct *p, int dest_cpu, unsigned int load), + +- TP_ARGS(p, dest_cpu), ++ TP_ARGS(p, dest_cpu, load), + + TP_FIELDS( + ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, p->pid) + ctf_integer(int, prio, p->prio - MAX_RT_PRIO) ++ ctf_integer(unsigned int, load, load ) + ctf_integer(int, orig_cpu, task_cpu(p)) + ctf_integer(int, dest_cpu, dest_cpu) + ) diff --git a/meta-luneos/recipes-kernel/lttng/lttng-modules/0002-mm_vmscan.h-Update-the-kernel-version-check-for-mm_v.patch b/meta-luneos/recipes-kernel/lttng/lttng-modules/0002-mm_vmscan.h-Update-the-kernel-version-check-for-mm_v.patch new file mode 100644 index 0000000000..6289372b47 --- /dev/null +++ b/meta-luneos/recipes-kernel/lttng/lttng-modules/0002-mm_vmscan.h-Update-the-kernel-version-check-for-mm_v.patch @@ -0,0 +1,28 @@ +From 2fab84f654cc1e120135426ad6fbabba866bd909 Mon Sep 17 00:00:00 2001 +From: Herrie +Date: Fri, 10 May 2024 09:27:30 +0200 +Subject: [PATCH] mm_vmscan.h: Update the kernel version check for + mm_vmscan_lru_isolate + +Seems that we have mm_vmscan_lru_isolate for Tissot, Mido and Sargo in 4.9 kernel due to https://github.com/shr-distribution/linux/commit/e6a14ff915c2cb0fb6f58d7d55efaa5e3b3f0fc5, even though this only hit in 4.11 in mainline kernel (https://github.com/torvalds/linux/commit/30b9aed8cd576964bff71a6c5f022ca30ac4c3b7). + +Signed-off-by: Herman van Hazendonk +--- +Upstream-Status: Inappropriate [LuneOS Specific] + + include/instrumentation/events/mm_vmscan.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/instrumentation/events/mm_vmscan.h b/include/instrumentation/events/mm_vmscan.h +index ea6f4b78..6578f313 100644 +--- a/include/instrumentation/events/mm_vmscan.h ++++ b/include/instrumentation/events/mm_vmscan.h +@@ -395,7 +395,7 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, + ctf_integer(int, lru, lru) + ) + ) +-#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,9,0)) + LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, + + TP_PROTO(int classzone_idx, diff --git a/meta-luneos/recipes-kernel/lttng/lttng-modules_%.bbappend b/meta-luneos/recipes-kernel/lttng/lttng-modules_%.bbappend new file mode 100644 index 0000000000..5d3fd0e06c --- /dev/null +++ b/meta-luneos/recipes-kernel/lttng/lttng-modules_%.bbappend @@ -0,0 +1,8 @@ +# Our Android Frankenkernels have some backports of patches and exotic patches that aren't in mainline, therefore patch lttng-modules in order to accomodate this. + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +SRC_URI:append:halium = " \ + file://0001-sched.h-Fix-compile-error-with-HMP-scheduler-used-in.patch \ + file://0002-mm_vmscan.h-Update-the-kernel-version-check-for-mm_v.patch \ +"