Reduce bss usage and speed up string printing
authorDenys Vlasenko <dvlasenk@redhat.com>
Thu, 19 Jan 2012 16:20:23 +0000 (17:20 +0100)
committerDenys Vlasenko <dvlasenk@redhat.com>
Thu, 19 Jan 2012 16:20:23 +0000 (17:20 +0100)
commitb3c52cf02ae536634898cd12afa5f3fcad17fbf2
tree9958f1d81164f84aee6705f11c3a14199f63b053
parent7d55801ae92a83c8f3efa8c97fdeb42f036bbbb2
Reduce bss usage and speed up string printing

   text    data     bss     dec     hex filename
 237913     660   49284  287857   46471 strace.before
 237973     660   28772  267405   4148d strace

This reduces L1 D-cache pressure a bit: instead of dirtying
20k of bss, we will reuse already dirty stack area.

* util.c (printpathn): Use on-stack buffers instead of static ones.
Saves 5*MAXPATHLEN in bss.
(printstr): Use tprints() instead of tprintf("%s") when printing
formatted string. May be a bit faster, depending on libc.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
util.c