Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp805135iob; Fri, 13 May 2022 13:07:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6yXKnttttyz5OF1OZVB2LhrPf7S1fwH9ku9UvQbnyH229qdDZrtXolmDjoI5TK1hJwbh2 X-Received: by 2002:a17:906:1ec3:b0:6cf:d118:59e2 with SMTP id m3-20020a1709061ec300b006cfd11859e2mr5772442ejj.767.1652472428998; Fri, 13 May 2022 13:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652472428; cv=none; d=google.com; s=arc-20160816; b=n3sXYXKV0Jfabj8gKNbbnJ/wGjddxZWLQv3tE0LEkajpRqu6C6UF63OJFeazCi+Maj ykrQTzX+MY3lmjADtG8WtMYd1bcCtd0b567ATc73dUWGoR0sJQIw6vrN4YTZPBFz5xUD u/oJSbh5siQDeNFIbTdSoysM1SSSoX8VCAkykJCQx8Dcv8lW8DOMMe5Uh+VDc0fyxVaY NwFHP+XuiEyqZMzbIIZAufOKFCbzQNMyR2u4fbLArwLKEnEcGZbvQeZi0kyxM2ngXXjt uoGCLCe9UA5Uzd94UMhwoK4n7SooRNXMsXIO63WigCjhKuw1GWrg22btJur0CdYJgRTa JpOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Qdnyh7+uu18FzVA20njWSdWEwxEC9EB3ZfenS4EmCh8=; b=fZfIyDIORopgan4M1KZvyAQGImZIo/Xb23pAmtpiBNYMwgw2lzgd8HS0Pktu14sxsH Z0H4Hrx5w6zIWsZVartktC9BN4uA3H/ylCIxvJlvBIN0A4D92k/O8dmPhgCt/QBKg2Ff uub69DGVPC07YKTmjQmBHLFl/5ztFGO9D7V59pIoCUBGD/TGOS19F10rJ0nuFnljIYTC 2dh5xkG4itq5lBaeNNaB/F6T20kfv2TSp76hACPV6djaIkZixhUdjfBoYH5/WJqqYrp9 ZzQbyXWOtktqt8E036ulXlfeUoiyrlfIBjh3x9m4NG4K45K3dXkBTRn9/RfyRLtquG9s 6+2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NtPPWDW+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a056402149200b004280c0e391esi2384553edv.442.2022.05.13.13.06.42; Fri, 13 May 2022 13:07:08 -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=@google.com header.s=20210112 header.b=NtPPWDW+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357794AbiELSwh (ORCPT + 99 others); Thu, 12 May 2022 14:52:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357782AbiELSwf (ORCPT ); Thu, 12 May 2022 14:52:35 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C91D5EBC9 for ; Thu, 12 May 2022 11:52:33 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id s11so3542755edy.6 for ; Thu, 12 May 2022 11:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qdnyh7+uu18FzVA20njWSdWEwxEC9EB3ZfenS4EmCh8=; b=NtPPWDW+K9Q3GoCCru2mvoD3zjpF1DWuglu+M2WF8crMt/Y+9dsYZ3dkt+buBrYye/ pITGDScQHlaTUGQguC/n+YyPsk1I9N/0rmmoewXxEq9jBEl/vogABi1kQ943x7A4XX0h zZvX/DdbVdY5aH9lGHQAaa/zZx0waDN1vdegmtxWJf5xWxAObQjX4mIE7SscUUA+yw8G 2LQJaOO5dgiaXpOJiQEqzfjvLJ1zOsAnpd/PcfMnlsRoVLc2NPI8i0Q70cByqUu1tXSu afSw0z2XiJSK42puSJjpK1CoNkV3ZNfBhNQcI3071baoxDnfyL+CcCNvUIgJMVfEUdai GIZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qdnyh7+uu18FzVA20njWSdWEwxEC9EB3ZfenS4EmCh8=; b=GxyGtRVpvF2VqCm+WQP4p2p6VtamB9RtHS0K1HvFROjbtuuoGVUpmNL3vFmal7vlNG 4ZlBqykZWEMeO6LqnBjj5dzTdmORamYa5js9j+s5+iL2vS65QeWqGdhl9JQbvKOVJDeT uq+7n+q8JmMJXvTAoqCvCWAyX15Sn0saoVxBqY401mQYnrZbsw4PY4Oz/Pow61k0wIp3 A9FpWjB5hMJIRh2DoC7QfFJsaLR2tE8u8AulnOH63hnzrQv77y5yD5EXn9myOa7TRfNd jr8UotlsmA1Q1XjZ4rPH1yzkAVqNs3sbbnj2p6xI+85At1IG2zkfYEmAoGbBopgpiA+I oBEw== X-Gm-Message-State: AOAM530CmfdAUU4fha0rTXCXAQhEZai7P0qqqK+FAu7qYfHsqKOXYNh3 tSMwhOxiQkmCb1C+mW/xVM7m1lj2YjHl5+dZt3krYw== X-Received: by 2002:a05:6402:40c5:b0:427:af77:c10c with SMTP id z5-20020a05640240c500b00427af77c10cmr36851119edb.387.1652381552037; Thu, 12 May 2022 11:52:32 -0700 (PDT) MIME-Version: 1.0 References: <20220502192327.81153-1-dlatypov@google.com> In-Reply-To: <20220502192327.81153-1-dlatypov@google.com> From: Brendan Higgins Date: Thu, 12 May 2022 14:52:20 -0400 Message-ID: Subject: Re: [PATCH] lib/atomic64_test.c: convert to use KUnit To: Daniel Latypov Cc: davidgow@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, mpe@ellerman.id.au Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Mon, May 2, 2022 at 3:23 PM Daniel Latypov wrote: > > The test currently is a bunch of checks (implemented using BUG_ON()) > that can be built into the kernel or as a module. > > Convert it to a KUnit test, which can also run in both modes. > From a user's perspective, this change adds a CONFIG_KUNIT=y dep and > changes the output format of the test [1]. The test itself is the same. > > This hopefully makes the test easier to run and more consistent with > similar tests in lib/. > Since it has no dependencies, it can be run without explicitly setting > up a .kunitconfig via > $ ./tools/testing/kunit/kunit.py run atomic > ... > [13:53:44] Starting KUnit Kernel (1/1)... > [13:53:44] ============================================================ > [13:53:47] =================== atomic (2 subtests) ==================== > [13:53:47] [PASSED] test_atomic > [13:53:47] [PASSED] test_atomic64 > [13:53:47] ===================== [PASSED] atomic ====================== > [13:53:47] ============================================================ > [13:53:47] Testing complete. Passed: 2, Failed: 0, Crashed: 0, Skipped: 0, Errors: 0 > [13:53:47] Elapsed time: 13.902s total, 1.629s configuring, 9.331s building, 2.852s running > > It can be run on ARCH=x86_64 (and others) via: > $ ./tools/testing/kunit/kunit.py run --arch=x86_64 atomic > > The message about which platform the test ran on won't show up in > kunit.py, but still gets printed out in dmesg, e.g. > > TAP version 14 > > 1..1 > > # Subtest: atomic > > 1..2 > > ok 1 - test_atomic > > ok 2 - test_atomic64 > > # atomic: ran on x86-64 platform with CX8 and with SSE > > # atomic: pass:2 fail:0 skip:0 total:2 > > # Totals: pass:2 fail:0 skip:0 total:2 > > ok 1 - atomic > > Signed-off-by: Daniel Latypov I am also not an expert, but it looks good to me. Reviewed-by: Brendan Higgins