[RESEND PATCH v2] tracing: Improve performance by using do_div()

2024-03-29 Thread Thorsten Blum
h is already used twice in trace_do_benchmark() when calculating the standard deviation: do_div(stddev, (u32)bm_cnt); do_div(stddev, (u32)bm_cnt - 1); Signed-off-by: Thorsten Blum --- Changes in v2: - Update patch with latest changes from master - Update patch title and description --- kernel/

[PATCH v2] tracing: Improve performance by using do_div()

2024-03-20 Thread Thorsten Blum
h is already used twice in trace_do_benchmark() when calculating the standard deviation: do_div(stddev, (u32)bm_cnt); do_div(stddev, (u32)bm_cnt - 1); Signed-off-by: Thorsten Blum --- Changes in v2: - Update patch with latest changes from master - Update patch title and description --- kernel/

Re: [PATCH] tracing: Explicitly cast divisor to fix Coccinelle warning

2024-03-20 Thread Thorsten Blum
On 20. Mar 2024, at 16:01, Thorsten Blum wrote: > > Coccinelle also finds this one, but please ignore this patch as I just > realized > this was already fixed in another patch of mine from February. > > Sorry for the inconvenience. > > Link: > https://l

Re: [PATCH] tracing: Explicitly cast divisor to fix Coccinelle warning

2024-03-20 Thread Thorsten Blum
On 20. Mar 2024, at 11:27, Masami Hiramatsu (Google) wrote: > > Hmm, strange, trace_do_benchmark() has another do_div(u64, u64). > >do { >last_seed = seed; >seed = stddev; >if (!last_seed) >

[PATCH] tracing: Explicitly cast divisor to fix Coccinelle warning

2024-03-18 Thread Thorsten Blum
Explicitly cast the divisor to u32 to fix a Coccinelle/coccicheck warning reported by do_div.cocci. Signed-off-by: Thorsten Blum --- kernel/trace/trace_benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c

[PATCH] tracing: Use div64_u64() instead of do_div()

2024-02-25 Thread Thorsten Blum
Fixes Coccinelle/coccicheck warnings reported by do_div.cocci. Compared to do_div(), div64_u64() does not implicitly cast the divisor and does not unnecessarily calculate the remainder. Signed-off-by: Thorsten Blum --- kernel/trace/trace_benchmark.c | 5 ++--- 1 file changed, 2 insertions

[PATCH] synthetic tracing: Fix trace_string() return value

2024-02-14 Thread Thorsten Blum
Fix trace_string() by assigning the string length to the return variable which got lost in commit ddeea494a16f ("tracing/synthetic: Use union instead of casts") and caused trace_string() to always return 0. Signed-off-by: Thorsten Blum --- kernel/trace/trace_events_synth.c | 3 +