All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 1/2] tracing: Exit out immediately after update_marker_trace()
Date: Wed, 05 Nov 2025 19:33:25 -0500	[thread overview]
Message-ID: <20251106003501.726406870@kernel.org> (raw)
In-Reply-To: 20251106003324.964761749@kernel.org

From: Steven Rostedt <rostedt@goodmis.org>

The call to update_marker_trace() in set_tracer_flag() performs the update
to the tr->trace_flags. There's no reason to perform it again after it is
called. Return immediately instead.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index dea1566b3301..07bd10808277 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5285,8 +5285,11 @@ int set_tracer_flag(struct trace_array *tr, u64 mask, int enabled)
 		}
 	}
 
-	if (mask == TRACE_ITER(COPY_MARKER))
+	if (mask == TRACE_ITER(COPY_MARKER)) {
 		update_marker_trace(tr, enabled);
+		/* update_marker_trace updates the tr->trace_flags */
+		return 0;
+	}
 
 	if (enabled)
 		tr->trace_flags |= mask;
-- 
2.51.0



  reply	other threads:[~2025-11-06  0:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  0:33 [PATCH 0/2] tracing: Clean up of set_tracer_flag() Steven Rostedt
2025-11-06  0:33 ` Steven Rostedt [this message]
2025-11-10  5:24   ` [PATCH 1/2] tracing: Exit out immediately after update_marker_trace() Masami Hiramatsu
2025-11-06  0:33 ` [PATCH 2/2] tracing: Use switch statement instead of ifs in set_tracer_flag() Steven Rostedt
2025-11-10  5:48   ` Masami Hiramatsu
2025-11-10 16:42     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251106003501.726406870@kernel.org \
    --to=rostedt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.