Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1532920rwb; Thu, 15 Dec 2022 11:12:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hXcAu6OTbpspDJv68bpKAiPK8tUo9kGK1ZvkKVxcvTe0nW8NoTUv8O0U62ZwSBhG+VV60 X-Received: by 2002:a05:6402:3895:b0:462:7b85:33aa with SMTP id fd21-20020a056402389500b004627b8533aamr23988243edb.2.1671131575013; Thu, 15 Dec 2022 11:12:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671131574; cv=none; d=google.com; s=arc-20160816; b=Z1QqdHFajUH/U/13Msfe4abUff5UKgazJ2ydNCIkQGvKjiZFTnJASKr+7NSau6Nhea n4qMv9pH1bCHGArd+/7PELOv0aRKLjZzki7KjOjzNVHICZOiA6bnRRMjRsKfVu36cOoP FX23drw/fooVYVoOFVx3073olpEtlQaPk84ro6zfMi2teBDtobSOQoB7ySFYSaJy8DZy 3Y5ywUNVrhYCoM21drEpVmvtiXQFW0I2JJuvUuimcR9zyCKv7oI/czjyfz3PTTjaL2fz DO5vRlMnTqTb9ffmH8dNiESZWaphXW0g6Wmw7DgGgnGEaFkHRL+VrQywfLZMc13ntN3+ glMA== 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=+2yoWKUdi8Gixa0ECv6JehIbofin/LQeXYv9L9TZ4S8=; b=y0PhOEiy7PNNa1lolSOs7EjaQFwh0BsIxuX1uiclePbUUxylKhPleJ1h1RW9FD4fHO I0mr2630y1vVoe9h+sprA4fBJJBCqNdXDP6sZB9KLajcGzTqdqhnlEwF//ZpTU8OrN2n gXWkfc4oKtJyXI4q3ETbEnVdwKYkMW9UNFo4KvEXL1wKw41y0nMV++e+F7M5htViGcm/ ms1SeerZ6YDBOAgK1D65GHHM4nGKKLNv+7UC25g5Bh7w77nX3blo6/tf62dDJpjQAbqT YXgNNhuz5XZKlUwfH8vb2l6GPClw0utGprx3ZduEWeBK8sojlTmJptcTiyg9G9OuGhvE 0bcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PBbDJFPA; 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 y17-20020a056402271100b0044f2eb2de9asi63028edd.444.2022.12.15.11.12.39; Thu, 15 Dec 2022 11:12: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=PBbDJFPA; 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 S229895AbiLOTBQ (ORCPT + 68 others); Thu, 15 Dec 2022 14:01:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiLOTBO (ORCPT ); Thu, 15 Dec 2022 14:01:14 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 165D314099 for ; Thu, 15 Dec 2022 11:01:14 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id 124so278608pfy.0 for ; Thu, 15 Dec 2022 11:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+2yoWKUdi8Gixa0ECv6JehIbofin/LQeXYv9L9TZ4S8=; b=PBbDJFPADcRfessRbJP5OnkMHouy75YkhMGgTLTXyDtiQ3uOWmZLQkU/n/EJgM630q y8I/gzzgXwn/Qlxe4rFEiQpy21l9B69Ei0Cx3WoLYwNi8hQriXSHAcpW7fT++aeBl+rq VIHf17QHGd4HPTbgFHQj4RZxcMDGr7UnRPXdruWwVxufbJHRyY43LDDRQ5fsxWgmgdUL szyh+pT8uHeNkALMZET6VkZaYf5IQmMK+/KaBO/UyudEasUKm7RbAgL6u8eLUt4QyufQ SZoC81/uXWDOiVFs80K8hgE7s+Pr1+xhxQDV4cziH9hhB/kFBNu0Xy6BJB7lhEBwiY8f aP4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=+2yoWKUdi8Gixa0ECv6JehIbofin/LQeXYv9L9TZ4S8=; b=B3KsuAW+Fwh2A8lC0U2gJ2wGQIVMHk9VD6cmTm0iUCyXu4rUft59CH4F3cWmvkM0mF 889gPcPLCPN/QRSrVMxT3/7NaNfbApxdT+h56f8OXRCsWccNRonSKGu+eE7HBV0Hh53x /3mYmvUTzQ7+0eAoxq891M6FnW7xCKEN2GFXPULkVexWbxSOR17XlXk29xSA+GEUQooC Iyj6iiHQ7ywgR4dbmg7gfx0D17swtJ5b6Uaojw94J2lifAaBsmJEOWFc2ILeXsZtYGsE shCYhVfn/F+EPQDVphR+8i146Ag5nd2WCU9bOw8w7uTPhh2RBOrSmo1uK/qBObtmKI9W ky5w== X-Gm-Message-State: ANoB5pmrwUXinpL3/S3sbmsABET06dL0yOh+FFVc4r6zYvGqvyJk6Q6m KInz8XqOvCq9Y6WDMR8y7n6UYcGaKdPLyiZy0oNMEA== X-Received: by 2002:a63:592:0:b0:478:ab04:f293 with SMTP id 140-20020a630592000000b00478ab04f293mr20331351pgf.345.1671130873339; Thu, 15 Dec 2022 11:01:13 -0800 (PST) MIME-Version: 1.0 References: <20221208061841.2186447-1-davidgow@google.com> <20221208061841.2186447-3-davidgow@google.com> In-Reply-To: From: Daniel Latypov Date: Thu, 15 Dec 2022 11:01:02 -0800 Message-ID: Subject: Re: [PATCH 2/2] Documentation: Add Function Redirection API docs To: Bagas Sanjaya Cc: David Gow , Brendan Higgins , Shuah Khan , Kees Cook , Sadiya Kazi , Steven Rostedt , Joe Fradley , Steve Muckle , Jonathan Corbet , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org 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, 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 Thu, Dec 8, 2022 at 2:07 AM Bagas Sanjaya wrote: > > On Thu, Dec 08, 2022 at 02:18:41PM +0800, David Gow wrote: > > From: Sadiya Kazi > > > > Added a new page (functionredirection.rst) that describes the Function > > Redirection (static stubbing) API. This page will be expanded if we add, > > for example, ftrace-based stubbing. > > s/Added/Add > > > diff --git a/Documentation/dev-tools/kunit/api/functionredirection.rst b/Documentation/dev-tools/kunit/api/functionredirection.rst > > new file mode 100644 > > index 000000000000..fc7644dfea65 > > --- /dev/null > > +++ b/Documentation/dev-tools/kunit/api/functionredirection.rst > > @@ -0,0 +1,162 @@ > > +.. SPDX-License-Identifier: GPL-2.0 > > + > > +======================== > > +Function Redirection API > > +======================== > > + > > +Overview > > +======== > > + > > +When writing unit tests, it's important to be able to isolate the code being > > +tested from other parts of the kernel. This ensures the reliability of the test > > +(it won't be affected by external factors), reduces dependencies on specific > > +hardware or config options (making the test easier to run), and protects the > > +stability of the rest of the system (making it less likely for test-specific > > +state to interfere with the rest of the system). > > Test reliability is test independence, right? Just my 2c, but I'd disagree. E.g. a test can depend on CONFIG_FOO being built-in, even though it doesn't really need it. Having an extra kconfig dependency doesn't necessarily make the test less reliable. You could define "test independence" wrt shared runtime state (e.g. multiple tests touching the same global var), but this text specifically says "hardware or config options." Daniel