diff mbox series

[2/3] perf ftrace: Remove an unnecessary condition check in BPF

Message ID 20250227191223.1288473-2-namhyung@kernel.org (mailing list archive)
State Not Applicable
Headers show
Series [1/3] perf ftrace: Fix latency stats with BPF | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Namhyung Kim Feb. 27, 2025, 7:12 p.m. UTC
The bucket_num is set based on the {max,min}_latency already in
cmd_ftrace(), so no need to check it again in BPF.  Also I found
that it didn't pass the max_latency to BPF. :)

No functional changes intended.

Cc: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/bpf_skel/func_latency.bpf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/perf/util/bpf_skel/func_latency.bpf.c b/tools/perf/util/bpf_skel/func_latency.bpf.c
index 3d3d9f427c20876e..ad70547446786c54 100644
--- a/tools/perf/util/bpf_skel/func_latency.bpf.c
+++ b/tools/perf/util/bpf_skel/func_latency.bpf.c
@@ -125,8 +125,7 @@  int BPF_PROG(func_end)
 			// than the min latency desired.
 			if (val > 0) { // 1st entry: [ 1 unit .. bucket_range units )
 				key = val / bucket_range + 1;
-				if (key >= bucket_num ||
-					val >= max_latency - min_latency)
+				if (key >= bucket_num)
 					key = bucket_num - 1;
 			}