Skip to contentSkip to conversation

printf: add tests for generic FourCCs

PATCH In review Aditya Garg 5 participants 10 messages Mar 14, 2025 – Mar 27, 2025 Vsprintf

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 printf: add tests for generic FourCCs

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

---
 lib/tests/printf_kunit.c | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)
lib/tests/printf_kunit.c +32 -7
index 2c9f6170b..b1fa0dcea 100644
@@ -701,21 +701,46 @@ static void fwnode_pointer(struct kunit *kunittest)
 	software_node_unregister_node_group(group);
 }
 
+struct fourcc_struct {
+	u32 code;
+	const char *str;
+};
+
+static void fourcc_pointer_test(struct kunit *kunittest, const struct fourcc_struct *fc,
+				size_t n, const char *fmt)
+{
+	size_t i;
+
+	for (i = 0; i < n; i++)
+		test(fc[i].str, fmt, &fc[i].code);
+}
+
 static void fourcc_pointer(struct kunit *kunittest)
 {
-	struct {
-		u32 code;
-		char *str;
-	} const try[] = {
+	static const struct fourcc_struct try_cc[] = {
 		{ 0x3231564e, "NV12 little-endian (0x3231564e)", },
 		{ 0xb231564e, "NV12 big-endian (0xb231564e)", },
 		{ 0x10111213, ".... little-endian (0x10111213)", },
 		{ 0x20303159, "Y10  little-endian (0x20303159)", },
 	};
-	unsigned int i;
+	static const struct fourcc_struct try_ch[] = {
+		{ 0x41424344, "ABCD (0x41424344)", },
+	};
+	static const struct fourcc_struct try_cn[] = {
+		{ 0x41424344, "DCBA (0x44434241)", },
+	};
+	static const struct fourcc_struct try_cl[] = {
+		{ (__force u32)cpu_to_le32(0x41424344), "ABCD (0x41424344)", },
+	};
+	static const struct fourcc_struct try_cb[] = {
+		{ (__force u32)cpu_to_be32(0x41424344), "ABCD (0x41424344)", },
+	};
 
-	for (i = 0; i < ARRAY_SIZE(try); i++)
-		test(try[i].str, "%p4cc", &try[i].code);
+	fourcc_pointer_test(kunittest, try_cc, ARRAY_SIZE(try_cc), "%p4cc");
+	fourcc_pointer_test(kunittest, try_ch, ARRAY_SIZE(try_ch), "%p4ch");
+	fourcc_pointer_test(kunittest, try_cn, ARRAY_SIZE(try_cn), "%p4cn");
+	fourcc_pointer_test(kunittest, try_cl, ARRAY_SIZE(try_cl), "%p4cl");
+	fourcc_pointer_test(kunittest, try_cb, ARRAY_SIZE(try_cb), "%p4cb");
 }
 
 static void
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Aditya Garg

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

I am always for the additional test cases!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to Aditya Garg
Quoted 74 lines · Aditya Garg

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

---
 lib/tests/printf_kunit.c | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)
lib/tests/printf_kunit.c +32 -8
index 2c9f6170b..b1fa0dcea 100644
@@ -701,21 +701,46 @@ static void fwnode_pointer(struct kunit *kunittest)
        software_node_unregister_node_group(group);
 }
 
