diff mbox series

[2/3] tracing: Remove checking the activity when module map is updating

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

Commit Message

Masami Hiramatsu (Google) Feb. 6, 2025, 4:58 p.m. UTC
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Remove unnecessary active check because tr->flags already checks it.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 kernel/trace/trace.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Steven Rostedt March 7, 2025, 3:21 p.m. UTC | #1
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
Masami Hiramatsu (Google) March 11, 2025, 12:40 a.m. UTC | #2
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 mbox series

Patch

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);
 		}
 	}
 }