Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp26800rwl; Wed, 9 Aug 2023 10:20:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyKX5WAKln0W4AKpElEhtcy5ezZdu5+WL5m1JipQPVwF6SKlsFhIVn+3FToSZrSTSQXj/s X-Received: by 2002:a05:6402:38e:b0:522:21a1:5153 with SMTP id o14-20020a056402038e00b0052221a15153mr2959317edv.11.1691601637409; Wed, 09 Aug 2023 10:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601637; cv=none; d=google.com; s=arc-20160816; b=SVeNkdjp5cW1D5dHQ4iEBdfJFw0ckybKQ2yRKlwiMZLJpr9QworQELnzZc4c4sx4I9 0QMq1Xpqwv9yLDkurp/djH4wUfX04y5mY3Qxvv0h1zXdhbH/TEptlA98YTMDVmQ5uHce kkPcmjk8vB1r8VFrSn4jG95UStlnDjjjDaEr4btFkKoudufA8it/L4ja3y4+jIi5zTku Wr+pLslFRoQuvQsc0cK3bAYa4l0qclrMgaU7vhKUn6ZeRbnl8XW7r6MrWGO7PdZg27M/ Ci/VuLstSVOiF2cONR4XPVdBsR1VdoRNsF9m2zmEDqKlDFJVkrIP0AFKrwC2VfHR27q7 ml8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZkHLOZxL/zUPQBtzRZ/2aFe1CQ5Jd2Dy1yhV/zJ7Hmc=; fh=bGF4ESczbIrmrNxFOdEMfzJNgTVkRsqDRt+LRN0CeSg=; b=HyBBJ0DOT6cCerzZEP9Ug9xfOrXUf3bxJDKwI1hfupqzFABYJ1huQguZ4zwGpC51cR n9uRwhqUZGroTTbg7RB8EfiQxhSD4KEzG6c7pJKI0m0Z6bltF2yxy5GzRvESk8vVzvPZ HWFKmd8cHNWFU9qiNGuaa0+Pd3bcrEO9+Q00Ihh4yV+j4Iq4qzUzujV0xsNogjNDshoO iHEywdPH9sOMQT+L9AxyjlTYFjQIahTt2PgKngilWmbkbc/ErpBQRNLRjx/Bvuwro2iz tCaGd8MR84REs4XF1crYkkUwYtLv3gtreQOgnEHgYwzU6knNkxiYLDywspJ1S/Peptek fSVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Q6HJWnFn; 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=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020aa7dc0e000000b005231e0afe80si9234965edu.567.2023.08.09.10.20.12; Wed, 09 Aug 2023 10:20:37 -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=@cirrus.com header.s=PODMain02222019 header.b=Q6HJWnFn; 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=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233719AbjHIPy6 (ORCPT + 99 others); Wed, 9 Aug 2023 11:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbjHIPy5 (ORCPT ); Wed, 9 Aug 2023 11:54:57 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8A01729; Wed, 9 Aug 2023 08:54:56 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 379EvsGJ002928; Wed, 9 Aug 2023 10:54:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=Z kHLOZxL/zUPQBtzRZ/2aFe1CQ5Jd2Dy1yhV/zJ7Hmc=; b=Q6HJWnFnruMMnKLJR yKwQKMR8mw+7hlCHMyfisCNTz3Ixfrfx2DRbqbrNx9pP96OzPK2GCZ41D3HhKF1J SY0yjnrBH4xXH7PPikPOltTqfxMM/3VWjLC8Vitsxwf42+Iz0spOaDT96GOLkELp 19C0kXeHQiDr8RNz5ihtRWKuNcxi+a/LWRrqr6p2Ej4Qrssvh1/zzeGm3WOzY+me P83ocp8eoMHXstRzox2sJzPOC76+1KgwP9SmXT6hep9YR+nwkMyeY6uyvWC+sPzG WoJRz8WvBCwMmyOfzoBy377zf8YH36glV6vsycjL2vbrk9l7bqThgcweFOtiQCNZ WPlDw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3s9juhuvg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 10:54:47 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 9 Aug 2023 16:54:45 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.30 via Frontend Transport; Wed, 9 Aug 2023 16:54:45 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.64.220]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2DFEA45D; Wed, 9 Aug 2023 15:54:45 +0000 (UTC) From: Richard Fitzgerald To: , , CC: , , , , Richard Fitzgerald Subject: [PATCH v3 0/7] kunit: Add dynamically-extending log Date: Wed, 9 Aug 2023 16:54:31 +0100 Message-ID: <20230809155438.22470-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: UHPPCzpg6K0WlTYlIn4MYqd5wjRRPUcl X-Proofpoint-ORIG-GUID: UHPPCzpg6K0WlTYlIn4MYqd5wjRRPUcl X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 Replace the original fixed-size log buffer with a dynamically- extending log. Patch 1 provides the basic implementation. The following patches add test cases, support for logging long strings, and an optimization to the string formatting that is now more thoroughly testable. Changes since v2: - Fixed uninitialized string bug in get_concatenated_log(). - Moved get_concatenated_log() into first patch so that kunit_log_newline_test() dumps the entire log on error. - Moved kunit_log_frag_sized_line_test() to the correct point in the chain, after the change that it depends on. Also log another line after the long line to test that the log extends correctly. - Added kunit_log_init_frag_test() to test kunit_init_log_frag() instead of testing it as part of every other test. Richard Fitzgerald (7): kunit: Replace fixed-size log with dynamically-extending buffer kunit: kunit-test: Add test cases for extending log buffer kunit: Handle logging of lines longer than the fragment buffer size kunit: kunit-test: Test logging a line that exactly fills a fragment kunit: kunit-test: Add test cases for logging very long lines kunit: kunit-test: Add test of logging only a newline kunit: Don't waste first attempt to format string in kunit_log_append() include/kunit/test.h | 25 ++- lib/kunit/debugfs.c | 65 ++++++-- lib/kunit/kunit-test.c | 339 ++++++++++++++++++++++++++++++++++++++++- lib/kunit/test.c | 127 ++++++++++++--- 4 files changed, 507 insertions(+), 49 deletions(-) -- 2.30.2