+struct fourcc_struct {
+       u32 code;
+       const char *str;
+};
+
+static void fourcc_pointer_test(struct kunit *kunittest, const struct fourcc_struct *fc,
+                               size_t n, const char *fmt)
+{
+       size_t i;
+
+       for (i = 0; i < n; i++)
+               test(fc[i].str, fmt, &fc[i].code);
+}
+
 static void fourcc_pointer(struct kunit *kunittest)
 {
-       struct {
-               u32 code;
-               char *str;
-       } const try[] = {
+       static const struct fourcc_struct try_cc[] = {
                { 0x3231564e, "NV12 little-endian (0x3231564e)", },
                { 0xb231564e, "NV12 big-endian (0xb231564e)", },
                { 0x10111213, ".... little-endian (0x10111213)", },
                { 0x20303159, "Y10  little-endian (0x20303159)", },
        };
-       unsigned int i;
+       static const struct fourcc_struct try_ch[] = {
+               { 0x41424344, "ABCD (0x41424344)", },
+       };
+       static const struct fourcc_struct try_cn[] = {
+               { 0x41424344, "DCBA (0x44434241)", },
+       };
+       static const struct fourcc_struct try_cl[] = {
+               { (__force u32)cpu_to_le32(0x41424344), "ABCD (0x41424344)", },
+       };
+       static const struct fourcc_struct try_cb[] = {
+               { (__force u32)cpu_to_be32(0x41424344), "ABCD (0x41424344)", },
+       };
 
-       for (i = 0; i < ARRAY_SIZE(try); i++)
-               test(try[i].str, "%p4cc", &try[i].code);
+       fourcc_pointer_test(kunittest, try_cc, ARRAY_SIZE(try_cc), "%p4cc");
+       fourcc_pointer_test(kunittest, try_ch, ARRAY_SIZE(try_ch), "%p4ch");
+       fourcc_pointer_test(kunittest, try_cn, ARRAY_SIZE(try_cn), "%p4cn");
+       fourcc_pointer_test(kunittest, try_cl, ARRAY_SIZE(try_cl), "%p4cl");
+       fourcc_pointer_test(kunittest, try_cb, ARRAY_SIZE(try_cb), "%p4cb");
 }
 
 static void
--
Quoted 2 lines

2.43.0

This code looks fine to me. I would appreciate a preview of the output of these tests when they fail; a lot of effort went into making the printf tests produce actionable failure messages, and we should continue to invest in that IMO.

#3 lore raw
Quoted 77 lines · Tamir Duberstein
Quoted 72 lines · Aditya Garg

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

---
lib/tests/printf_kunit.c | 39 ++++++++++++++++++++++++++++++++-------

1 file changed, 32 insertions(+), 7 deletions(-)
lib/tests/printf_kunit.c +32 -7
index 2c9f6170b..b1fa0dcea 100644
@@ -701,21 +701,46 @@ static void fwnode_pointer(struct kunit *kunittest)
       software_node_unregister_node_group(group);
 }
 
