summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2022-10-18 20:34:53 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-10-18 20:35:34 +0300
commit46fc02f3932e37eb07ed7cd23ac96d464c6db55c (patch)
treeb60616a81b0bbc1012f678b783df7c2e07f72161 /poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch
parenta515de07dfa9eda7a303af296666e2572e581df7 (diff)
downloadopenbmc-46fc02f3932e37eb07ed7cd23ac96d464c6db55c.tar.xz
subtree updateshonister
meta-openembedded: 9a0caf5b09..0e6c34f82c: Martin Jansa (1): ostree: prevent ostree-native depending on target virtual/kernel to provide kernel-module-overlay Nicolas Dechesne (1): imlib2: update SRC_URI poky: eff78b3802..fd00d74f47: Alexandre Belloni (1): pseudo: Fix handling of absolute links Anuj Mittal (2): poky.conf: bump version for 3.4.4 release documentation: update for 3.4.4 release Bruce Ashfield (10): linux-yocto/5.10: update to v5.10.109 lttng-modules: update to 2.13.1 lttng-modules: support kernel 5.18+ linux-yocto/5.10: features/security: Move x86_64 configs to separate file linux-yocto/5.10: update to v5.10.110 linux-yocto/5.10: base: enable kernel crypto userspace API linux-yocto/5.10: update to v5.10.112 linux-yocto: enable powerpc debug fragment linux-yocto/5.10: update to v5.10.113 yocto-bsps: update to v5.10.113 Chen Qi (1): cases/buildepoxy.py: fix typo Davide Gardenal (1): rootfs-postcommands: fix symlinks where link and output path are equal Dmitry Baryshkov (2): linux-firmware: correct license for ar3k firmware linux-firmware: upgrade 20220411 -> 20220509 Felix Moessbauer (1): wic/plugins/rootfs: Fix permissions when splitting rootfs folders across partitions Joe Slater (1): unzip: fix CVE-2021-4217 Khem Raj (2): busybox: Use base_bindir instead of hardcoding /bin path linux-yocto: Enable powerpc-debug fragment for ppc64 LE Konrad Weihmann (1): gmp: add missing COPYINGv3 Martin Jansa (1): license_image.bbclass: close package.manifest file Max Krummenacher (2): perf: sort-pmuevents: don't drop elements perf: sort-pmuevents: allow for additional type qualifiers and storage class Michael Opdenacker (1): adding missing space in appends Ovidiu Panait (1): openssl: upgrade 1.1.1l -> 1.1.1n Paul Gortmaker (1): install/devshell: Introduce git intercept script due to fakeroot issues Peter Kjellerstedt (1): u-boot: Inherit pkgconfig Portia (1): volatile-binds: Change DefaultDependencies from false to no Rahul Kumar (1): neard: Switch SRC_URI to git repo Ralph Siemsen (1): xz: fix CVE-2022-1271 Ranjitsinh Rathod (1): openssl: Minor security upgrade 1.1.1n to 1.1.1o Richard Purdie (14): scripts/runqemu: Fix memory limits for qemux86-64 vim: Upgrade 8.2.4524 -> 8.2.4681 uninative: Upgrade to 3.6 with gcc 12 support tiff: Add marker for CVE-2022-1056 being fixed externalsrc/devtool: Fix to work with fixed export funcition flags handling libxshmfence: Correct LICENSE to HPND alsa-tools: Ensure we install correctly shadow-native: Simplify and fix syslog disable patch build-appliance-image: Update to honister head revision base: Avoid circular references to our own scripts base: Drop git intercept scripts: Make git intercept global scripts/git: Ensure we don't have circular references vim: Upgrade 8.2.4681 -> 8.2.4912 Ross Burton (4): bitbake: knotty: display active tasks when printing keepAlive() message bitbake: knotty: reduce keep-alive timeout from 5000s (83 minutes) to 10 minutes bitbake.conf: mark all directories as safe for git to read oeqa/selftest: add test for git working correctly inside pseudo wangmy (3): linux-firmware: upgrade 20220310 -> 20220411 lttng-modules: upgrade 2.13.1 -> 2.13.2 lttng-modules: upgrade 2.13.2 -> 2.13.3 zhengruoqin (1): wireless-regdb: upgrade 2022.02.18 -> 2022.04.08 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0298ba1d7a4f4f77e0ebe24f18b3f8bdc326097b
Diffstat (limited to 'poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch')
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch183
1 files changed, 183 insertions, 0 deletions
diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch b/poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch
new file mode 100644
index 0000000000..afe514de82
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-modules/0003-fix-sched-tracing-Don-t-re-read-p-state-when-emittin.patch
@@ -0,0 +1,183 @@
+From 8e52fd71e693619f7a58de2692e59f0c826e9988 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Mon, 4 Apr 2022 13:52:57 -0400
+Subject: [PATCH 03/10] fix: sched/tracing: Don't re-read p->state when
+ emitting sched_switch event (v5.18)
+
+See upstream commit :
+
+ commit fa2c3254d7cfff5f7a916ab928a562d1165f17bb
+ Author: Valentin Schneider <valentin.schneider@arm.com>
+ Date: Thu Jan 20 16:25:19 2022 +0000
+
+ sched/tracing: Don't re-read p->state when emitting sched_switch event
+
+ As of commit
+
+ c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu")
+
+ the following sequence becomes possible:
+
+ p->__state = TASK_INTERRUPTIBLE;
+ __schedule()
+ deactivate_task(p);
+ ttwu()
+ READ !p->on_rq
+ p->__state=TASK_WAKING
+ trace_sched_switch()
+ __trace_sched_switch_state()
+ task_state_index()
+ return 0;
+
+ TASK_WAKING isn't in TASK_REPORT, so the task appears as TASK_RUNNING in
+ the trace event.
+
+ Prevent this by pushing the value read from __schedule() down the trace
+ event.
+
+Upstream-Status: Backport
+
+Change-Id: I46743cd006be4b4d573cae2d77df7d6d16744d04
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ include/instrumentation/events/sched.h | 88 +++++++++++++++++++++++---
+ 1 file changed, 78 insertions(+), 10 deletions(-)
+
+diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h
+index 91953a6f..339bec94 100644
+--- a/include/instrumentation/events/sched.h
++++ b/include/instrumentation/events/sched.h
+@@ -20,7 +20,37 @@
+ #ifndef _TRACE_SCHED_DEF_
+ #define _TRACE_SCHED_DEF_
+
+-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0))
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0))
++
++static inline long __trace_sched_switch_state(bool preempt,
++ unsigned int prev_state,
++ struct task_struct *p)
++{
++ unsigned int state;
++
++#ifdef CONFIG_SCHED_DEBUG
++ BUG_ON(p != current);
++#endif /* CONFIG_SCHED_DEBUG */
++
++ /*
++ * Preemption ignores task state, therefore preempted tasks are always
++ * RUNNING (we will not have dequeued if state != RUNNING).
++ */
++ if (preempt)
++ return TASK_REPORT_MAX;
++
++ /*
++ * task_state_index() uses fls() and returns a value from 0-8 range.
++ * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using
++ * it for left shift operation to get the correct task->state
++ * mapping.
++ */
++ state = __task_state_index(prev_state, p->exit_state);
++
++ return state ? (1 << (state - 1)) : state;
++}
++
++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0))
+
+ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p)
+ {
+@@ -321,43 +351,81 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new,
+ /*
+ * Tracepoint for task switches, performed by the scheduler:
+ */
++
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0))
+ LTTNG_TRACEPOINT_EVENT(sched_switch,
+
+-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0))
+ TP_PROTO(bool preempt,
+- struct task_struct *prev,
+- struct task_struct *next),
++ unsigned int prev_state,
++ struct task_struct *prev,
++ struct task_struct *next),
+
+- TP_ARGS(preempt, prev, next),
++ TP_ARGS(preempt, prev_state, prev, next),
++
++ TP_FIELDS(
++ ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN)
++ ctf_integer(pid_t, prev_tid, prev->pid)
++ ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO)
++#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
++ ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev_state, prev))
+ #else
+- TP_PROTO(struct task_struct *prev,
++ ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev_state, prev))
++#endif
++ ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN)
++ ctf_integer(pid_t, next_tid, next->pid)
++ ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO)
++ )
++)
++
++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0))
++
++LTTNG_TRACEPOINT_EVENT(sched_switch,
++
++ TP_PROTO(bool preempt,
++ struct task_struct *prev,
+ struct task_struct *next),
+
+- TP_ARGS(prev, next),
+-#endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) */
++ TP_ARGS(preempt, prev, next),
+
+ TP_FIELDS(
+ ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN)
+ ctf_integer(pid_t, prev_tid, prev->pid)
+ ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO)
+-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0))
+ #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
+ ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev))
+ #else
+ ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev))
+ #endif
++ ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN)
++ ctf_integer(pid_t, next_tid, next->pid)
++ ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO)
++ )
++)
++
+ #else
++
++LTTNG_TRACEPOINT_EVENT(sched_switch,
++
++ TP_PROTO(struct task_struct *prev,
++ struct task_struct *next),
++
++ TP_ARGS(prev, next),
++
++ TP_FIELDS(
++ ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN)
++ ctf_integer(pid_t, prev_tid, prev->pid)
++ ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO)
+ #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
+ ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev))
+ #else
+ ctf_integer(long, prev_state, __trace_sched_switch_state(prev))
+-#endif
+ #endif
+ ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN)
+ ctf_integer(pid_t, next_tid, next->pid)
+ ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO)
+ )
+ )
++#endif
+
+ /*
+ * Tracepoint for a task being migrated:
+--
+2.19.1
+