public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next 00/12] tools/nolibc: Enhance printf()
@ 2026-02-03 10:29 david.laight.linux
  2026-02-03 10:29 ` [PATCH next 01/12] tools/nolibc/printf: Move length check to snprintf callback david.laight.linux
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: david.laight.linux @ 2026-02-03 10:29 UTC (permalink / raw)
  To: Willy Tarreau, Thomas Weißschuh, linux-kernel, Cheng Li; +Cc: David Laight

From: David Laight <david.laight.linux@gmail.com>

Update printf() so that it handles almost all the non-fp formats.
In particular:
- Left alignment.
- Zero padding.
- Field precision.
- Variable field width and precision.
- Width modifiers q, L, t and z.
- Conversion specifiers i and X (X generates lower case).
About the only thing that is missing is octal.

The tests are updated to match.

There is a slight increase in code size, but it is minimalised
by the the heavy use of bit-pattern matches.

vfprintf() is modified to buffer data for each call and do a single
write system call at the end.
This improves performance somewhat, but is actually most useful when
using strace.

David Laight (12):
  tools/nolibc/printf: Move snprintf length check to callback
  tools/nolibc/printf: Add buffering to vfprintf() callback.
  tools/nolibc: change printf() to output pad in 16 byte chunks
  selftests/nolibc: Improve reporting of vfprintf() errors
  tools/nolibc/stdio: Simplify __nolibc_printf()
  tools/nolibc: Add support for left alignment and %[tzq]d" to printf
  tools/nolibc: printf() prepend the sign after a numeric conversion
  tools/nolibc: use bit-match to detect valid printf conversion
    character
  tools/nolibc: add precision and zero padding to printf()
  tools/nolibc: Use bit-pattern for printf integral formats
  selftests/nolibc: Increase coverage of printf format tests
  selftests/nolibc: Use printf("%.*s", n, "") to align output

 tools/include/nolibc/stdio.h                 | 396 +++++++++++++------
 tools/testing/selftests/nolibc/nolibc-test.c |  96 +++--
 2 files changed, 336 insertions(+), 156 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-02-04 15:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 10:29 [PATCH next 00/12] tools/nolibc: Enhance printf() david.laight.linux
2026-02-03 10:29 ` [PATCH next 01/12] tools/nolibc/printf: Move length check to snprintf callback david.laight.linux
2026-02-03 10:29 ` [PATCH next 02/12] tools/nolibc/printf: Add buffering to vfprintf() callback david.laight.linux
2026-02-03 10:29 ` [PATCH next 03/12] tools/nolibc/printf: output pad spaces in 16 byte chunks david.laight.linux
2026-02-03 10:29 ` [PATCH next 04/12] selftests/nolibc: Improve reporting of vfprintf() errors david.laight.linux
2026-02-03 10:29 ` [PATCH next 05/12] tools/nolibc/printf: Simplify __nolibc_printf() david.laight.linux
2026-02-03 10:29 ` [PATCH next 06/12] tools/nolibc/printf: Add support for left alignment and %[tzLq]d" david.laight.linux
2026-02-04  4:14   ` Willy Tarreau
2026-02-04 10:17     ` David Laight
2026-02-04 10:40       ` Willy Tarreau
2026-02-04 15:39         ` David Laight
2026-02-03 10:29 ` [PATCH next 07/12] tools/nolibc/printf: Prepend the sign after a numeric conversion david.laight.linux
2026-02-03 10:29 ` [PATCH next 08/12] tools/nolibc/printf: use bit-match to detect valid conversion characters david.laight.linux
2026-02-03 10:29 ` [PATCH next 09/12] tools/nolibc/printf: support precision and zero padding david.laight.linux
2026-02-03 10:29 ` [PATCH next 10/12] tools/nolibc/printf: Use bit-pattern for integral formats david.laight.linux
2026-02-03 10:29 ` [PATCH 11/12] selftests/nolibc: Increase coverage of printf format tests david.laight.linux
2026-02-03 18:22   ` kernel test robot
2026-02-03 22:05     ` David Laight
2026-02-03 23:23   ` kernel test robot
2026-02-03 10:30 ` [PATCH 12/12] selftests/nolibc: Use printf("%.*s", n, "") to align output david.laight.linux
2026-02-03 17:39 ` [PATCH next 00/12] tools/nolibc: Enhance printf() David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox