Skip to content

Commit

Permalink
tracing/histograms: String compares should not care about signed values
Browse files Browse the repository at this point in the history
When comparing two strings for the "onmatch" histogram trigger, fields
that are strings use string comparisons, which do not care about being
signed or not.

Do not fail to match two string fields if one is unsigned char array and
the other is a signed char array.

Link: https://lore.kernel.org/all/[email protected]/

Cc: [email protected]
Cc: Tom Zanussi <[email protected]>
Cc: Yafang Shao <[email protected]>
Fixes: b05e89a ("tracing: Accept different type for synthetic event fields")
Reviewed-by: Masami Hiramatsu <[email protected]>
Reported-by: Sven Schnelle <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
rostedt committed Dec 2, 2021
1 parent d58071a commit 450fec1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_events_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -3757,7 +3757,7 @@ static int check_synth_field(struct synth_event *event,

if (strcmp(field->type, hist_field->type) != 0) {
if (field->size != hist_field->size ||
field->is_signed != hist_field->is_signed)
(!field->is_string && field->is_signed != hist_field->is_signed))
return -EINVAL;
}

Expand Down

0 comments on commit 450fec1

Please sign in to comment.