]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Feb 2021 08:17:37 +0000 (09:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Feb 2021 08:17:37 +0000 (09:17 +0100)
added patches:
tracing-do-not-count-ftrace-events-in-top-level-enable-output.patch

queue-4.4/series
queue-4.4/tracing-do-not-count-ftrace-events-in-top-level-enable-output.patch [new file with mode: 0644]

index d8e47ce2e6ed05e9c6ecf1236b4aeb1c0d4fa652..6f0b2c40a7e03605a1299f923bf3bd4b9829058c 100644 (file)
@@ -1,3 +1,4 @@
+tracing-do-not-count-ftrace-events-in-top-level-enable-output.patch
 fgraph-initialize-tracing_graph_pause-at-task-creation.patch
 af_key-relax-availability-checks-for-skb-size-calcul.patch
 iwlwifi-pcie-add-a-null-check-in-iwl_pcie_txq_unmap.patch
diff --git a/queue-4.4/tracing-do-not-count-ftrace-events-in-top-level-enable-output.patch b/queue-4.4/tracing-do-not-count-ftrace-events-in-top-level-enable-output.patch
new file mode 100644 (file)
index 0000000..d43c4c0
--- /dev/null
@@ -0,0 +1,48 @@
+From 256cfdd6fdf70c6fcf0f7c8ddb0ebd73ce8f3bc9 Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Fri, 5 Feb 2021 15:40:04 -0500
+Subject: tracing: Do not count ftrace events in top level enable output
+
+From: Steven Rostedt (VMware) <rostedt@goodmis.org>
+
+commit 256cfdd6fdf70c6fcf0f7c8ddb0ebd73ce8f3bc9 upstream.
+
+The file /sys/kernel/tracing/events/enable is used to enable all events by
+echoing in "1", or disabling all events when echoing in "0". To know if all
+events are enabled, disabled, or some are enabled but not all of them,
+cating the file should show either "1" (all enabled), "0" (all disabled), or
+"X" (some enabled but not all of them). This works the same as the "enable"
+files in the individule system directories (like tracing/events/sched/enable).
+
+But when all events are enabled, the top level "enable" file shows "X". The
+reason is that its checking the "ftrace" events, which are special events
+that only exist for their format files. These include the format for the
+function tracer events, that are enabled when the function tracer is
+enabled, but not by the "enable" file. The check includes these events,
+which will always be disabled, and even though all true events are enabled,
+the top level "enable" file will show "X" instead of "1".
+
+To fix this, have the check test the event's flags to see if it has the
+"IGNORE_ENABLE" flag set, and if so, not test it.
+
+Cc: stable@vger.kernel.org
+Fixes: 553552ce1796c ("tracing: Combine event filter_active and enable into single flags field")
+Reported-by: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/trace/trace_events.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/trace/trace_events.c
++++ b/kernel/trace/trace_events.c
+@@ -1083,7 +1083,8 @@ system_enable_read(struct file *filp, ch
+       mutex_lock(&event_mutex);
+       list_for_each_entry(file, &tr->events, list) {
+               call = file->event_call;
+-              if (!trace_event_name(call) || !call->class || !call->class->reg)
++              if ((call->flags & TRACE_EVENT_FL_IGNORE_ENABLE) ||
++                  !trace_event_name(call) || !call->class || !call->class->reg)
+                       continue;
+               if (system && strcmp(call->class->system, system->name) != 0)