linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tracing: Clean up how iter is freed
@ 2023-07-15 14:12 Steven Rostedt
  2023-07-15 14:12 ` [PATCH v2 1/2] tracing: Remove unnecessary copying of tr->current_trace Steven Rostedt
  2023-07-15 14:12 ` [PATCH v2 2/2] tracing: Add free_trace_iter_content() helper function Steven Rostedt
  0 siblings, 2 replies; 5+ messages in thread
From: Steven Rostedt @ 2023-07-15 14:12 UTC (permalink / raw)
  To: linux-kernel, linux-trace-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton

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(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-28 23:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-15 14:12 [PATCH v2 0/2] tracing: Clean up how iter is freed Steven Rostedt
2023-07-15 14:12 ` [PATCH v2 1/2] tracing: Remove unnecessary copying of tr->current_trace Steven Rostedt
2023-07-15 14:12 ` [PATCH v2 2/2] tracing: Add free_trace_iter_content() helper function Steven Rostedt
2023-07-26 13:42   ` Masami Hiramatsu
2023-07-28 23:08     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).