From patchwork Tue Jan 31 22:03:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rae Moar X-Patchwork-Id: 4779 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp57256wrn; Tue, 31 Jan 2023 14:05:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXsIH+qw5dKpCD7+BwEz388AbO2Q0aJ9RI/vqiM1rEntbZsN11RpcFmuVvGalGiZOGe15puU X-Received: by 2002:a17:906:608d:b0:872:a2ee:271d with SMTP id t13-20020a170906608d00b00872a2ee271dmr52160935ejj.53.1675202754450; Tue, 31 Jan 2023 14:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675202754; cv=none; d=google.com; s=arc-20160816; b=EqQGU4THSARMoLioJTvZX1oZuRV9Wae5eOELSZZwNSNBrTGDlR9fu28ULE08ZVSzNC iXZkhkjcwUzsSaytcFuZr8Mx687kxicr9YRXoLpsO9+4drITArumJ9sVDJdBjezW/9W1 euJgvp2bnYL9zR9VlYw5htYpqyQraQrNn0JB1SMF2ri8FQh/4v4HKTN0Iz8yeAzP8Qre eWymQcHq26tVVM1Vi7rC5MgGUrV5KVyA+/HRyjk5+r2ptqS3uSTrLyzhLFmIOJGbIBu4 ffyi40MjS7FxwcRJwysEM5I6g/wVl/L1l4wu8sR4dX8BhiNjXrAuamN8ZEuHrXH+RF3b 956g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :message-id:mime-version:date:dkim-signature; bh=4bj6yFI+Jqx4F9WsIXvREu+uXXbdhQ0Fh4KScDr1Gho=; b=vWVd2fylCdD2qa5aEZ/pMcz9HSxo4zFppBrLF60hvtJvO4l2yMai/SJoqTOdVuVIN3 OUXuvJs9okxwK4LmXEaOKoF6NsssVtp+xO7v0gqZ7dwbAOpvyxIQGiyN7mEuHHNdzF0y lvLkD/7ozgQiEWlBUKidDMAl4GS5wUQXGO18IhlpsxtmLqSImnfHa8jWxM4e3TeYyP9e etmmSMqGJ4+AXF85SAoSkT1jIljK/wxR6Q7QZw7XbuHDLVUkqdD5RWGTZoRhIXhPWOKp /HJc5dkYfow4+l1wnnI40pZ2QeiGsd5oRu7BPKLMbQ/+UCVwVU65BYVpP86eaRgsSa18 RsRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Yn/DMYr0"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a056402514400b004a3372f07bdsi289299edd.400.2023.01.31.14.05.30; Tue, 31 Jan 2023 14:05:54 -0800 (PST) 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="Yn/DMYr0"; 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 S230273AbjAaWEI (ORCPT + 99 others); Tue, 31 Jan 2023 17:04:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbjAaWEE (ORCPT ); Tue, 31 Jan 2023 17:04:04 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62A55A374 for ; Tue, 31 Jan 2023 14:04:03 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5065604854eso181990347b3.16 for ; Tue, 31 Jan 2023 14:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=4bj6yFI+Jqx4F9WsIXvREu+uXXbdhQ0Fh4KScDr1Gho=; b=Yn/DMYr0HkaQ+d4cI8Uskhlb1rSHfk1uMJTU4naMoFOq8V1QZB1QaxZX9tgOfeOdjs 0BvNC169zVEnGQ+AHmX3Ae62I88wPw0i9y3l6TDy1wbEqz/BssqbIrHUUbbHyBtCpfCJ TgzwaXHphlxJHfqf3JraFV4m8u46E5aOyFuvLpGwXQC8TLAyzD/Cn3LDpzNPkTMQ31kH geknPk+VEX4D5BJqPN2ixvifi+ARrf+mx8QwECDx2e+egyI8CbkFxyOlzuEHzcFDZRez MAwIuA0k6FyhScbS4Ge6pKaddUXaey3ZXHTeu9rYhLqlZv/ZI2iNfqaITEWyyfKHcO39 jDcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4bj6yFI+Jqx4F9WsIXvREu+uXXbdhQ0Fh4KScDr1Gho=; b=TugnxC0GaUHKBTiOCw0fngKpg+1QSY6brUgxmZGWatWyVAZOJJtjKlJvmHQbCMobKJ XaUDiQr6IF/Eu2n9/LLOuic+ZK0uLpa9zuFk1I2x3/a8RlfdsPGl0uwZxJSKxAaMgnbg QwTcC6AxoelUHgBhFDETlji4diau6WKY1CmNC3flQYLLm5W/6DMEaCpctW8xWElIhP11 RV6r8FwxTwIhSEN9GjbagyXJYMmXa9p2CDgB7Q81If4zmPB9MY7NC4eujHcBj6EfNJPK sL3XadDomr0fM8n/Z3jcrkoYTXu1wKQqrQXtJz76DJrLcnapKl+hEhw7lyzWMckLZJo5 Bj5Q== X-Gm-Message-State: AO0yUKUO4M/HImrF1wfNhSrxcFW/Yz+OaQ0+TeaabxDYuW/5eh1IoEf1 t65FKqhlcTU+DE9eDkGgy0HSO0zfMQ== X-Received: from rmoar-specialist.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:45d3]) (user=rmoar job=sendgmr) by 2002:a25:6cc4:0:b0:7d4:93ff:959e with SMTP id h187-20020a256cc4000000b007d493ff959emr56101ybc.45.1675202643190; Tue, 31 Jan 2023 14:04:03 -0800 (PST) Date: Tue, 31 Jan 2023 22:03:52 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog Message-ID: <20230131220355.1603527-1-rmoar@google.com> Subject: [PATCH v1 0/3] kunit: fix bugs in debugfs logs From: Rae Moar To: brendanhiggins@google.com, davidgow@google.com, dlatypov@google.com Cc: skhan@linuxfoundation.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Rae Moar X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756577403555003603?= X-GMAIL-MSGID: =?utf-8?q?1756577403555003603?= Currently, the KUnit debugfs logs have a few issues: 1. The results of parameterized tests don’t show up 2. The order of the lines in the logs is sometimes incorrect 3. There are extra new lines in the logs This patch series aims to fix these issues. This is an example of a debugfs log prior to these fixes: KTAP version 1 # Subtest: kunit_status 1..2 # kunit_status: pass:2 fail:0 skip:0 total:2 # Totals: pass:2 fail:0 skip:0 total:2 ok 1 kunit_status_set_failure_test ok 2 kunit_status_mark_skipped_test ok 1 kunit_status Note there is an extra line and a few of the lines are out of order. This is the same debugfs log after the fixes: KTAP version 1 # Subtest: kunit_status 1..2 ok 1 kunit_status_set_failure_test ok 2 kunit_status_mark_skipped_test # kunit_status: pass:2 fail:0 skip:0 total:2 # Totals: pass:2 fail:0 skip:0 total:2 ok 4 kunit_status This is now equivalent to the regular KTAP output for the kunit_status test. Thanks! -Rae Rae Moar (3): kunit: fix bug in debugfs logs of parameterized tests kunit: fix bug in the order of lines in debugfs logs kunit: fix bug of extra newline characters in debugfs logs include/kunit/test.h | 2 +- lib/kunit/debugfs.c | 13 ++++++++----- lib/kunit/kunit-test.c | 36 ++++++++++++++++++++++++------------ lib/kunit/test.c | 36 ++++++++++++++++++++++-------------- 4 files changed, 55 insertions(+), 32 deletions(-) base-commit: 766f4f2514d2d18bcbd60a058188fb502dea5ddf