diff mbox series

tracing: Fix cpumask() example typo

Message ID 20221213221227.56560374@gandalf.local.home (mailing list archive)
State Accepted
Commit eb9d58947d40699d93e5e69e1ddc54e41da7e132
Headers show
Series tracing: Fix cpumask() example typo | expand

Commit Message

Steven Rostedt Dec. 14, 2022, 3:12 a.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The sample code for using cpumask used the wrong field for the
__get_cpumask() helper. It used "cpus" which is the bitmask (but would
still give a proper example) instead of the "cpum" that was there to be
used.

Although it produces the same output, fix it, because it's an example and
is confusing in how to properly use the cpumask() macro.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 samples/trace_events/trace-events-sample.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masami Hiramatsu (Google) Dec. 14, 2022, 7:29 a.m. UTC | #1
On Tue, 13 Dec 2022 22:12:27 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> The sample code for using cpumask used the wrong field for the
> __get_cpumask() helper. It used "cpus" which is the bitmask (but would
> still give a proper example) instead of the "cpum" that was there to be
> used.
> 
> Although it produces the same output, fix it, because it's an example and
> is confusing in how to properly use the cpumask() macro.
> 

Looks good to me.

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

Thanks,

> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  samples/trace_events/trace-events-sample.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
> index fb4548a44153..1c6b843b8c4e 100644
> --- a/samples/trace_events/trace-events-sample.h
> +++ b/samples/trace_events/trace-events-sample.h
> @@ -359,7 +359,7 @@ TRACE_EVENT(foo_bar,
>  		  __print_array(__get_dynamic_array(list),
>  				__get_dynamic_array_len(list) / sizeof(int),
>  				sizeof(int)),
> -		  __get_str(str), __get_bitmask(cpus), __get_cpumask(cpus),
> +		  __get_str(str), __get_bitmask(cpus), __get_cpumask(cpum),
>  		  __get_str(vstr))
>  );
>  
> -- 
> 2.35.1
>
Masami Hiramatsu (Google) Dec. 14, 2022, 11:44 p.m. UTC | #2
On Tue, 13 Dec 2022 22:12:27 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> The sample code for using cpumask used the wrong field for the
> __get_cpumask() helper. It used "cpus" which is the bitmask (but would
> still give a proper example) instead of the "cpum" that was there to be
> used.
> 
> Although it produces the same output, fix it, because it's an example and
> is confusing in how to properly use the cpumask() macro.
> 

Looks good to me.

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

Thanks,

> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  samples/trace_events/trace-events-sample.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
> index fb4548a44153..1c6b843b8c4e 100644
> --- a/samples/trace_events/trace-events-sample.h
> +++ b/samples/trace_events/trace-events-sample.h
> @@ -359,7 +359,7 @@ TRACE_EVENT(foo_bar,
>  		  __print_array(__get_dynamic_array(list),
>  				__get_dynamic_array_len(list) / sizeof(int),
>  				sizeof(int)),
> -		  __get_str(str), __get_bitmask(cpus), __get_cpumask(cpus),
> +		  __get_str(str), __get_bitmask(cpus), __get_cpumask(cpum),
>  		  __get_str(vstr))
>  );
>  
> -- 
> 2.35.1
>
diff mbox series

Patch

diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index fb4548a44153..1c6b843b8c4e 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -359,7 +359,7 @@  TRACE_EVENT(foo_bar,
 		  __print_array(__get_dynamic_array(list),
 				__get_dynamic_array_len(list) / sizeof(int),
 				sizeof(int)),
-		  __get_str(str), __get_bitmask(cpus), __get_cpumask(cpus),
+		  __get_str(str), __get_bitmask(cpus), __get_cpumask(cpum),
 		  __get_str(vstr))
 );