From patchwork Thu Mar 7 02:11:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 13584968 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98E4846AF for ; Thu, 7 Mar 2024 02:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709777507; cv=none; b=QH6Tx8Dfg4ImnMemmZhCCmVHn/RN/W+OxCdXkzYcK2YchTw72bGOg+BaOucQR/Zc86F9lvJR0x2CGZpHLd2pQnBjacmRPXiY6mvPp73qwlJBJY6cjiD65tjDgdMvEPG+vHX5qtnnx1wdrQgd+NhRzlWHc2rTPKUTW8NqVTfEe6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709777507; c=relaxed/simple; bh=0xzXFjWZ1m80S8gluLF6raYLj/LTINPRUXBQ9my8S2I=; h=Content-Type:Message-ID:Date:MIME-Version:From:Subject:To:Cc; b=P0Ro0JB89kfL9lgVGCebPz4duM/wBneKwlbkxrcVsfKxfnsyGN9JyUP3aJR5xe18fsU4/2eQUGT87707Ooy9exzsClLD9FvTmxU5Tf8Upz0nXi2vG0akI4oOePK38ekQMKBeNKqndzsBb0AyJK9vMyJ6k5ETXVfhw1i6bpP4GSM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TwerY18e; arc=none smtp.client-ip=209.85.166.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TwerY18e" Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-35d374bebe3so582205ab.1 for ; Wed, 06 Mar 2024 18:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1709777504; x=1710382304; darn=vger.kernel.org; h=cc:to:subject:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=bU6ex/faxbEcoxve2/Lztk/HkuxBTPG2WMTvXEAw/AQ=; b=TwerY18e5h341M0bBPS4BH4hLHBHeMQ7o13g2KmYXVTfftkZte4i+lEb38ofh6rHd4 stUmkKko4m4z6k63xGnd+aEkyno7ct/80w+57hg0yuV9AOZdJoIUi7cRtOVVG67YiT8s BfJsajkr1NIN1+zEOMiZKwV2MJl5zALlWj1d0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709777504; x=1710382304; h=cc:to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bU6ex/faxbEcoxve2/Lztk/HkuxBTPG2WMTvXEAw/AQ=; b=E0/6j/fX2/SNBOxB2ijMMlIjmQOn5OgVyy0LxeHCqeSJPtY+mNByB2AORQcAXg7cLs vupclbv1fUIEcPhIkhkEfIL29b0GObafRNTvSQGrnqWNtZYVdnQg52sxTgD0PVvfRwRW LDeqdencKDrII9kZ6PmdUECjIk2LrWJHC3yXFKWDxa5VSr+BJdmYMtqEZEP4DjODJdL/ NC2erZA2+CxFkgnX51sZWuChih65go69wXIOBvT7itWjustKv5b4wVzUmMOS8GyjTADf dQSpyvyoLtvhHpWC66fXt0upITw3MjyMh4jXiuFbXxALS2twocgqiNK4PgKIwn72i3N7 B4eA== X-Forwarded-Encrypted: i=1; AJvYcCVizEt/991sleWmwupqABm0BVJE41xY0zpVqSVzuF0baCabzq6rSz4iGmnTB9LAYyQ291DGtAeAA97h0nZycIrGchBidKO5icWYl9+jSZQt X-Gm-Message-State: AOJu0YyNkIn+BTtGUTy4G6mjK7j+FKIrhpcGuhVwmhQKYg0/KF0CiiNd 68NnS2o7cEN16o+VgMhn4L7oXFopNAHfAcfAPKLrBJ7lrqRcYAj69otGJqaApAk= X-Google-Smtp-Source: AGHT+IGmP23jw2dxEpdO3hwcYbHLS8lWRXpfrAB17vbqxnJr7EwxNbSElhoDraMyL3NQxAeNbmNl8Q== X-Received: by 2002:a6b:6712:0:b0:7c8:47d5:b86e with SMTP id b18-20020a6b6712000000b007c847d5b86emr869918ioc.0.1709777504594; Wed, 06 Mar 2024 18:11:44 -0800 (PST) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id k15-20020a02c76f000000b004740d29b120sm3644410jao.111.2024.03.06.18.11.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Mar 2024 18:11:43 -0800 (PST) Message-ID: Date: Wed, 6 Mar 2024 19:11:42 -0700 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Shuah Khan Subject: [GIT PULL] KUnit next update for Linux 6.9-rc1 To: Linus Torvalds Cc: Stephen Rothwell , david Gow , Brendan Higgins , Daniel Vetter , Christian Koenig , Matthew Auld , Dave Airlie , shuah , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Hi Linus, Please pull the following KUnit next update for Linux 6.8-rc1. This KUnit next update for Linux 6.9-rc1 consists of: -- fix to make kunit_bus_type const -- kunit tool change to Print UML command -- DRM device creation helpers are now using the new kunit device creation helpers. This change resulted in DRM helpers switching from using a platform_device, to a dedicated bus and device type used by kunit. kunit devices don't set DMA mask and this caused regression on some drm tests as they can't allocate DMA buffers. Fix this problem by setting DMA masks on the kunit device during initialization. -- KUnit has several macros which accept a log message, which can contain printf format specifiers. Some of these (the explicit log macros) already use the __printf() gcc attribute to ensure the format specifiers are valid, but those which could fail the test, and hence used __kunit_do_failed_assertion() behind the scenes, did not. These include: KUNIT_EXPECT_*_MSG(), KUNIT_ASSERT_*_MSG(), and KUNIT_FAIL() A 9 patch series adds the __printf() attribute, and fixes all of the issues uncovered. Note: make allmodconfig x86 passed passed for me on March 4th linux-next (This could be with Stephen's fix up for the following problem). Stephen found a problem in drivers/gpu/drm/tests/drm_buddy_test.c Caused by commit 806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers") interacting with commit c70703320e55 ("drm/tests/drm_buddy: add alloc_range_bias test") from the drm-misc-fixes tree. Stephen found that the problem is not with the format string types, but with a missing argument i.e. there is another argument required by the format string. It is easier to fix this problem in the drm-misc-fixes tree. The hope is that the fix to the problem has been sent to you or will be sent to you before the merge. If not Stephen's fix up will be necessary. diff is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit d206a76d7d2726f3b096037f2079ce0bd3ba329b: Linux 6.8-rc6 (2024-02-25 15:46:06 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-kunit-6.9-rc1 for you to fetch changes up to 806cb2270237ce2ec672a407d66cee17a07d3aa2: kunit: Annotate _MSG assertion variants with gnu printf specifiers (2024-02-28 13:07:49 -0700) ---------------------------------------------------------------- linux_kselftest-kunit-6.9-rc1 This KUnit next update for Linux 6.9-rc1 consists of: -- fix to make kunit_bus_type const -- kunit tool change to Print UML command -- DRM device creation helpers are now using the new kunit device creation helpers. This change resulted in DRM helpers switching from using a platform_device, to a dedicated bus and device type used by kunit. kunit devices don't set DMA mask and this caused regression on some drm tests as they can't allocate DMA buffers. Fix this problem by setting DMA masks on the kunit device during initialization. -- KUnit has several macros which accept a log message, which can contain printf format specifiers. Some of these (the explicit log macros) already use the __printf() gcc attribute to ensure the format specifiers are valid, but those which could fail the test, and hence used __kunit_do_failed_assertion() behind the scenes, did not. These include: KUNIT_EXPECT_*_MSG(), KUNIT_ASSERT_*_MSG(), and KUNIT_FAIL() A 9 patch series adds the __printf() attribute, and fixes all of the issues uncovered. ---------------------------------------------------------------- David Gow (9): kunit: test: Log the correct filter string in executor_test lib/cmdline: Fix an invalid format specifier in an assertion msg lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg time: test: Fix incorrect format specifier rtc: test: Fix invalid format specifier. net: test: Fix printf format specifier in skb_segment kunit test drm/xe/tests: Fix printf format specifiers in xe_migrate test drm: tests: Fix invalid printf format specifiers in KUnit tests kunit: Annotate _MSG assertion variants with gnu printf specifiers Lucas De Marchi (1): kunit: Mark filter* params as rw Maxime Ripard (1): kunit: Setup DMA masks on the kunit device Mickaël Salaün (1): kunit: tool: Print UML command Ricardo B. Marliere (1): kunit: make kunit_bus_type const drivers/gpu/drm/tests/drm_buddy_test.c | 14 +++++++------- drivers/gpu/drm/tests/drm_mm_test.c | 6 +++--- drivers/gpu/drm/xe/tests/xe_migrate.c | 8 ++++---- drivers/rtc/lib_test.c | 2 +- include/kunit/test.h | 12 ++++++------ kernel/time/time_test.c | 2 +- lib/cmdline_kunit.c | 2 +- lib/kunit/device.c | 6 +++++- lib/kunit/executor.c | 6 +++--- lib/kunit/executor_test.c | 2 +- lib/memcpy_kunit.c | 4 ++-- net/core/gso_test.c | 2 +- tools/testing/kunit/kunit_kernel.py | 1 + 13 files changed, 36 insertions(+), 31 deletions(-) ---------------------------------------------------------------- diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c index 2f32fb2f12e7..3dbfa3078449 100644 --- a/drivers/gpu/drm/tests/drm_buddy_test.c +++ b/drivers/gpu/drm/tests/drm_buddy_test.c @@ -55,30 +55,30 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test) KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, ps, ps, list, 0), - "buddy_alloc hit an error size=%u\n", + "buddy_alloc hit an error size=%lu\n", ps); } while (++i < n_pages); KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, 3 * ps, ps, &allocated, DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc didn't error size=%u\n", 3 * ps); + "buddy_alloc didn't error size=%lu\n", 3 * ps); drm_buddy_free_list(&mm, &middle); KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, 3 * ps, ps, &allocated, DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc didn't error size=%u\n", 3 * ps); + "buddy_alloc didn't error size=%lu\n", 3 * ps); KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, 2 * ps, ps, &allocated, DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc didn't error size=%u\n", 2 * ps); + "buddy_alloc didn't error size=%lu\n", 2 * ps); drm_buddy_free_list(&mm, &right); KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, 3 * ps, ps, &allocated, DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc didn't error size=%u\n", 3 * ps); + "buddy_alloc didn't error size=%lu\n", 3 * ps); /* * At this point we should have enough contiguous space for 2 blocks, * however they are never buddies (since we freed middle and right) so @@ -87,13 +87,13 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test) KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, 2 * ps, ps, &allocated, DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc hit an error size=%u\n", 2 * ps); + "buddy_alloc hit an error size=%lu\n", 2 * ps); drm_buddy_free_list(&mm, &left); KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size, 3 * ps, ps, &allocated, DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc hit an error size=%u\n", 3 * ps); + "buddy_alloc hit an error size=%lu\n", 3 * ps); total = 0; list_for_each_entry(block, &allocated, link) diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c index 1eb0c304f960..f37c0d765865 100644 --- a/drivers/gpu/drm/tests/drm_mm_test.c +++ b/drivers/gpu/drm/tests/drm_mm_test.c @@ -157,7 +157,7 @@ static void drm_test_mm_init(struct kunit *test) /* After creation, it should all be one massive hole */ if (!assert_one_hole(test, &mm, 0, size)) { - KUNIT_FAIL(test, ""); + KUNIT_FAIL(test, "mm not one hole on creation"); goto out; } @@ -171,14 +171,14 @@ static void drm_test_mm_init(struct kunit *test) /* After filling the range entirely, there should be no holes */ if (!assert_no_holes(test, &mm)) { - KUNIT_FAIL(test, ""); + KUNIT_FAIL(test, "mm has holes when filled"); goto out; } /* And then after emptying it again, the massive hole should be back */ drm_mm_remove_node(&tmp); if (!assert_one_hole(test, &mm, 0, size)) { - KUNIT_FAIL(test, ""); + KUNIT_FAIL(test, "mm does not have single hole after emptying"); goto out; } diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c index a6523df0f1d3..c347e2c29f81 100644 --- a/drivers/gpu/drm/xe/tests/xe_migrate.c +++ b/drivers/gpu/drm/xe/tests/xe_migrate.c @@ -114,21 +114,21 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo, region | XE_BO_NEEDS_CPU_ACCESS); if (IS_ERR(remote)) { - KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %li\n", - str, PTR_ERR(remote)); + KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %pe\n", + str, remote); return; } err = xe_bo_validate(remote, NULL, false); if (err) { - KUNIT_FAIL(test, "Failed to validate system bo for %s: %li\n", + KUNIT_FAIL(test, "Failed to validate system bo for %s: %i\n", str, err); goto out_unlock; } err = xe_bo_vmap(remote); if (err) { - KUNIT_FAIL(test, "Failed to vmap system bo for %s: %li\n", + KUNIT_FAIL(test, "Failed to vmap system bo for %s: %i\n", str, err); goto out_unlock; } diff --git a/drivers/rtc/lib_test.c b/drivers/rtc/lib_test.c index d5caf36c56cd..225c859d6da5 100644 --- a/drivers/rtc/lib_test.c +++ b/drivers/rtc/lib_test.c @@ -54,7 +54,7 @@ static void rtc_time64_to_tm_test_date_range(struct kunit *test) days = div_s64(secs, 86400); - #define FAIL_MSG "%d/%02d/%02d (%2d) : %ld", \ + #define FAIL_MSG "%d/%02d/%02d (%2d) : %lld", \ year, month, mday, yday, days KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG); diff --git a/include/kunit/test.h b/include/kunit/test.h index fcb4a4940ace..61637ef32302 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -579,12 +579,12 @@ void __printf(2, 3) kunit_log_append(struct string_stream *log, const char *fmt, void __noreturn __kunit_abort(struct kunit *test); -void __kunit_do_failed_assertion(struct kunit *test, - const struct kunit_loc *loc, - enum kunit_assert_type type, - const struct kunit_assert *assert, - assert_format_t assert_format, - const char *fmt, ...); +void __printf(6, 7) __kunit_do_failed_assertion(struct kunit *test, + const struct kunit_loc *loc, + enum kunit_assert_type type, + const struct kunit_assert *assert, + assert_format_t assert_format, + const char *fmt, ...); #define _KUNIT_FAILED(test, assert_type, assert_class, assert_format, INITIALIZER, fmt, ...) do { \ static const struct kunit_loc __loc = KUNIT_CURRENT_LOC; \ diff --git a/kernel/time/time_test.c b/kernel/time/time_test.c index ca058c8af6ba..3e5d422dd15c 100644 --- a/kernel/time/time_test.c +++ b/kernel/time/time_test.c @@ -73,7 +73,7 @@ static void time64_to_tm_test_date_range(struct kunit *test) days = div_s64(secs, 86400); - #define FAIL_MSG "%05ld/%02d/%02d (%2d) : %ld", \ + #define FAIL_MSG "%05ld/%02d/%02d (%2d) : %lld", \ year, month, mdday, yday, days KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG); diff --git a/lib/cmdline_kunit.c b/lib/cmdline_kunit.c index d4572dbc9145..705b82736be0 100644 --- a/lib/cmdline_kunit.c +++ b/lib/cmdline_kunit.c @@ -124,7 +124,7 @@ static void cmdline_do_one_range_test(struct kunit *test, const char *in, n, e[0], r[0]); p = memchr_inv(&r[1], 0, sizeof(r) - sizeof(r[0])); - KUNIT_EXPECT_PTR_EQ_MSG(test, p, NULL, "in test %u at %u out of bound", n, p - r); + KUNIT_EXPECT_PTR_EQ_MSG(test, p, NULL, "in test %u at %td out of bound", n, p - r); } static void cmdline_test_range(struct kunit *test) diff --git a/lib/kunit/device.c b/lib/kunit/device.c index 644a38a1f5b1..abc603730b8e 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -10,6 +10,7 @@ */ #include +#include #include #include @@ -35,7 +36,7 @@ struct kunit_device { #define to_kunit_device(d) container_of_const(d, struct kunit_device, dev) -static struct bus_type kunit_bus_type = { +static const struct bus_type kunit_bus_type = { .name = "kunit", }; @@ -133,6 +134,9 @@ static struct kunit_device *kunit_device_register_internal(struct kunit *test, return ERR_PTR(err); } + kunit_dev->dev.dma_mask = &kunit_dev->dev.coherent_dma_mask; + kunit_dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + kunit_add_action(test, device_unregister_wrapper, &kunit_dev->dev); return kunit_dev; diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 689fff2b2b10..70b9a43cd257 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -33,13 +33,13 @@ static char *filter_glob_param; static char *filter_param; static char *filter_action_param; -module_param_named(filter_glob, filter_glob_param, charp, 0400); +module_param_named(filter_glob, filter_glob_param, charp, 0600); MODULE_PARM_DESC(filter_glob, "Filter which KUnit test suites/tests run at boot-time, e.g. list* or list*.*del_test"); -module_param_named(filter, filter_param, charp, 0400); +module_param_named(filter, filter_param, charp, 0600); MODULE_PARM_DESC(filter, "Filter which KUnit test suites/tests run at boot-time using attributes, e.g. speed>slow"); -module_param_named(filter_action, filter_action_param, charp, 0400); +module_param_named(filter_action, filter_action_param, charp, 0600); MODULE_PARM_DESC(filter_action, "Changes behavior of filtered tests using attributes, valid values are:\n" ": do not run filtered tests as normal\n" diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c index 22d4ee86dbed..3f7f967e3688 100644 --- a/lib/kunit/executor_test.c +++ b/lib/kunit/executor_test.c @@ -129,7 +129,7 @@ static void parse_filter_attr_test(struct kunit *test) GFP_KERNEL); for (j = 0; j < filter_count; j++) { parsed_filters[j] = kunit_next_attr_filter(&filter, &err); - KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter '%s'", filters[j]); + KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter from '%s'", filters); } KUNIT_EXPECT_STREQ(test, kunit_attr_filter_name(parsed_filters[0]), "speed"); diff --git a/lib/memcpy_kunit.c b/lib/memcpy_kunit.c index 440aee705ccc..30e00ef0bf2e 100644 --- a/lib/memcpy_kunit.c +++ b/lib/memcpy_kunit.c @@ -32,7 +32,7 @@ struct some_bytes { BUILD_BUG_ON(sizeof(instance.data) != 32); \ for (size_t i = 0; i < sizeof(instance.data); i++) { \ KUNIT_ASSERT_EQ_MSG(test, instance.data[i], v, \ - "line %d: '%s' not initialized to 0x%02x @ %d (saw 0x%02x)\n", \ + "line %d: '%s' not initialized to 0x%02x @ %zu (saw 0x%02x)\n", \ __LINE__, #instance, v, i, instance.data[i]); \ } \ } while (0) @@ -41,7 +41,7 @@ struct some_bytes { BUILD_BUG_ON(sizeof(one) != sizeof(two)); \ for (size_t i = 0; i < sizeof(one); i++) { \ KUNIT_EXPECT_EQ_MSG(test, one.data[i], two.data[i], \ - "line %d: %s.data[%d] (0x%02x) != %s.data[%d] (0x%02x)\n", \ + "line %d: %s.data[%zu] (0x%02x) != %s.data[%zu] (0x%02x)\n", \ __LINE__, #one, i, one.data[i], #two, i, two.data[i]); \ } \ kunit_info(test, "ok: " TEST_OP "() " name "\n"); \ diff --git a/net/core/gso_test.c b/net/core/gso_test.c index 4c2e77bd12f4..358c44680d91 100644 --- a/net/core/gso_test.c +++ b/net/core/gso_test.c @@ -225,7 +225,7 @@ static void gso_test_func(struct kunit *test) segs = skb_segment(skb, features); if (IS_ERR(segs)) { - KUNIT_FAIL(test, "segs error %lld", PTR_ERR(segs)); + KUNIT_FAIL(test, "segs error %pe", segs); goto free_gso_skb; } else if (!segs) { KUNIT_FAIL(test, "no segments"); diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index 0b6488efed47..7254c110ff23 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -146,6 +146,7 @@ class LinuxSourceTreeOperationsUml(LinuxSourceTreeOperations): """Runs the Linux UML binary. Must be named 'linux'.""" linux_bin = os.path.join(build_dir, 'linux') params.extend(['mem=1G', 'console=tty', 'kunit_shutdown=halt']) + print('Running tests with:\n$', linux_bin, ' '.join(shlex.quote(arg) for arg in params)) return subprocess.Popen([linux_bin] + params, stdin=subprocess.PIPE, stdout=subprocess.PIPE,