aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/generate_rust_analyzer.py
diff options
context:
space:
mode:
authorThorsten Blum <[email protected]>2024-03-29 16:02:30 +0000
committerSteven Rostedt (Google) <[email protected]>2024-05-14 00:00:57 +0000
commit347bd7f072ea8c36e4becf32c76ee7e96bc7b1c3 (patch)
tree84fb622b88e32d459772dc5ee58cc64a694a7cd8 /scripts/generate_rust_analyzer.py
parentftrace: Use asynchronous grace period for register_ftrace_direct() (diff)
downloadkernel-347bd7f072ea8c36e4becf32c76ee7e96bc7b1c3.tar.gz
kernel-347bd7f072ea8c36e4becf32c76ee7e96bc7b1c3.zip
tracing: Improve benchmark test performance by using do_div()
Partially revert commit d6cb38e10810 ("tracing: Use div64_u64() instead of do_div()") and use do_div() again to utilize its faster 64-by-32 division compared to the 64-by-64 division done by div64_u64(). Explicitly cast the divisor bm_cnt to u32 to prevent a Coccinelle warning reported by do_div.cocci. The warning was removed with commit d6cb38e10810 ("tracing: Use div64_u64() instead of do_div()"). Using the faster 64-by-32 division and casting bm_cnt to u32 is safe because we return early from trace_do_benchmark() if bm_cnt > UINT_MAX. This approach 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); Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions