Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1489514iog; Sat, 18 Jun 2022 10:49:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v2VeAS/quQuoQpC/4Ztik/Y2yluGXmfy2d0KeFMOVKnNHloaPzrBniIpbSVe0ggebNHISd X-Received: by 2002:a05:6402:4001:b0:435:b20:d7ae with SMTP id d1-20020a056402400100b004350b20d7aemr19162986eda.90.1655574597206; Sat, 18 Jun 2022 10:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655574597; cv=none; d=google.com; s=arc-20160816; b=oWuBH55KGY/vxluq4nSKwvCrQYoNZ9TAu+sOshr1AGh+6D0anganEkxLZklODuHRTO 89oISCffkKa7M6EBfIBWRUx5YqWxEK2YrzNrGytz7oDhR3JCKN77g4Dz2PKf7DBqIQAr P9MQ8DJEM9phxE93poVRD9nZmMDugYBqmqh0/rA0vd47e7B279Xz+nUBvBazqX45k0He y/LRrXbncHrkqYqNBSX4dlRXV/qqxwnJxv60ZJhGJYUNkrP04JRJeKvMaa2KAfzVFFnc q8L1ZBTYBSY4fi7NPObuTakjdeyLHqWgzhlZLabPmMzZBlksTXisNpY/7c/9/O62uLYR Mcbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=B8CXs8G7SKCeidkQWd9kAuICsm7Sw1h76v8hv8CR6wQ=; b=mPilC8jgN42hf+OiUhOmz1sUYQpqH2p0H8Hd/Kl4X4wsjM1+TY1P99P0Q44xmvyi15 T68Rjkr/wB9kIpjTpXwMpXLNEwUyNMxJZEYe93yXdqtY1sKmHLU3s8MJX/1ij8nArqy9 RymvcHtSsgJsfyLQGMeOlRNhvPwNucuj4i+LLmmTR6FvDJzFn5a/Ej0s7NA6cOLg2orh 3ATS5JDd/El7gc4jgLxGDAhcpS/OEB53kid6F1hlXwXzrnmTHbnIN38vlTyxMFF1P/5V MNQ1P3OL3vaV9IvSTE/qYrfbjn03wzSuZaBoWZr9s6pF/cSJhDP2HoP7VNYFV1QEtTxS aXiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=cuXb7N4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a056402524600b0042fadee7b8esi7558942edd.322.2022.06.18.10.49.32; Sat, 18 Jun 2022 10:49:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=cuXb7N4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236622AbiFRRLp (ORCPT + 99 others); Sat, 18 Jun 2022 13:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236137AbiFRRLm (ORCPT ); Sat, 18 Jun 2022 13:11:42 -0400 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6AAB13DCA for ; Sat, 18 Jun 2022 10:11:37 -0700 (PDT) Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1014b2752c1so9140147fac.11 for ; Sat, 18 Jun 2022 10:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp.br; s=usp-google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=B8CXs8G7SKCeidkQWd9kAuICsm7Sw1h76v8hv8CR6wQ=; b=cuXb7N4G9pIbYvpYCa6o9PQHUD2DfcKP/+gFugpXKusIPZ8udyvtuH7DJPmo+JUAOL 8eagpNlDgynjnq8Gd81Y/eopVQYnjECp8OsqpfuRnKA9HNyn++ZH7HNNZ9TIjsRXeSeG BvdjwgCJNtORrqw8bW9YNyv+ik/h87ruk6IhWF/Ulomb3roDpockEzXUsaUcJnWsLKey JlqmKq38sV0x3yb+kEcSWDJ7IjC7ODgIlcJzGQ3llXc0MXXhANbar/PuhU229R0QH9qT lz3fsVlqpE6nT/3L7c8FVrsr8AgyflhOszSQr4SlJOROtqKz5LZwEe2tkhcIJNa2UAy5 H5YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=B8CXs8G7SKCeidkQWd9kAuICsm7Sw1h76v8hv8CR6wQ=; b=fBFBeEXsjIKZBSbLu/Eg8ntmwnVeUNuOssaGdTHvBS04NQ0/0gOHaQj3Widk4hrz63 LOAPNr1bqYC3qrgecUZ42/PrMGPr0KVtexvH9OmKYIgnlBsAe3XWQXdUjRgl3k0okZd3 gbr+3U9XimIKXmQc/jYQzKsdt7sHd68u99rZ/0zNj6eREOJJ5XKR69N08VJeY7d230a4 aPQmxa3I6+Y1Z2NDXwJC1aJkRghG1nxhn5GLlm7WPWB9f3WZQrEUk4gDtHf0oj/a6ey2 D94FlyhvBMXpVEBhVY1INin1kO1rzwWbVSfCbwHtMSrBIJ7UM2ZfBulx7OlOmD99p5fa ncQQ== X-Gm-Message-State: AJIora85aPUQ7spkN/zPKdikEwsBTVZZbbtIyAl/jKtkCf+/R8r03gNr vngGRdGuz92H95QoAOi6yo4q3g== X-Received: by 2002:a05:6870:538b:b0:101:17f2:d6e with SMTP id h11-20020a056870538b00b0010117f20d6emr13782917oan.200.1655572295844; Sat, 18 Jun 2022 10:11:35 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:84c6:fe26:c42d:aab9:fa8a? ([2804:14d:8084:84c6:fe26:c42d:aab9:fa8a]) by smtp.gmail.com with ESMTPSA id o5-20020a4a2c05000000b0035eb4e5a6b3sm4677268ooo.9.2022.06.18.10.11.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Jun 2022 10:11:35 -0700 (PDT) Message-ID: <3358b97e-021a-82b7-9ae2-2113aea2c2d9@usp.br> Date: Sat, 18 Jun 2022 14:11:29 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 0/5] Rework KUnit test execution in modules Content-Language: en-US To: David Gow , Brendan Higgins , Luis Chamberlain , Jeremy Kerr , Daniel Latypov , Shuah Khan , Andrew Jeffery , Mika Westerberg , Andra Paraschiv , Longpeng Cc: kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-modules@vger.kernel.org, Matt Johnston References: <20220618090310.1174932-1-davidgow@google.com> From: =?UTF-8?Q?Ma=c3=adra_Canal?= In-Reply-To: <20220618090310.1174932-1-davidgow@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/18/22 06:03, David Gow wrote: > This patch series makes two changes to how KUnit test suites are stored > and executed: > - The .kunit_test_suites section is now used for tests in modules (in > lieu of a module_init funciton), as well as for built-in tests. The > module loader will now trigger test execution. This frees up the > module_init function for other uses. > - Instead of storing an array of arrays of suites, have the > kunit_test_suite() and kunit_test_suites() macros append to one global > (or per-module) list of test suites. This removes a needless layer of > indirection. > > The upshot of this is that it should now be possible to use the > kunit_test_suite() and kunit_test_suites() macros to register test > suites even from within modules which otherwise had module_init > functions. This was proving to be quite a common issue, resulting in > several modules calling into KUnit's private suite execution functions > to run their tests (often introducing incompatibilities with the KUnit > tooling). > > This series also fixes the thunderbolt, nitro_enclaves, and > sdhci-of-aspeed tests to use kunit_test_suite() now that it works. > > Huge thanks to Jeremy Kerr, who designed and implemented the module > loader changes, and to Daniel Latypov for pushing the simplification of > the nested arrays in .kunit_test_suites. > > I've tested this series both with builtin tests, and with modules on > x86_64, but there's always the possibility that there's something subtle > and nasty on another architecture, so please test! > > Cheers, > -- David > I've tested the modules on x86_64 machines, and everything looks fine. Also, I applied the AMDGPU KUnit tests [1] on top of these patches, tried out compiling as a module, and it runs pretty well! Great to see this feature on KUnit! Tested-by: Maíra Canal [1] https://lore.kernel.org/dri-devel/20220608010709.272962-1 maira.canal@usp.br/ Best Regards, - Maíra Canal