Skip to content

Commit ff4837f

Browse files
Zheng Yejianrostedt
authored andcommitted
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/[email protected] Cc: <[email protected]> Cc: <[email protected]> Cc: [email protected] Fixes: c9e759b ("tracing: Rework synthetic event command parsing") Signed-off-by: Zheng Yejian <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 82470f7 commit ff4837f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_events_synth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,12 +1282,12 @@ static int __create_synth_event(const char *name, const char *raw_fields)
12821282
goto err_free_arg;
12831283
}
12841284

1285-
fields[n_fields++] = field;
12861285
if (n_fields == SYNTH_FIELDS_MAX) {
12871286
synth_err(SYNTH_ERR_TOO_MANY_FIELDS, 0);
12881287
ret = -EINVAL;
12891288
goto err_free_arg;
12901289
}
1290+
fields[n_fields++] = field;
12911291

12921292
n_fields_this_loop++;
12931293
}

0 commit comments

Comments
 (0)