[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230715141213.970003974@goodmis.org>
Date: Sat, 15 Jul 2023 10:12:13 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH v2 0/2] tracing: Clean up how iter is freed
The trace iterator is used in various interfaces and needs to be consistent
in how it is cleaned up. Add a helper function to clean up its content. But
before doing so, I noticed that iter->trace is allocated then the content
of tr->current_trace is copied to it. There's no reason for this, so the
first patch removes that allocation and just points to the content of
tr->current_trace, as tr->current_trace can change, but the content should
not.
Changes since v1: https://lore.kernel.org/linux-trace-kernel/20230713114510.04c452ca@gandalf.local.home/
- Updated the change log of patch 1, as I remembered why the copy was done.
- Remove the allocation and copy of the second patch. I started with the
second patch and noticed that there was an inconsistency with the
iter->trace. Where in one place it was allocated and copied and the second
place it was just pointing to the tr->current_trace. I first started to make it
be a copy as well, but then realized that the copy wasn't needed. I created
the first patch but forgot to remove the copy and it ended up in the second
patch.
Steven Rostedt (Google) (2):
tracing: Remove unnecessary copying of tr->current_trace
tracing: Add free_trace_iter_content() helper function
----
kernel/trace/trace.c | 55 ++++++++++++++++++++++++----------------------------
1 file changed, 25 insertions(+), 30 deletions(-)
Powered by blists - more mailing lists