diff --git a/patches.kernel.org/6.2.12-101-tracing-Have-tracing_snapshot_instance_cond-wr.patch b/patches.kernel.org/6.2.12-101-tracing-Have-tracing_snapshot_instance_cond-wr.patch new file mode 100644 index 0000000..02ea21b --- /dev/null +++ b/patches.kernel.org/6.2.12-101-tracing-Have-tracing_snapshot_instance_cond-wr.patch @@ -0,0 +1,67 @@ +From: "Steven Rostedt (Google)" +Date: Tue, 4 Apr 2023 22:21:14 -0400 +Subject: [PATCH] tracing: Have tracing_snapshot_instance_cond() write errors + to the appropriate instance +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 9d52727f8043cfda241ae96896628d92fa9c50bb + +[ Upstream commit 9d52727f8043cfda241ae96896628d92fa9c50bb ] + +If a trace instance has a failure with its snapshot code, the error +message is to be written to that instance's buffer. But currently, the +message is written to the top level buffer. Worse yet, it may also disable +the top level buffer and not the instance that had the issue. + +Link: https://lkml.kernel.org/r/20230405022341.688730321@goodmis.org + +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Mark Rutland +Cc: Andrew Morton +Cc: Ross Zwisler +Fixes: 2824f50332486 ("tracing: Make the snapshot trigger work with instances") +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + kernel/trace/trace.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 13c46787..13b324f0 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -1111,22 +1111,22 @@ static void tracing_snapshot_instance_cond(struct trace_array *tr, + unsigned long flags; + + if (in_nmi()) { +- internal_trace_puts("*** SNAPSHOT CALLED FROM NMI CONTEXT ***\n"); +- internal_trace_puts("*** snapshot is being ignored ***\n"); ++ trace_array_puts(tr, "*** SNAPSHOT CALLED FROM NMI CONTEXT ***\n"); ++ trace_array_puts(tr, "*** snapshot is being ignored ***\n"); + return; + } + + if (!tr->allocated_snapshot) { +- internal_trace_puts("*** SNAPSHOT NOT ALLOCATED ***\n"); +- internal_trace_puts("*** stopping trace here! ***\n"); +- tracing_off(); ++ trace_array_puts(tr, "*** SNAPSHOT NOT ALLOCATED ***\n"); ++ trace_array_puts(tr, "*** stopping trace here! ***\n"); ++ tracer_tracing_off(tr); + return; + } + + /* Note, snapshot can not be used when the tracer uses it */ + if (tracer->use_max_tr) { +- internal_trace_puts("*** LATENCY TRACER ACTIVE ***\n"); +- internal_trace_puts("*** Can not use snapshot (sorry) ***\n"); ++ trace_array_puts(tr, "*** LATENCY TRACER ACTIVE ***\n"); ++ trace_array_puts(tr, "*** Can not use snapshot (sorry) ***\n"); + return; + } + +-- +2.35.3 + diff --git a/series.conf b/series.conf index 1f53e99..c884169 100644 --- a/series.conf +++ b/series.conf @@ -2328,6 +2328,7 @@ patches.kernel.org/6.2.12-098-drm-amdgpu-gfx-set-cg-flags-to-enter-exit-safe.patch patches.kernel.org/6.2.12-099-ACPI-resource-Add-Medion-S17413-to-IRQ-overrid.patch patches.kernel.org/6.2.12-100-tracing-Add-trace_array_puts-to-write-into-ins.patch + patches.kernel.org/6.2.12-101-tracing-Have-tracing_snapshot_instance_cond-wr.patch ######################################################## # Build fixes that apply to the vanilla kernel too.