]> git.baikalelectronics.ru Git - kernel.git/commit
perf top: Auto adjust symbol and dso widths
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 17 Nov 2009 17:40:54 +0000 (15:40 -0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 19 Nov 2009 05:03:36 +0000 (06:03 +0100)
commit63e047162185945e97ef038463b21b09e9e8bf10
tree46e38168af043489b657b9d2715b4dab0aad1428
parent963cd065db5b6ca324633d49b1410eadf839cb40
perf top: Auto adjust symbol and dso widths

We pre-calculate the symbol name length, then after we sort the
entries to print, calculate the biggest one and use that for the
symbol name width justification, then use the
dso->long_name->len to justificate the DSO name, deciding whether
using the short or long name depending on how much space we have
on the terminal.

IOW give as much info to the user as the terminal width allows.

Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1258479655-28662-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-top.c