diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-04-01 15:37:49 +0900 |
|---|---|---|
| committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2026-04-02 13:20:38 -0400 |
| commit | 2c79da099aac174e1c0e8e22b249f49e9256e966 (patch) | |
| tree | a6622da60511a221fa7bc90c5d03d4bf1e006778 /kernel/trace/trace.h | |
| parent | 20ad8b0888be392eb2c4c3654805eb8594952373 (diff) | |
| download | linux-next-2c79da099aac174e1c0e8e22b249f49e9256e966.tar.gz linux-next-2c79da099aac174e1c0e8e22b249f49e9256e966.zip | |
tracing: Make the backup instance non-reusable
Since there is no reason to reuse the backup instance, make it readonly
(but erasable). Note that only backup instances are readonly, because
other trace instances will be empty unless it is writable. Only backup
instances have copy entries from the original.
With this change, most of the trace control files are removed from the
backup instance, including eventfs enable/filter etc.
# find /sys/kernel/tracing/instances/backup/events/ | wc -l
4093
# find /sys/kernel/tracing/instances/boot_map/events/ | wc -l
9573
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/177502546939.1311542.1826814401724828930.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
| -rw-r--r-- | kernel/trace/trace.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index fbbd0b2ee76f..366baa43dfab 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -462,6 +462,7 @@ enum { TRACE_ARRAY_FL_MOD_INIT = BIT(3), TRACE_ARRAY_FL_MEMMAP = BIT(4), TRACE_ARRAY_FL_VMALLOC = BIT(5), + TRACE_ARRAY_FL_RDONLY = BIT(6), }; #ifdef CONFIG_MODULES @@ -491,6 +492,12 @@ extern unsigned long trace_adjust_address(struct trace_array *tr, unsigned long extern struct trace_array *printk_trace; +static inline bool trace_array_is_readonly(struct trace_array *tr) +{ + /* backup instance is read only. */ + return tr->flags & TRACE_ARRAY_FL_RDONLY; +} + /* * The global tracer (top) should be the first trace array added, * but we check the flag anyway. |
