Steven Rostedt (Google) cca990c7b5 tracing: Fix snapshot counter going between two tracers that use it
Running the ftrace selftests caused the ring buffer mapping test to fail.
Investigating, I found that the snapshot counter would be incremented
every time a tracer that uses the snapshot is enabled even if the snapshot
was used by the previous tracer.

That is:

 # cd /sys/kernel/tracing
 # echo wakeup_rt > current_tracer
 # echo wakeup_dl > current_tracer
 # echo nop > current_tracer

would leave the snapshot counter at 1 and not zero. That's because the
enabling of wakeup_dl would increment the counter again but the setting
the tracer to nop would only decrement it once.

Do not arm the snapshot for a tracer if the previous tracer already had it
armed.

Link: https://lore.kernel.org/linux-trace-kernel/20240223013344.570525723@goodmis.org

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vincent Donnefort <vdonnefort@google.com>
Fixes: 16f7e48ffc53a ("tracing: Add snapshot refcount")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2024-03-18 10:33:05 -04:00
2024-03-14 16:16:33 -07:00
2024-03-11 17:11:28 -07:00
2024-03-13 12:40:58 -07:00
2024-03-11 11:35:31 -07:00
2023-12-20 19:26:31 -05:00
2024-03-14 10:58:27 -07:00
\n
2024-03-13 14:30:58 -07:00
2024-03-14 15:35:42 -07:00
2024-03-14 16:00:27 -07:00
2024-03-14 15:35:42 -07:00
2024-03-14 16:05:20 -07:00
2024-03-14 11:10:43 -07:00
2024-01-18 17:57:07 -08:00
2024-03-12 17:44:08 -07:00
2022-09-28 09:02:20 +02:00
2024-03-11 09:55:17 -07:00
2022-10-10 12:00:45 -07:00
2024-03-14 15:35:42 -07:00
2024-03-14 15:35:42 -07:00
2024-02-12 16:42:13 -07:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the ReStructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 5.7 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%