Skip to content

Commit 510f024

Browse files
namhyungacmel
authored andcommitted
perf ftrace: Fix display for range of the first bucket
When min_latency is not given, it prints 0 - 0. It should be 0 - 1. Before: $ sudo ./perf ftrace latency -a -T do_futex sleep 1 # DURATION | COUNT | GRAPH | 0 - 0 us | 321 | ########### | ... After: $ sudo ./perf ftrace latency -a -T do_futex sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 699 | ############ | ... Fixes: 08b875b ("perf ftrace latency: Introduce --min-latency to narrow down into a latency range") Reviewed-by: Gabriele Monaco <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Tested-by: Gabriele Monaco <[email protected] Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent dd01b98 commit 510f024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/builtin-ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ static void display_histogram(struct perf_ftrace *ftrace, int buckets[])
840840
bar_len = buckets[0] * bar_total / total;
841841

842842
printf(" %4d - %4d %s | %10d | %.*s%*s |\n",
843-
0, min_latency, use_nsec ? "ns" : "us",
843+
0, min_latency ?: 1, use_nsec ? "ns" : "us",
844844
buckets[0], bar_len, bar, bar_total - bar_len, "");
845845

846846
for (i = 1; i < NUM_BUCKET - 1; i++) {

0 commit comments

Comments
 (0)