From patchwork Sun Jan 30 09:29:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 12729772 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 858CCC433FE for ; Sun, 30 Jan 2022 09:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A56wMp+l4XRNQTDoP0Eunaw61NLvcEyRL/l1TEyDCFk=; b=pm7hTB4F83DPDR c8hh8U7ZAL7yJi0PUEkCgL9TNlZEUf+XOK1avXhwJbTDmUrqHGlC2sUpSvVKNafdSgagF/7RqNfHk dTYzG6Hrqa1D2rlfrud2V69gxdbKkNIabnewWV96nggc5FJzI0wQE4EtOrJk/RD0X+4MFkX/aap6+ fON3WzA3DzWmO7Dq1Jy0kIKZ1aC9/vfXlfeOGBMsRiUMax6m/ofGlR1fxXeaP511AD3D0vuvgNDni MFI9zMIri726KXLYUBjd0kK3Ph0o3lsspPh1HPazW8Dpnp6DqE1VpeGlWo+rIXDr7Zgcv291s2ikd NZQCRFQ2Dcssmp9yYcrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nE6XW-006F3v-A3; Sun, 30 Jan 2022 09:30:30 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nE6XS-006F35-RR for linux-arm-kernel@lists.infradead.org; Sun, 30 Jan 2022 09:30:28 +0000 Received: by mail-pf1-x42d.google.com with SMTP id 192so10207410pfz.3 for ; Sun, 30 Jan 2022 01:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YlVRxz39fY5cRLJn+loRiR0FbZ2jN676CvPNPpw0e+M=; b=Z8bDKdXGnZSNdZMBJsP78ZxDzyQ8c6cgyUV1W4+4PUW8JjCkqPkRP3iwOLKjT5Edpa tmNhUBe3z5KexUux9yAuKJzguTvrNtKFs1rM+24eULlsCqqoh+MG049e9KHTB/zaePx1 EOCscBUkMpVO+5W6yPAaWvmMg0qSD2UbX28DufA6/KBhZdpw3jcW8CPw2UfqzHPBHnjh +8Zo+RjBZ1j8vgRRttsw7bGFxQxXHtdLlUDkc0CdjRCf/xLtfxTiaVn48Qptn0O+PGbm AiALGN8p7Vj8vJvdlMmQAGgtLeRrePYtUfLsytJJTAJqNqpDfy+h6moIh+TKn/jd3kC/ S18A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YlVRxz39fY5cRLJn+loRiR0FbZ2jN676CvPNPpw0e+M=; b=LtJVDrzQshSla1HMvdAELfPYeG+dPLX233UbPmqLai1Mpf9KJq3A/41XggYzYyni3b /tQyQDF+pO8fYeNANRTY26NntnCCsuifloBxdC5M18s5IoXepocTK7oTpu066uosohjv RrM+WvnAPB9r+S6Z/dWOuWGKiEZp6nKixnMbeamOX3zPclhTKdc9I3zzF+f3/yg27WOl c0sK1gOyZD3tZ59bCzLnN9/mQMqAIU4kIXBo5zxYQmWKfApe7R1e0B9Mb/0R1FjIb9En HveGtAIZ72WNgEVN8TYbUHyKhv2uTIQVwNKc11MrpFdhh+CuS8T6fW30raUL411yMRnq AeJw== X-Gm-Message-State: AOAM533dbUtkDb5wcKISmmyKAUUILQfODAfh5uhicrT4BBi0MnfNhrpO JzqUaFyINbSTMmCjbAVpSac= X-Google-Smtp-Source: ABdhPJz5sN9mXEcVRNmRul1bu2ljG6NHpaiOD+Mnw+OkBHrJQc6TnmXVJcIgEBiUd2tskW/Xudeftw== X-Received: by 2002:a63:2326:: with SMTP id j38mr12839349pgj.346.1643535026074; Sun, 30 Jan 2022 01:30:26 -0800 (PST) Received: from localhost (61-223-193-169.dynamic-ip.hinet.net. [61.223.193.169]) by smtp.gmail.com with ESMTPSA id t11sm497032pgi.90.2022.01.30.01.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 01:30:25 -0800 (PST) From: Hou Tao To: Daniel Borkmann Cc: Alexei Starovoitov , Martin KaFai Lau , Yonghong Song , Andrii Nakryiko , "David S . Miller" , Jakub Kicinski , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, houtao1@huawei.com, Zi Shen Lim , Catalin Marinas , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, Hou Tao Subject: [PATCH bpf-next v3 2/3] selftests/bpf: do not export subtest as standalone test Date: Sun, 30 Jan 2022 17:29:16 +0800 Message-Id: <20220130092917.14544-3-hotforest@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220130092917.14544-1-hotforest@gmail.com> References: <20220130092917.14544-1-hotforest@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220130_013026_918510_5E49FBA3 X-CRM114-Status: GOOD ( 14.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Two subtests in ksyms_module.c are not qualified as static, so these subtests are exported as standalone tests in tests.h and lead to confusion for the output of "./test_progs -t ksyms_module". By using the following command: grep "^void \(serial_\)\?test_[a-zA-Z0-9_]\+(\(void\)\?)" \ tools/testing/selftests/bpf/prog_tests/*.c | \ awk -F : '{print $1}' | sort | uniq -c | awk '$1 != 1' Find out that other tests also have the similar problem, so fix these tests by marking subtests in these tests as static. For xdp_adjust_frags.c, there is just one subtest, so just export the subtest directly. Signed-off-by: Hou Tao --- tools/testing/selftests/bpf/prog_tests/ksyms_module.c | 4 ++-- tools/testing/selftests/bpf/prog_tests/xdp_adjust_frags.c | 6 ------ tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 4 ++-- tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c | 4 ++-- tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/ksyms_module.c b/tools/testing/selftests/bpf/prog_tests/ksyms_module.c index d490ad80eccb..997aa90dea64 100644 --- a/tools/testing/selftests/bpf/prog_tests/ksyms_module.c +++ b/tools/testing/selftests/bpf/prog_tests/ksyms_module.c @@ -6,7 +6,7 @@ #include "test_ksyms_module.lskel.h" #include "test_ksyms_module.skel.h" -void test_ksyms_module_lskel(void) +static void test_ksyms_module_lskel(void) { struct test_ksyms_module_lskel *skel; int retval; @@ -30,7 +30,7 @@ void test_ksyms_module_lskel(void) test_ksyms_module_lskel__destroy(skel); } -void test_ksyms_module_libbpf(void) +static void test_ksyms_module_libbpf(void) { struct test_ksyms_module *skel; int retval, err; diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_frags.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_frags.c index 31c188666e81..6ca3582bb056 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_frags.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_frags.c @@ -96,9 +96,3 @@ void test_xdp_update_frags(void) out: bpf_object__close(obj); } - -void test_xdp_adjust_frags(void) -{ - if (test__start_subtest("xdp_adjust_frags")) - test_xdp_update_frags(); -} diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c index ccc9e63254a8..a254c54c3ada 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c @@ -118,7 +118,7 @@ static void test_xdp_adjust_tail_grow2(void) bpf_object__close(obj); } -void test_xdp_adjust_frags_tail_shrink(void) +static void test_xdp_adjust_frags_tail_shrink(void) { const char *file = "./test_xdp_adjust_tail_shrink.o"; __u32 duration, retval, size, exp_size; @@ -180,7 +180,7 @@ void test_xdp_adjust_frags_tail_shrink(void) bpf_object__close(obj); } -void test_xdp_adjust_frags_tail_grow(void) +static void test_xdp_adjust_frags_tail_grow(void) { const char *file = "./test_xdp_adjust_tail_grow.o"; __u32 duration, retval, size, exp_size; diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c index 13aabb3b6cf2..15e48098c8b8 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c @@ -8,7 +8,7 @@ #define IFINDEX_LO 1 -void test_xdp_with_cpumap_helpers(void) +static void test_xdp_with_cpumap_helpers(void) { struct test_xdp_with_cpumap_helpers *skel; struct bpf_prog_info info = {}; @@ -68,7 +68,7 @@ void test_xdp_with_cpumap_helpers(void) test_xdp_with_cpumap_helpers__destroy(skel); } -void test_xdp_with_cpumap_frags_helpers(void) +static void test_xdp_with_cpumap_frags_helpers(void) { struct test_xdp_with_cpumap_frags_helpers *skel; struct bpf_prog_info info = {}; diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c index 2a784ccd3136..08d074ec471d 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c @@ -81,7 +81,7 @@ static void test_neg_xdp_devmap_helpers(void) } } -void test_xdp_with_devmap_frags_helpers(void) +static void test_xdp_with_devmap_frags_helpers(void) { struct test_xdp_with_devmap_frags_helpers *skel; struct bpf_prog_info info = {};