linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing/probe: reverse arguments to list_add
@ 2020-05-07 19:30 Julia Lawall
  2020-05-07 20:50 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2020-05-07 19:30 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: kernel-janitors, Ingo Molnar, linux-kernel, Nic Volanschi

Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses
a trace_probe_event.probes object as the second argument of
list_for_each_entry, ie as a list head, while the list_for_each_entry
iterates over the list fields of the trace_probe structures, making
them the list elements.  So, exchange the arguments on the list_add
call to put the list head in the second argument.

Since both list_head structures were just initialized, this problem
did not cause any loss of information.

Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 kernel/trace/trace_probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index ab8b6436d53f..b8a928e925c7 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1006,7 +1006,7 @@ int trace_probe_init(struct trace_probe *tp, const char *event,
 	INIT_LIST_HEAD(&tp->event->class.fields);
 	INIT_LIST_HEAD(&tp->event->probes);
 	INIT_LIST_HEAD(&tp->list);
-	list_add(&tp->event->probes, &tp->list);
+	list_add(&tp->list, &tp->event->probes);
 
 	call = trace_probe_event_call(tp);
 	call->class = &tp->event->class;


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

* Re: [PATCH] tracing/probe: reverse arguments to list_add
  2020-05-07 19:30 [PATCH] tracing/probe: reverse arguments to list_add Julia Lawall
@ 2020-05-07 20:50 ` Steven Rostedt
  2020-05-07 20:52   ` Steven Rostedt
  2020-05-07 23:57   ` Masami Hiramatsu
  0 siblings, 2 replies; 5+ messages in thread
From: Steven Rostedt @ 2020-05-07 20:50 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Ingo Molnar, linux-kernel, Nic Volanschi,
	Masami Hiramatsu

On Thu,  7 May 2020 21:30:08 +0200
Julia Lawall <Julia.Lawall@inria.fr> wrote:

> Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses
> a trace_probe_event.probes object as the second argument of
> list_for_each_entry, ie as a list head, while the list_for_each_entry
> iterates over the list fields of the trace_probe structures, making
> them the list elements.  So, exchange the arguments on the list_add
> call to put the list head in the second argument.
> 
> Since both list_head structures were just initialized, this problem
> did not cause any loss of information.
> 
> Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

Masami,

Can you give a Reviewed-by to this?

-- Steve

> 
> ---
>  kernel/trace/trace_probe.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index ab8b6436d53f..b8a928e925c7 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -1006,7 +1006,7 @@ int trace_probe_init(struct trace_probe *tp, const char *event,
>  	INIT_LIST_HEAD(&tp->event->class.fields);
>  	INIT_LIST_HEAD(&tp->event->probes);
>  	INIT_LIST_HEAD(&tp->list);
> -	list_add(&tp->event->probes, &tp->list);
> +	list_add(&tp->list, &tp->event->probes);
>  
>  	call = trace_probe_event_call(tp);
>  	call->class = &tp->event->class;


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

* Re: [PATCH] tracing/probe: reverse arguments to list_add
  2020-05-07 20:50 ` Steven Rostedt
@ 2020-05-07 20:52   ` Steven Rostedt
  2020-05-07 20:53     ` Julia Lawall
  2020-05-07 23:57   ` Masami Hiramatsu
  1 sibling, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2020-05-07 20:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Ingo Molnar, linux-kernel, Nic Volanschi,
	Masami Hiramatsu

On Thu, 7 May 2020 16:50:53 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu,  7 May 2020 21:30:08 +0200
> Julia Lawall <Julia.Lawall@inria.fr> wrote:
> 
> > Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses
> > a trace_probe_event.probes object as the second argument of
> > list_for_each_entry, ie as a list head, while the list_for_each_entry
> > iterates over the list fields of the trace_probe structures, making
> > them the list elements.  So, exchange the arguments on the list_add
> > call to put the list head in the second argument.
> > 
> > Since both list_head structures were just initialized, this problem
> > did not cause any loss of information.
> > 
> > Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
> > Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>  
> 

Julia,

As this doesn't cause any harm (as you state, both lists have just been
initialized), it doesn't need to go into this -rc release. Would you agree?

-- Steve

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

* Re: [PATCH] tracing/probe: reverse arguments to list_add
  2020-05-07 20:52   ` Steven Rostedt
@ 2020-05-07 20:53     ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2020-05-07 20:53 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kernel-janitors, Ingo Molnar, linux-kernel, Nic Volanschi,
	Masami Hiramatsu



On Thu, 7 May 2020, Steven Rostedt wrote:

> On Thu, 7 May 2020 16:50:53 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Thu,  7 May 2020 21:30:08 +0200
> > Julia Lawall <Julia.Lawall@inria.fr> wrote:
> >
> > > Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses
> > > a trace_probe_event.probes object as the second argument of
> > > list_for_each_entry, ie as a list head, while the list_for_each_entry
> > > iterates over the list fields of the trace_probe structures, making
> > > them the list elements.  So, exchange the arguments on the list_add
> > > call to put the list head in the second argument.
> > >
> > > Since both list_head structures were just initialized, this problem
> > > did not cause any loss of information.
> > >
> > > Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
> > > Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
> >
>
> Julia,
>
> As this doesn't cause any harm (as you state, both lists have just been
> initialized), it doesn't need to go into this -rc release. Would you agree?

