Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2864284rdb; Wed, 4 Oct 2023 14:02:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGEluRU6Say9DeIPES+bXhJV3fNwzxJVcC11n1fpw9tBervnlC8YYhRR1r4YKe5r2FAdvA X-Received: by 2002:a17:90b:4f8b:b0:267:eeee:ab17 with SMTP id qe11-20020a17090b4f8b00b00267eeeeab17mr3227217pjb.45.1696453372061; Wed, 04 Oct 2023 14:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696453372; cv=none; d=google.com; s=arc-20160816; b=PfVR0R1igpb9/jzsXKI0zNJ4fyqDZYJUZDiHUmlm4vDW3ZPZeY4X9bt1WETG9c1el3 M2C4UjxFx8R14PouEBZGKnvWDeRamo2Ri1EOnS01nxl+efYobuo5eIhxa4m9B+gN1QwI VeAYJlpKmCCNDyZ6pIgRHu1sr19DOWEDlYy0a7fvOewSIFSdsE3DzhDLsaOaNH3cgi14 9jU2M6Ojxh05rGIEhCUBRFo6oZ4rw2j6Hc6dM9Hx6VmRoL5FQpfqiQ9WLWemwQdA6bZG KxLg/VF6H+BPnpu57Nlrzx2xNDFKiyG7m39HiNhYb319K1v0Vx2nI0MN0ipa2HQUiZed +dYQ== 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:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=DRnzUT3DiFSeZdax6GSEDOPt9Ko6V8xM4p4KQTX8gQM=; fh=qmbJyFW8wgmy2Yfdilb1Hzdrf5ERlpkjykm26+5e+Ng=; b=L1tqz3yKgSjFcVilznUhcS/MJtwgm4cUZAu6JD/p4kFpe9ErV91l+2suEbiQE94c7k VEDZXH9iqWnjCzrcsUasZoa8/GcIKdfwvC7h+rPZiTfyQaAFnAzw4CMksHhTImW3niY+ Ozr5n8uh5JeP6bwvbqS6xJRLKHLn4XN7aMUyOkvxrj+zRp1fxklR0aK+AR72wtib1r37 UjEJpym+lt9EOojAn0mu3P5bhfkTvCDMUFmhjbEZBnPHD5K81j8mFJLCV5uVd2zRcnhu kF8TZZyaID94wk4MaV19MbkKomxNcSiqPlEEMcvqhTf45yNSKItt55OALs/uuTPnR0VV jw3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Jpz0IKEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f31-20020a17090a702200b0027762924984si2201521pjk.183.2023.10.04.14.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 14:02:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Jpz0IKEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 300878271740; Wed, 4 Oct 2023 14:02:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243899AbjJDVCi (ORCPT + 99 others); Wed, 4 Oct 2023 17:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243773AbjJDVCh (ORCPT ); Wed, 4 Oct 2023 17:02:37 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA069E for ; Wed, 4 Oct 2023 14:02:33 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-536ef8a7dcdso4216a12.0 for ; Wed, 04 Oct 2023 14:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696453352; x=1697058152; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DRnzUT3DiFSeZdax6GSEDOPt9Ko6V8xM4p4KQTX8gQM=; b=Jpz0IKEeD3EUQQPh8xSj9RBwF6HOOHeaoLnUjghiMo+9p4Jsb3wifiJit8zrz5Wxj9 I3TajWmBKu9/Py1rN/zoBWruxU8iqkxBhrUb0o3KyQAroBdEpNQ7hhzQUypqSr1XewtJ 04T1/bekDk0O/vvX+w+EoNwGbf3NtCxKeszscun9mF9b6RTqKZAPG6KeA3Zhaa70Ctv5 OsRpNShZcE/IPAUJ7c1jlezVQbtMCXBYxnxnTjmSww0db99ehKvqAvxdF+NBaQ/WR4So B0Pej4iN8sk4rcxt/ASQGvfngMjLonZaz4NfXjdaBYf0OHqvtuso9n8gn+OyOBn20F5u 0PFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696453352; x=1697058152; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DRnzUT3DiFSeZdax6GSEDOPt9Ko6V8xM4p4KQTX8gQM=; b=rhiPBeQv1OA1O5Net7fFecqbLwredO6WPwocsnmq+JneaN5m/JudtVmVQdg5Jqlcma 8foufgCe3IUHiIJIamYEMOdZ2hpkZG45LHBTiUxG0QQcHorH7rNJSFL3tyhK+xTxkJbA EZsb0Z0KEyrjwh9Hsyq4UnVHqRcSS2yXLgbz43A6IJsZ5qnXJUrmRpH8+YxYOZGorHr/ U54Yjr/m2ZpIU51fxHuoTQNVFYCzypwQLORQ/PC/E5OhAiZwUoVJkjj91fVNFClU4A40 BPXN2mOp0DabPkFnFaMapIKQATFQmheoSiGBmnRkCIB952+6Ecyo3kJ4Fc6zlg67vr5Z DsKQ== X-Gm-Message-State: AOJu0YxVJX8KriHh6ZhKTcrNIyp9FRER2rXYQYf0dJKk7pu7aXYQZgg5 uYyd/qdZjSK4rRSTPfte/UnyVBfft7fNBYf4bi0mmA== X-Received: by 2002:a50:c04a:0:b0:538:1d3b:172f with SMTP id u10-20020a50c04a000000b005381d3b172fmr5363edd.3.1696453351865; Wed, 04 Oct 2023 14:02:31 -0700 (PDT) MIME-Version: 1.0 References: <20230908213148.3610108-1-rmoar@google.com> <20230908213148.3610108-2-rmoar@google.com> In-Reply-To: From: Rae Moar Date: Wed, 4 Oct 2023 17:02:20 -0400 Message-ID: Subject: Re: [PATCH v2 2/2] Documentation: Add debugfs docs with run after boot To: David Gow Cc: shuah@kernel.org, dlatypov@google.com, brendan.higgins@linux.dev, sadiyakazi@google.com, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 14:02:41 -0700 (PDT) On Thu, Sep 14, 2023 at 5:06=E2=80=AFAM David Gow wro= te: > > On Sat, 9 Sept 2023 at 05:32, Rae Moar wrote: > > > > Expand the documentation on the KUnit debugfs filesystem on the > > run_manual.rst page. > > > > Add section describing how to access results using debugfs. > > > > Add section describing how to run tests after boot using debugfs. > > > > Signed-off-by: Rae Moar > > Co-developed-by: Sadiya Kazi > > Signed-off-by: Sadiya Kazi > > --- > > Looks good to me, a few nitpicks, and the fact that we'll probably > need to add something about init section suites when those are > implemented. > > (Also, since you sent the email, your sign off should be at the bottom > of the list above.) Hello! Thanks for the comments! Sorry about the Signed-off order. I will change that for next time. > > > Documentation/dev-tools/kunit/run_manual.rst | 45 ++++++++++++++++++-- > > 1 file changed, 41 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/dev-tools/kunit/run_manual.rst b/Documentati= on/dev-tools/kunit/run_manual.rst > > index e7b46421f247..613385c5ba5b 100644 > > --- a/Documentation/dev-tools/kunit/run_manual.rst > > +++ b/Documentation/dev-tools/kunit/run_manual.rst > > @@ -49,9 +49,46 @@ loaded. > > > > The results will appear in TAP format in ``dmesg``. > > > > +debugfs > > +=3D=3D=3D=3D=3D=3D=3D > > + > > +``debugfs`` is a file system that enables user interaction with the fi= les to > > +make kernel information available to user space. A user can interact w= ith > > +the debugfs filesystem using a variety of file operations, such as ope= n, > > +read, and write. > > + > > +By default, only the root user has access to the debugfs directory. > > These two paragraphs are probably a bit excessive: we want to focus on > what KUnit can do with debugfs, not describing what debugfs is as a > whole (which is best left to pages like > Documentation/filesystems/debugfs.rst ) Got it. Maybe I should just leave the first sentence and then link to ../debugfs.rst. > > > + > > +If ``CONFIG_KUNIT_DEBUGFS`` is enabled, you can use KUnit debugfs > > +filesystem to perform the following actions. > > + > > +Retrieve Test Results > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > + > > +You can use debugfs to retrieve KUnit test results. The test results a= re > > +accessible from the debugfs filesystem in the following read-only file= : > > + > > +.. code-block :: bash > > + > > + /sys/kernel/debug/kunit//results > > + > > +The test results are available in KTAP format. > > We _could_ mention that this is a separate KTAP document (i.e., the > numbering starts at 1), though it may be obvious. > > > + > > +Run Tests After Kernel Has Booted > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > + > > +You can use the debugfs filesystem to trigger built-in tests to run af= ter > > +boot. To run the test suite, you can use the following command to writ= e to > > +the ``/sys/kernel/debug/kunit//run`` file: > > + > > +.. code-block :: bash > > + > > + echo "any string" > /sys/kernel/debugfs/kunit//run > > + > > +As a result, the test suite runs and the results are printed to the ke= rnel > > +log. > > + > > .. note :: > > > > - If ``CONFIG_KUNIT_DEBUGFS`` is enabled, KUnit test results will > > - be accessible from the ``debugfs`` filesystem (if mounted). > > - They will be in ``/sys/kernel/debug/kunit//results`= `, in > > - TAP format. > > + The contents written to the debugfs file > > + ``/sys/kernel/debug/kunit//run`` are not saved. > > This is possibly a bit obvious. Maybe it'd be more useful with a bit > more context, e.g., "The contents written to the file ... are > discarded; it is the act of writing which triggers the test, not the > specific contents written."? I will try to add more context here in the next version. > > It might be worth having a note that tests cannot run concurrently, so > this may block or fail. > > Equally, it may be worth having a note for test authors, that their > tests will need to correctly initialise and/or clean up any data, so > the test runs correctly a second time. > Yes these are two good points. I will add notes on tests not being able to run concurrently, cleaning up data, and also init tests. > > > -- > > 2.42.0.283.g2d96d420d3-goog > >