]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf ftrace latency: variable histogram buckets
authorGabriele Monaco <gmonaco@redhat.com>
Fri, 7 Feb 2025 08:04:44 +0000 (09:04 +0100)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 26 Feb 2025 21:48:02 +0000 (13:48 -0800)
commit4a75e8c3b225e668d8e122ec66fd2c0fe9b53b76
tree4b119170934e861418ebdb5ea28fc30b372db27f
parentf4dc5a3355a84f53ff3287d496728c7b77160069
perf ftrace latency: variable histogram buckets

The max-latency value can make the histogram smaller, but not larger, we
have a maximum of 22 buckets and specifying a max-latency that would
require more buckets has no effect.

Dynamically allocate the buckets and compute the bucket number from the
max latency as (max-min) / range + 2

If the maximum is not specified, we still set the bucket number to 22
and compute the maximum accordingly.

Fail if the maximum is smaller than min+range, this way we make sure we
always have 3 buckets: those below min, those above max and one in the
middle.

Since max-latency is not available in log2 mode, always use 22 buckets.

Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/r/20250207080446.77630-1-gmonaco@redhat.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-ftrace.c
tools/perf/util/bpf_ftrace.c
tools/perf/util/bpf_skel/func_latency.bpf.c
tools/perf/util/ftrace.h