Skip to content

Commit 450fec1

Browse files
committed
tracing/histograms: String compares should not care about signed values
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]>
1 parent d58071a commit 450fec1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3757,7 +3757,7 @@ static int check_synth_field(struct synth_event *event,
37573757

37583758
if (strcmp(field->type, hist_field->type) != 0) {
37593759
if (field->size != hist_field->size ||
3760-
field->is_signed != hist_field->is_signed)
3760+
(!field->is_string && field->is_signed != hist_field->is_signed))
37613761
return -EINVAL;
37623762
}
37633763

0 commit comments

Comments
 (0)