summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-lock.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2022-01-27 03:00:48 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-02-10 21:40:56 +0300
commitba8a56c7e6e7b343a360a54c0f0005d7ebf63f75 (patch)
tree0b8e8ef3395afba38650915eb3e19b74fd8c7ec7 /tools/perf/builtin-lock.c
parentf4cf2d75acac66e172d43dd4c13e411cc5494fb8 (diff)
downloadlinux-ba8a56c7e6e7b343a360a54c0f0005d7ebf63f75.tar.xz
perf lock: Fix lock name length check for printing
It has 20 character spaces for name so lock names shorter than 20 should be printed without ellipsis. Before: # perf lock report Name acquired contended avg wait (ns) total wait (ns) max wait (ns) min wait (ns) rcu_read_lock 251225 0 0 0 0 0 &(ei->i_block_re... 8731 0 0 0 0 0 &sb->s_type->i_l... 8731 0 0 0 0 0 hrtimer_bases.lo... 5261 0 0 0 0 0 hrtimer_bases.lo... 2626 0 0 0 0 0 hrtimer_bases.lo... 1953 0 0 0 0 0 hrtimer_bases.lo... 1382 0 0 0 0 0 cpu_hotplug_lock... 1350 0 0 0 0 0 After: # perf lock report Name acquired contended avg wait (ns) total wait (ns) max wait (ns) min wait (ns) rcu_read_lock 251225 0 0 0 0 0 &(ei->i_block_re... 8731 0 0 0 0 0 &sb->s_type->i_l... 8731 0 0 0 0 0 hrtimer_bases.lock 5261 0 0 0 0 0 hrtimer_bases.lock 2626 0 0 0 0 0 hrtimer_bases.lock 1953 0 0 0 0 0 hrtimer_bases.lock 1382 0 0 0 0 0 cpu_hotplug_lock 1350 0 0 0 0 0 Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20220127000050.3011493-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-lock.c')
-rw-r--r--tools/perf/builtin-lock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 8078f7ca826d..f6adf3cdd1e2 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -710,7 +710,7 @@ static void print_result(void)
}
bzero(cut_name, 20);
- if (strlen(st->name) < 16) {
+ if (strlen(st->name) < 20) {
/* output raw name */
pr_info("%20s ", st->name);
} else {