perf annotate browser: Align jump labels
Find out at browser startup the max width and use it when rendering jump labels on the screen. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-7dxjiwqb77wz6f5lc05e0i0x@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
b793a40185
commit
61e04b332e
3 changed files with 25 additions and 4 deletions
|
@ -148,3 +148,13 @@ int readn(int fd, void *buf, size_t n)
|
|||
|
||||
return buf - buf_start;
|
||||
}
|
||||
|
||||
size_t hex_width(u64 v)
|
||||
{
|
||||
size_t n = 1;
|
||||
|
||||
while ((v >>= 4))
|
||||
++n;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue