public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: Remove second parameter to __assign_rel_str()
@ 2024-02-23 21:25 Steven Rostedt
  2024-02-26  0:34 ` Masami Hiramatsu
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2024-02-23 21:25 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel; +Cc: Masami Hiramatsu, Mathieu Desnoyers

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The second parameter of __assign_rel_str() is no longer used. It can be removed.

Note, the only real users of rel_string is user events. This code is just
in the sample code for testing purposes.

This makes __assign_rel_str() different than __assign_str() but that's
fine. __assign_str() is used over 700 places and has a larger impact. That
change will come later.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 include/trace/stages/stage6_event_callback.h | 2 +-
 samples/trace_events/trace-events-sample.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/stages/stage6_event_callback.h
index 935608971899..a0c15f67eabe 100644
--- a/include/trace/stages/stage6_event_callback.h
+++ b/include/trace/stages/stage6_event_callback.h
@@ -91,7 +91,7 @@
 #define __rel_string_len(item, src, len) __rel_dynamic_array(char, item, -1)
 
 #undef __assign_rel_str
-#define __assign_rel_str(dst, src)					\
+#define __assign_rel_str(dst)						\
 	do {								\
 		char *__str__ = __get_rel_str(dst);			\
 		int __len__ = __get_rel_dynamic_array_len(dst) - 1;	\
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 2dfaf7fc7bfa..500981eca74d 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -574,7 +574,7 @@ TRACE_EVENT(foo_rel_loc,
 	),
 
 	TP_fast_assign(
-		__assign_rel_str(foo, foo);
+		__assign_rel_str(foo);
 		__entry->bar = bar;
 		__assign_rel_bitmask(bitmask, mask,
 			BITS_PER_BYTE * sizeof(unsigned long));
-- 
2.43.0


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

* Re: [PATCH] tracing: Remove second parameter to __assign_rel_str()
  2024-02-23 21:25 [PATCH] tracing: Remove second parameter to __assign_rel_str() Steven Rostedt
@ 2024-02-26  0:34 ` Masami Hiramatsu
  0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2024-02-26  0:34 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux Trace Kernel, Masami Hiramatsu, Mathieu Desnoyers

On Fri, 23 Feb 2024 16:25:19 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> The second parameter of __assign_rel_str() is no longer used. It can be removed.
> 
> Note, the only real users of rel_string is user events. This code is just
> in the sample code for testing purposes.
> 
> This makes __assign_rel_str() different than __assign_str() but that's
> fine. __assign_str() is used over 700 places and has a larger impact. That
> change will come later.

Looks good to me.

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thanks,

> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  include/trace/stages/stage6_event_callback.h | 2 +-
>  samples/trace_events/trace-events-sample.h   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/stages/stage6_event_callback.h
> index 935608971899..a0c15f67eabe 100644
> --- a/include/trace/stages/stage6_event_callback.h
> +++ b/include/trace/stages/stage6_event_callback.h
> @@ -91,7 +91,7 @@
>  #define __rel_string_len(item, src, len) __rel_dynamic_array(char, item, -1)
>  
>  #undef __assign_rel_str
> -#define __assign_rel_str(dst, src)					\
> +#define __assign_rel_str(dst)						\
>  	do {								\
>  		char *__str__ = __get_rel_str(dst);			\
>  		int __len__ = __get_rel_dynamic_array_len(dst) - 1;	\
> diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
> index 2dfaf7fc7bfa..500981eca74d 100644
> --- a/samples/trace_events/trace-events-sample.h
> +++ b/samples/trace_events/trace-events-sample.h
> @@ -574,7 +574,7 @@ TRACE_EVENT(foo_rel_loc,
>  	),
>  
>  	TP_fast_assign(
> -		__assign_rel_str(foo, foo);
> +		__assign_rel_str(foo);
>  		__entry->bar = bar;
>  		__assign_rel_bitmask(bitmask, mask,
>  			BITS_PER_BYTE * sizeof(unsigned long));
> -- 
> 2.43.0
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

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

end of thread, other threads:[~2024-02-26  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-23 21:25 [PATCH] tracing: Remove second parameter to __assign_rel_str() Steven Rostedt
2024-02-26  0:34 ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox