tracing/histograms: String compares should not care about signed values
Steven Rostedt
maintainerPATCH 1/1 tracing/histograms: String compares should not care about signed values
From 95f7262b44dc54fed8007cc3db8b39cbd16999c6 Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (VMware)" <[email protected]>
Date: Tue, 30 Nov 2021 12:31:23 -0500
Subject: [PATCH] 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.
--- kernel/trace/trace_events_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_events_hist.c +1 -1
@@ -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 ; }
Signature · 1 line
2.31.1
Masami Hiramatsu
maintainerQuoted 6 lines · On Tue, 30 Nov 2021 12:37:36 -0500 Steven Rostedt <[email protected]> wrote:
From
95f7262b44dc54fed8007cc3db8b39cbd16999c6Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (VMware)" <[email protected]>
Date: Tue, 30 Nov 2021 12:31:23 -0500
Subject: [PATCH] tracing/histograms: String compares should not care about
signed values
Quoted 8 lines
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.
Looks good to me.
Thank you,
Quoted 28 lines
Cc Tom Zanussi <[email protected]>Cc Masami Hiramatsu <[email protected]>Cc Yafang Shao <[email protected]>Fixes b05e89ae7cf3b ("tracing: Accept different type for synthetic event fields")Reported-by Sven Schnelle <[email protected]>Signed-off-by Steven Rostedt (VMware) <[email protected]>--- kernel/trace/trace_events_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/trace_events_hist.c +1
-1@@ -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 ; }Signature · 1 line
2.31.1
Signature · 1 line
Masami Hiramatsu <[email protected]>
Steven Rostedt
maintainerQuoted 13 lines · On Wed, 1 Dec 2021 11:21:00 +0900 Masami Hiramatsu <[email protected]> wrote:
Quoted 10 lines · On Tue, 30 Nov 2021 12:37:36 -0500 Steven Rostedt <[email protected]> wrote:
From
95f7262b44dc54fed8007cc3db8b39cbd16999c6Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (VMware)" <[email protected]>
Date: Tue, 30 Nov 2021 12:31:23 -0500
Subject: [PATCH] tracing/histograms: String compares should not care about
signed valuesWhen comparing two strings for the "onmatch" histogram trigger, fields that are strings use string comparisons, which do not care about being signed or not.
Quoted 10 lines
Quoted 4 lines
Do not fail to match two string fields if one is unsigned char array and the other is a signed char array.
Looks good to me.
Review-by Masami Hiramatsu <[email protected]>
Thanks Masami. I'll add your reviewed-by before posting to Linus.
-- Steve