All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] tracing: Fix issue of missing one synthetic field" failed to apply to 5.15-stable tree
@ 2023-01-04 14:10 gregkh
  2023-01-05  3:54 ` [PATCH 5.15] tracing: Fix issue of missing one synthetic field Zheng Yejian
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2023-01-04 14:10 UTC (permalink / raw)
  To: zhengyejian1, mhiramat, rostedt, zanussi; +Cc: stable


The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

Possible dependencies:

ff4837f7fe59 ("tracing: Fix issue of missing one synthetic field")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From ff4837f7fe59ff018eca4705a70eca5e0b486b97 Mon Sep 17 00:00:00 2001
From: Zheng Yejian <zhengyejian1@huawei.com>
Date: Wed, 7 Dec 2022 17:15:57 +0800
Subject: [PATCH] tracing: Fix issue of missing one synthetic field

The maximum number of synthetic fields supported is defined as
SYNTH_FIELDS_MAX which value currently is 64, but it actually fails
when try to generate a synthetic event with 64 fields by executing like:

  # echo "my_synth_event int v1; int v2; int v3; int v4; int v5; int v6;\
   int v7; int v8; int v9; int v10; int v11; int v12; int v13; int v14;\
   int v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22;\
   int v23; int v24; int v25; int v26; int v27; int v28; int v29; int v30;\
   int v31; int v32; int v33; int v34; int v35; int v36; int v37; int v38;\
   int v39; int v40; int v41; int v42; int v43; int v44; int v45; int v46;\
   int v47; int v48; int v49; int v50; int v51; int v52; int v53; int v54;\
   int v55; int v56; int v57; int v58; int v59; int v60; int v61; int v62;\
   int v63; int v64" >> /sys/kernel/tracing/synthetic_events

Correct the field counting to fix it.

Link: https://lore.kernel.org/linux-trace-kernel/20221207091557.3137904-1-zhengyejian1@huawei.com

Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: stable@vger.kernel.org
Fixes: c9e759b1e845 ("tracing: Rework synthetic event command parsing")
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index c3b582d19b62..67592eed0be8 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -1282,12 +1282,12 @@ static int __create_synth_event(const char *name, const char *raw_fields)
 				goto err_free_arg;
 			}
 
-			fields[n_fields++] = field;
 			if (n_fields == SYNTH_FIELDS_MAX) {
 				synth_err(SYNTH_ERR_TOO_MANY_FIELDS, 0);
 				ret = -EINVAL;
 				goto err_free_arg;
 			}
+			fields[n_fields++] = field;
 
 			n_fields_this_loop++;
 		}


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

* [PATCH 5.15] tracing: Fix issue of missing one synthetic field
  2023-01-04 14:10 FAILED: patch "[PATCH] tracing: Fix issue of missing one synthetic field" failed to apply to 5.15-stable tree gregkh
@ 2023-01-05  3:54 ` Zheng Yejian
  2023-01-05 11:50   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Zheng Yejian @ 2023-01-05  3:54 UTC (permalink / raw)
  To: gregkh; +Cc: mhiramat, rostedt, stable, zanussi, zhengyejian1

[ Upstream commit ff4837f7fe59ff018eca4705a70eca5e0b486b97 ]

The maximum number of synthetic fields supported is defined as
SYNTH_FIELDS_MAX which value currently is 64, but it actually fails
when try to generate a synthetic event with 64 fields by executing like:

  # echo "my_synth_event int v1; int v2; int v3; int v4; int v5; int v6;\
   int v7; int v8; int v9; int v10; int v11; int v12; int v13; int v14;\
   int v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22;\
   int v23; int v24; int v25; int v26; int v27; int v28; int v29; int v30;\
   int v31; int v32; int v33; int v34; int v35; int v36; int v37; int v38;\
   int v39; int v40; int v41; int v42; int v43; int v44; int v45; int v46;\
   int v47; int v48; int v49; int v50; int v51; int v52; int v53; int v54;\
   int v55; int v56; int v57; int v58; int v59; int v60; int v61; int v62;\
   int v63; int v64" >> /sys/kernel/tracing/synthetic_events

Correct the field counting to fix it.

Link: https://lore.kernel.org/linux-trace-kernel/20221207091557.3137904-1-zhengyejian1@huawei.com

Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: stable@vger.kernel.org
Fixes: c9e759b1e845 ("tracing: Rework synthetic event command parsing")
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
[Fix conflict due to lack of c24be24aed405d64ebcf04526614c13b2adfb1d2]
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
---
 kernel/trace/trace_events_synth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index 47eb92b3edd0..2fdf3fd591e1 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -1275,12 +1275,12 @@ static int __create_synth_event(const char *name, const char *raw_fields)
 				goto err;
 			}
 
-			fields[n_fields++] = field;
 			if (n_fields == SYNTH_FIELDS_MAX) {
 				synth_err(SYNTH_ERR_TOO_MANY_FIELDS, 0);
 				ret = -EINVAL;
 				goto err;
 			}
+			fields[n_fields++] = field;
 
 			n_fields_this_loop++;
 		}
-- 
2.25.1


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

* Re: [PATCH 5.15] tracing: Fix issue of missing one synthetic field
  2023-01-05  3:54 ` [PATCH 5.15] tracing: Fix issue of missing one synthetic field Zheng Yejian
@ 2023-01-05 11:50   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2023-01-05 11:50 UTC (permalink / raw)
  To: Zheng Yejian; +Cc: mhiramat, rostedt, stable, zanussi

On Thu, Jan 05, 2023 at 11:54:52AM +0800, Zheng Yejian wrote:
> [ Upstream commit ff4837f7fe59ff018eca4705a70eca5e0b486b97 ]
> 
> The maximum number of synthetic fields supported is defined as
> SYNTH_FIELDS_MAX which value currently is 64, but it actually fails
> when try to generate a synthetic event with 64 fields by executing like:
> 
>   # echo "my_synth_event int v1; int v2; int v3; int v4; int v5; int v6;\
>    int v7; int v8; int v9; int v10; int v11; int v12; int v13; int v14;\
>    int v15; int v16; int v17; int v18; int v19; int v20; int v21; int v22;\
>    int v23; int v24; int v25; int v26; int v27; int v28; int v29; int v30;\
>    int v31; int v32; int v33; int v34; int v35; int v36; int v37; int v38;\
>    int v39; int v40; int v41; int v42; int v43; int v44; int v45; int v46;\
>    int v47; int v48; int v49; int v50; int v51; int v52; int v53; int v54;\
>    int v55; int v56; int v57; int v58; int v59; int v60; int v61; int v62;\
>    int v63; int v64" >> /sys/kernel/tracing/synthetic_events
> 
> Correct the field counting to fix it.
> 
> Link: https://lore.kernel.org/linux-trace-kernel/20221207091557.3137904-1-zhengyejian1@huawei.com
> 
> Cc: <mhiramat@kernel.org>
> Cc: <zanussi@kernel.org>
> Cc: stable@vger.kernel.org
> Fixes: c9e759b1e845 ("tracing: Rework synthetic event command parsing")
> Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> [Fix conflict due to lack of c24be24aed405d64ebcf04526614c13b2adfb1d2]
> Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
> ---
>  kernel/trace/trace_events_synth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Now queued up, thanks.

greg k-h

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

end of thread, other threads:[~2023-01-05 11:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 14:10 FAILED: patch "[PATCH] tracing: Fix issue of missing one synthetic field" failed to apply to 5.15-stable tree gregkh
2023-01-05  3:54 ` [PATCH 5.15] tracing: Fix issue of missing one synthetic field Zheng Yejian
2023-01-05 11:50   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.