+struct fourcc_struct {
+       u32 code;
+       const char *str;
+};
+
+static void fourcc_pointer_test(struct kunit *kunittest, const struct fourcc_struct *fc,
+                               size_t n, const char *fmt)
+{
+       size_t i;
+
+       for (i = 0; i < n; i++)
+               test(fc[i].str, fmt, &fc[i].code);
+}
+
 static void fourcc_pointer(struct kunit *kunittest)
 {
-       struct {
-               u32 code;
-               char *str;
-       } const try[] = {
+       static const struct fourcc_struct try_cc[] = {
               { 0x3231564e, "NV12 little-endian (0x3231564e)", },
               { 0xb231564e, "NV12 big-endian (0xb231564e)", },
               { 0x10111213, ".... little-endian (0x10111213)", },
               { 0x20303159, "Y10  little-endian (0x20303159)", },
       };
-       unsigned int i;
+       static const struct fourcc_struct try_ch[] = {
+               { 0x41424344, "ABCD (0x41424344)", },
+       };
+       static const struct fourcc_struct try_cn[] = {
+               { 0x41424344, "DCBA (0x44434241)", },
+       };
+       static const struct fourcc_struct try_cl[] = {
+               { (__force u32)cpu_to_le32(0x41424344), "ABCD (0x41424344)", },
+       };
+       static const struct fourcc_struct try_cb[] = {
+               { (__force u32)cpu_to_be32(0x41424344), "ABCD (0x41424344)", },
+       };
 
-       for (i = 0; i < ARRAY_SIZE(try); i++)
-               test(try[i].str, "%p4cc", &try[i].code);
+       fourcc_pointer_test(kunittest, try_cc, ARRAY_SIZE(try_cc), "%p4cc");
+       fourcc_pointer_test(kunittest, try_ch, ARRAY_SIZE(try_ch), "%p4ch");
+       fourcc_pointer_test(kunittest, try_cn, ARRAY_SIZE(try_cn), "%p4cn");
+       fourcc_pointer_test(kunittest, try_cl, ARRAY_SIZE(try_cl), "%p4cl");
+       fourcc_pointer_test(kunittest, try_cb, ARRAY_SIZE(try_cb), "%p4cb");
 }
 
Quoted 9 lines
Quoted 4 lines

static void
--
2.43.0

This code looks fine to me. I would appreciate a preview of the output of these tests when they fail; a lot of effort went into making the printf tests produce actionable failure messages, and we should continue to invest in that IMO.

Can you give me some docs for running the Kunit tests? The patch is basically a port of the original version.

#4 lore raw
Quoted 3 lines · Aditya Garg

Can you give me some docs for running the Kunit tests? The patch is basically a port of the original version.

I use:

tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 printf

You can probably just use:

tools/testing/kunit/kunit.py run printf

It would also be useful to see raw output:

tools/testing/kunit/kunit.py run printf --raw_output

#5 lore raw

Hi

Quoted 11 lines · Tamir Duberstein
Quoted 3 lines · Aditya Garg

Can you give me some docs for running the Kunit tests? The patch is basically a port of the original version.

I use:

tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 printf

Quoted 7 lines

You can probably just use:

tools/testing/kunit/kunit.py run printf

It would also be useful to see raw output:

tools/testing/kunit/kunit.py run printf —raw_output

Here are the requested outputs:

--------------------------------------------------------------------------------------------------------------------------------
Failed test:

aditya@MacBook:~/kees$ python3 tools/testing/kunit/kunit.py run printf
[15:21:43] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[15:22:19] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json ARCH=um O=.kunit --jobs=12
../lib/iomap.c:156:5: warning: no previous prototype for ‘ioread64_lo_hi’ [-Wmissing-prototypes]
  156 | u64 ioread64_lo_hi(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~
../lib/iomap.c:163:5: warning: no previous prototype for ‘ioread64_hi_lo’ [-Wmissing-prototypes]
  163 | u64 ioread64_hi_lo(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~
../lib/iomap.c:170:5: warning: no previous prototype for ‘ioread64be_lo_hi’ [-Wmissing-prototypes]
  170 | u64 ioread64be_lo_hi(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~~~
../lib/iomap.c:178:5: warning: no previous prototype for ‘ioread64be_hi_lo’ [-Wmissing-prototypes]
  178 | u64 ioread64be_hi_lo(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~~~
../lib/iomap.c:264:6: warning: no previous prototype for ‘iowrite64_lo_hi’ [-Wmissing-prototypes]
  264 | void iowrite64_lo_hi(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~
../lib/iomap.c:272:6: warning: no previous prototype for ‘iowrite64_hi_lo’ [-Wmissing-prototypes]
  272 | void iowrite64_hi_lo(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~
../lib/iomap.c:280:6: warning: no previous prototype for ‘iowrite64be_lo_hi’ [-Wmissing-prototypes]
  280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~~~
../lib/iomap.c:288:6: warning: no previous prototype for ‘iowrite64be_hi_lo’ [-Wmissing-prototypes]
  288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~~~

[15:23:28] Starting KUnit Kernel (1/1)...
[15:23:28] ============================================================ Running tests with:

$ .kunit/linux kunit.filter_glob=printf kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[15:23:28] =================== printf (28 subtests) ===================
[15:23:28] [PASSED] test_basic
[15:23:28] [PASSED] test_number
[15:23:28] [PASSED] test_string
[15:23:28] [PASSED] hash_pointer
[15:23:28] [PASSED] null_pointer
[15:23:28] [PASSED] error_pointer
[15:23:28] [PASSED] invalid_pointer
[15:23:28] [PASSED] symbol_ptr
[15:23:28] [PASSED] kernel_ptr
[15:23:28] [PASSED] struct_resource
[15:23:28] [PASSED] struct_range
[15:23:28] [PASSED] addr
[15:23:28] [PASSED] escaped_str
[15:23:28] [PASSED] hex_string
[15:23:28] [PASSED] mac
[15:23:28] [PASSED] ip4
[15:23:28] [PASSED] ip6
[15:23:28] [PASSED] uuid
[15:23:28] [PASSED] dentry
[15:23:28] [PASSED] struct_va_format
[15:23:28] [PASSED] time_and_date
[15:23:28] [PASSED] struct_clk
[15:23:28] [PASSED] bitmap
[15:23:28] [PASSED] netdev_features
[15:23:28] [PASSED] flags
[15:23:28] [PASSED] errptr
[15:23:28] [PASSED] fwnode_pointer
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4ch", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 3, "%p4ch", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4ch", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
[15:23:28] lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4ch", ...) returned '(%p4?)', expected 'ABCD (0x41424344)'
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4cn", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 5, "%p4cn", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4cn", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
[15:23:28] lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4cn", ...) returned '(%p4?)', expected 'DCBA (0x44434241)'
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4cl", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 11, "%p4cl", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4cl", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
[15:23:28] lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4cl", ...) returned '(%p4?)', expected 'ABCD (0x41424344)'
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4cb", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 16, "%p4cb", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
[15:23:28] lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4cb", ...) returned 6, expected 17
[15:23:28]     # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
[15:23:28] lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4cb", ...) returned '(%p4?)', expected 'ABCD (0x41424344)'
[15:23:28] [FAILED] fourcc_pointer
[15:23:28]     # module: printf_kunit
[15:23:28]     # printf: ran 464 tests
[15:23:28] # printf: pass:27 fail:1 skip:0 total:28
[15:23:28] # Totals: pass:27 fail:1 skip:0 total:28
[15:23:28] ===================== [FAILED] printf ======================
[15:23:28] ============================================================
[15:23:28] Testing complete. Ran 28 tests: passed: 27, failed: 1
[15:23:28] Elapsed time: 105.305s total, 36.071s configuring, 69.026s building, 0.110s running

----------------------------------------------------------------------------------------------------------------------------
Raw output

aditya@MacBook:~/kees$ tools/testing/kunit/kunit.py run printf --raw_output
[15:26:21] Configuring KUnit Kernel ...
[15:26:21] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json ARCH=um O=.kunit --jobs=12
[15:26:24] Starting KUnit Kernel (1/1)...
Running tests with:
$ .kunit/linux kunit.filter_glob=printf kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
KTAP version 1
1..1
    KTAP version 1
    # Subtest: printf
    # module: printf_kunit
    1..28
    ok 1 test_basic
    ok 2 test_number
    ok 3 test_string
    ok 4 hash_pointer
    ok 5 null_pointer
    ok 6 error_pointer
    ok 7 invalid_pointer
    ok 8 symbol_ptr
    ok 9 kernel_ptr
    ok 10 struct_resource
    ok 11 struct_range
    ok 12 addr
    ok 13 escaped_str
    ok 14 hex_string
    ok 15 mac
    ok 16 ip4
    ok 17 ip6
    ok 18 uuid
    ok 19 dentry
    ok 20 struct_va_format
    ok 21 time_and_date
    ok 22 struct_clk
    ok 23 bitmap
    ok 24 netdev_features
    ok 25 flags
    ok 26 errptr
    ok 27 fwnode_pointer
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4ch", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 14, "%p4ch", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4ch", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4ch", ...) returned '(%p4?)', expected 'ABCD (0x41424344)'
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4cn", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 11, "%p4cn", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4cn", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4cn", ...) returned '(%p4?)', expected 'DCBA (0x44434241)'
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4cl", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 3, "%p4cl", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4cl", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4cl", ...) returned '(%p4?)', expected 'ABCD (0x41424344)'
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 256, "%p4cb", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 9, "%p4cb", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:56
lib/tests/printf_kunit.c:715: vsnprintf(buf, 0, "%p4cb", ...) returned 6, expected 17
    # fourcc_pointer: EXPECTATION FAILED at lib/tests/printf_kunit.c:141
lib/tests/printf_kunit.c:715: kvasprintf(..., "%p4cb", ...) returned '(%p4?)', expected 'ABCD (0x41424344)'
    not ok 28 fourcc_pointer
    # printf: ran 464 tests
# printf: pass:27 fail:1 skip:0 total:28
# Totals: pass:27 fail:1 skip:0 total:28
not ok 1 printf
[15:26:24] Elapsed time: 2.649s total, 0.001s configuring, 2.583s building, 0.060s running
#6 lore raw
Quoted 23 lines · Aditya Garg

Hi

Quoted 11 lines · Tamir Duberstein
Quoted 3 lines · Aditya Garg

Can you give me some docs for running the Kunit tests? The patch is basically a port of the original version.

I use:

tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 printf

Quoted 7 lines

You can probably just use:

tools/testing/kunit/kunit.py run printf

It would also be useful to see raw output:

tools/testing/kunit/kunit.py run printf —raw_output

Quoted 6 lines

Here are the requested outputs:

--------------------------------------------------------------------------------------------------------------------------------
Failed test:

[...]

OK, it's not great but no worse than before.

#7 lore raw
In reply to Aditya Garg
Quoted 8 lines · Aditya Garg

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

Quoted 4 lines
---
 lib/tests/printf_kunit.c | 39 ++++++++++++++++++++++++++++++++-------

Linus has applied the kunit /lib move tree, so this patch can land via regular trees now. Who should take it?

Signature · 1 line
Kees Cook
#8 lore raw
Quoted 13 lines · Kees Cook
Quoted 8 lines · Aditya Garg

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

Quoted 7 lines
Quoted 4 lines

---
lib/tests/printf_kunit.c | 39 ++++++++++++++++++++++++++++++++-------

Linus has applied the kunit /lib move tree, so this patch can land via regular trees now. Who should take it?

For some reason DRM has not taken up the patch set yet, even after approvals. I assume it's partly because gitlab.freedesktop.org was down for a whole week. Now that merge window is open, I myself dunno what is gonna happen with those patches. Also, I doubt DRM wants to take this up later. So, I have 2 options:

1. Just wait a bit more, probably till merge window settles so that DRM can take up those patches and then you take this one up.
2. I'll just send you the non DRM patch, and upstream it via you so that atleast you can get free. Then. I'll tell DRM to just upstream the DRM relevant patch, again after merge windows settles. The patch is anyways a bug fix, rather than something new.

Choice is yours :)

Quoted 3 lines

--
Kees Cook

maintainer
#9 lore raw
Quoted 21 lines · Aditya Garg
Quoted 13 lines · Kees Cook
Quoted 8 lines · Aditya Garg

From: Aditya Garg <[email protected]>

Format specifiers for printing generic 32-bit FourCCs were recently added to vsprintf. They are going through the DRM tree alongwith the appletbdrm driver. Since the printf tests are being converted to kunit, this separate patch for the tests should make it easier to rebase when the merge window opens.

Quoted 7 lines
Quoted 4 lines

---
lib/tests/printf_kunit.c | 39 ++++++++++++++++++++++++++++++++-------

Linus has applied the kunit /lib move tree, so this patch can land via regular trees now. Who should take it?

Quoted 7 lines

For some reason DRM has not taken up the patch set yet, even after approvals. I assume it's partly because gitlab.freedesktop.org was down for a whole week. Now that merge window is open, I myself dunno what is gonna happen with those patches. Also, I doubt DRM wants to take this up later. So, I have 2 options:

1. Just wait a bit more, probably till merge window settles so that DRM can take up those patches and then you take this one up.
2. I'll just send you the non DRM patch, and upstream it via you so that atleast you can get free. Then. I'll tell DRM to just upstream the DRM relevant patch, again after merge windows settles. The patch is anyways a bug fix, rather than something new.

I prefer the first solution. I'll take this patch after the already queued patches reach the mainline.

Best Regards,
Petr