linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] tools/nolibc: Support vprintf() so we can use kselftest.h with nolibc
@ 2023-04-06 16:19 Mark Brown
  2023-04-06 16:19 ` [PATCH v2 1/3] tools/nolibc/stdio: Implement vprintf() Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Mark Brown @ 2023-04-06 16:19 UTC (permalink / raw)
  To: Shuah Khan, Catalin Marinas, Will Deacon, Paul E. McKenney,
	Willy Tarreau
  Cc: linux-arm-kernel, linux-kselftest, linux-kernel, Mark Brown

At present the kselftest header can't be used with nolibc since it makes
use of vprintf() which is not available in nolibc.  Fortunately nolibc
has a vfprintf() so we can just wrap that in order to allow kselftests
to be built with nolibc and still use the standard kselftest headers
with a small change to prevent the inclusion of the standard libc
headers.  This allows us to avoid open coding of KTAP output for
selftests that need to use nolibc in order to test interfaces that are
controlled by libc, we've got several open coded examples of this in the
tree already.

As an example of using this the existing za-fork test is converted to
use kselftest.h.  The changes to kselftest and nolibc don't have any
interaction until they are used by a test so could be merged separately
if desired.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v2:
- Turns out nolibc has a vfprintf() already which we can use so do that.
- Link to v1: https://lore.kernel.org/r/20230405-kselftest-nolibc-v1-0-63fbcd70b202@kernel.org

---
Mark Brown (3):
      tools/nolibc/stdio: Implement vprintf()
      kselftest: Support nolibc
      kselftest/arm64: Convert za-fork to use kselftest.h

 tools/include/nolibc/stdio.h               |  6 ++
 tools/testing/selftests/arm64/fp/Makefile  |  2 +-
 tools/testing/selftests/arm64/fp/za-fork.c | 88 ++++++------------------------
 tools/testing/selftests/kselftest.h        |  2 +
 4 files changed, 25 insertions(+), 73 deletions(-)
---
base-commit: e8d018dd0257f744ca50a729e3d042cf2ec9da65
change-id: 20230405-kselftest-nolibc-cb2ce0446d09

Best regards,
-- 
Mark Brown <broonie@kernel.org>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-04-11 21:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-06 16:19 [PATCH v2 0/3] tools/nolibc: Support vprintf() so we can use kselftest.h with nolibc Mark Brown
2023-04-06 16:19 ` [PATCH v2 1/3] tools/nolibc/stdio: Implement vprintf() Mark Brown
2023-04-06 18:26   ` Willy Tarreau
2023-04-06 18:43     ` Paul E. McKenney
2023-04-10 18:30       ` Shuah Khan
2023-04-11 14:31         ` Mark Brown
2023-04-11 15:03           ` Will Deacon
2023-04-11 15:13             ` Mark Brown
2023-04-11 16:44               ` Paul E. McKenney
2023-04-11 18:54                 ` Shuah Khan
2023-04-11 21:06                   ` Will Deacon
2023-04-06 16:19 ` [PATCH v2 2/3] kselftest: Support nolibc Mark Brown
2023-04-06 16:19 ` [PATCH v2 3/3] kselftest/arm64: Convert za-fork to use kselftest.h Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).