Skip to content

Commit 9b63263

Browse files
tobluxrostedt
authored andcommitted
tracing/synthetic: Fix trace_string() return value
Fix trace_string() by assigning the string length to the return variable which got lost in commit ddeea49 ("tracing/synthetic: Use union instead of casts") and caused trace_string() to always return 0. Link: https://lore.kernel.org/linux-trace-kernel/20240214220555.711598-1-thorsten.blum@toblux.com Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Fixes: ddeea49 ("tracing/synthetic: Use union instead of casts") Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 2394ac4 commit 9b63263

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/trace_events_synth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ static unsigned int trace_string(struct synth_trace_event *entry,
441441
if (is_dynamic) {
442442
union trace_synth_field *data = &entry->fields[*n_u64];
443443

444+
len = fetch_store_strlen((unsigned long)str_val);
444445
data->as_dynamic.offset = struct_size(entry, fields, event->n_u64) + data_size;
445-
data->as_dynamic.len = fetch_store_strlen((unsigned long)str_val);
446+
data->as_dynamic.len = len;
446447

447448
ret = fetch_store_string((unsigned long)str_val, &entry->fields[*n_u64], entry);
448449

0 commit comments

Comments
 (0)