Message ID | 173886113592.496116.11615563462036645436.stgit@devnote2 (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/3] tracing: Skip update_last_data() if it is already updated | expand |
On Fri, 7 Feb 2025 01:58:56 +0900 "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote: > From: Masami Hiramatsu (Google) <mhiramat@kernel.org> > > Remove unnecessary active check because tr->flags already checks it. I've thought this over, and sure, if we start tracing on a persistent ring buffer, then it can add all modules loaded from then on even if it it's not tracing. Can you merge patches 1 and 2, rebase it on ring-buffer/for-next and resubmit this as one patch? Thanks, -- Steve
On Fri, 7 Mar 2025 10:21:37 -0500 Steven Rostedt <rostedt@goodmis.org> wrote: > On Fri, 7 Feb 2025 01:58:56 +0900 > "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote: > > > From: Masami Hiramatsu (Google) <mhiramat@kernel.org> > > > > Remove unnecessary active check because tr->flags already checks it. > > I've thought this over, and sure, if we start tracing on a persistent ring > buffer, then it can add all modules loaded from then on even if it it's not > tracing. > > Can you merge patches 1 and 2, rebase it on ring-buffer/for-next and > resubmit this as one patch? Oops, I've missed this message. OK, let me rebase it. Thanks, > > Thanks, > > -- Steve
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0f010a34de84..5a064e712fd7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -10090,15 +10090,6 @@ static void trace_module_remove_evals(struct module *mod) static inline void trace_module_remove_evals(struct module *mod) { } #endif /* CONFIG_TRACE_EVAL_MAP_FILE */ -static bool trace_array_active(struct trace_array *tr) -{ - if (tr->current_trace != &nop_trace) - return true; - - /* 0 is no events, 1 is all disabled */ - return trace_events_enabled(tr, NULL) > 1; -} - static void trace_module_record(struct module *mod) { struct trace_array *tr; @@ -10107,9 +10098,7 @@ static void trace_module_record(struct module *mod) /* Update any persistent trace array that has already been started */ if ((tr->flags & (TRACE_ARRAY_FL_BOOT | TRACE_ARRAY_FL_LAST_BOOT)) == TRACE_ARRAY_FL_BOOT) { - /* Only update if the trace array is active */ - if (trace_array_active(tr)) - save_mod(mod, tr); + save_mod(mod, tr); } } }