No, no need for -rc.

thanks,
julia

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

* Re: [PATCH] tracing/probe: reverse arguments to list_add
  2020-05-07 20:50 ` Steven Rostedt
  2020-05-07 20:52   ` Steven Rostedt
@ 2020-05-07 23:57   ` Masami Hiramatsu
  1 sibling, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2020-05-07 23:57 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Julia Lawall, kernel-janitors, Ingo Molnar, linux-kernel,
	Nic Volanschi, Masami Hiramatsu

On Thu, 7 May 2020 16:50:53 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu,  7 May 2020 21:30:08 +0200
> Julia Lawall <Julia.Lawall@inria.fr> wrote:
> 
> > Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses
> > a trace_probe_event.probes object as the second argument of
> > list_for_each_entry, ie as a list head, while the list_for_each_entry
> > iterates over the list fields of the trace_probe structures, making
> > them the list elements.  So, exchange the arguments on the list_add
> > call to put the list head in the second argument.
> > 
> > Since both list_head structures were just initialized, this problem
> > did not cause any loss of information.
> > 

Oops, good catch!

> > Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
> > Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
> 
> Masami,
> 
> Can you give a Reviewed-by to this?

Yes, thanks Julia!

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

Thank you,
> 
> -- Steve
> 
> > 
> > ---
> >  kernel/trace/trace_probe.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> > index ab8b6436d53f..b8a928e925c7 100644
> > --- a/kernel/trace/trace_probe.c
> > +++ b/kernel/trace/trace_probe.c
> > @@ -1006,7 +1006,7 @@ int trace_probe_init(struct trace_probe *tp, const char *event,
> >  	INIT_LIST_HEAD(&tp->event->class.fields);
> >  	INIT_LIST_HEAD(&tp->event->probes);
> >  	INIT_LIST_HEAD(&tp->list);
> > -	list_add(&tp->event->probes, &tp->list);
> > +	list_add(&tp->list, &tp->event->probes);
> >  
> >  	call = trace_probe_event_call(tp);
> >  	call->class = &tp->event->class;
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

end of thread, other threads:[~2020-05-07 23:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 19:30 [PATCH] tracing/probe: reverse arguments to list_add Julia Lawall
2020-05-07 20:50 ` Steven Rostedt
2020-05-07 20:52   ` Steven Rostedt
2020-05-07 20:53     ` Julia Lawall
2020-05-07 23:57   ` Masami Hiramatsu

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