Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2089683pxb; Fri, 25 Mar 2022 10:54:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCdz8imRHkNtK3ebcvPXcIp73UAJ5IkPE+YfqNR1x0cRpqTQSujLkdgs0wof9ND/mgCfog X-Received: by 2002:a63:cf49:0:b0:380:f8fd:51fc with SMTP id b9-20020a63cf49000000b00380f8fd51fcmr552694pgj.609.1648230867558; Fri, 25 Mar 2022 10:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648230867; cv=none; d=google.com; s=arc-20160816; b=aFuP0liXVys4zwtdkCIjS53slISYKHL7Ob8xYCzOPRiequ5m2Kk2Tk7NV30RXng/b+ gr/HVu+D3TriyAptWpEwvJjY+LMGMLik4YD/YbSylO956+iYKZqD7tixg/gEqHmpi9o+ cWTKj97ffju18ZEOupt3LMDPxT0lyHKIUVh9/n9P+GYt/NSaRKyFfCPYWhpGO375tiS6 0DMPrdXtg7O5ao8WmseYWuEXMop9s8HFc7CjrqAk409cgsffGzjLcECSFOsr/1uqXhYI k4/ZSYiFhED4/uDHyzCfnZamJwME5eyJAU6xuGqqbBuitH0ZLS7JgGxKs8/CF5HP7nXD /zag== 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=y7wMnxNk+tFQvni2rBWt4t7AH2KkYUciRkPUXBc+4o4=; b=bVvYILCEqxP5V03pIvarA4xFvqIYlzvA8F5c35eydtuTPOVLjaMzMupX7h9BtjMqjD 0Ynx8/l5DiTyNIvjwgDLjChF3dyc+dm/2lhWxsA6v7CvBPlIYkmAkLdpuuoNSgzs5fzD hwTTpFXFOjuCqVZSKlytHPF39D7W8bLqr915aN5O9g6q4HJZ9f/wEjIx5rpnXuKs5pzH 8GTEcecBY9Dig2emUjheUpo074Sw3aTmfv7DK19iIu3lUFfW6wNjvNrVQteBmd+i3srI /wl15PHUwPLTZtEJY3rixgvR4VXJeKW0JaNmT+wEjQHOtFMKC45udFwLv1bOAMGHbFA5 gr1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=f9A+eMl7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v5-20020a655685000000b003816043eec9si2931290pgs.190.2022.03.25.10.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:54:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=f9A+eMl7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 702EAA5EA7; Fri, 25 Mar 2022 10:34:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349669AbiCYAKY (ORCPT + 99 others); Thu, 24 Mar 2022 20:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357050AbiCYAKU (ORCPT ); Thu, 24 Mar 2022 20:10:20 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C6541EAD9 for ; Thu, 24 Mar 2022 17:08:46 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id pv16so12396147ejb.0 for ; Thu, 24 Mar 2022 17:08:46 -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=y7wMnxNk+tFQvni2rBWt4t7AH2KkYUciRkPUXBc+4o4=; b=f9A+eMl7EIu4/AUZVRTIHt1/Jclk2w65EZD4M1fVInUFYkMY62B9XCbYLOQ9lelSOq WX6/E9XvZjmW9v+So29/74XblXh0K+g9/0bgaA3jGgXqvFZPmi+MZR6QFoUSR0cpuIOH YCpEtVljNca9GODUpUNJpxT8LtBZOXCG716+ML1A+1gHLTC/otq8ajFrX9uAaUD1dPBK gzlULoVQgRZ1IEHRJ+vihgFeKF4meKGqHI3L1JlDijLbOlo5E3ecMydLHUGbBIYKXzXH kbqZq7c/SwJr0HudXd/ooG8Prjs8LX0IXbAXTLZ7K3iKxIh4jpOmx23DM6ZnnHdr6J1a FMSw== 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=y7wMnxNk+tFQvni2rBWt4t7AH2KkYUciRkPUXBc+4o4=; b=Ifca3UrRTAh20zSedefAJCTN2194nGD4mFyXtIE0uLyuVZcybhyJggaDMUNbpgX+18 Xn+shCflirE14hdlKL9N+RGiDxu1Q4QGl7CoP8ROD8YPElm34vXQWCNUZ+pL5chOkx7K WosgbvnU+5WLfS/lhXl97ZwP2xCghuKM7mm+dEGEQXEIqlMjqCNVVS5dP0T9ZEb4/EV5 NnTboqxxDUaybagzGA6P/r+BcpXILC6cJuGTVVpiqAhPocowT1U1JXkDXbeMyCkmwyHG aDPvTzezYUi3/xWygm3ertBqVaFewSpOu7rnzemYTOP2J2AsWhPzjmdyrF9EUX553Tuc gU1A== X-Gm-Message-State: AOAM533frihmJmJqL8EUs3pA2bVg5Na1yR+vTSUrFAadlRgCFtObEefQ SlOeKNNWDXYQe91g/UgKg4Dxnn3887uSqdQwEPVgjg== X-Received: by 2002:a17:906:c282:b0:6ce:369d:3d5 with SMTP id r2-20020a170906c28200b006ce369d03d5mr8781565ejz.425.1648166924426; Thu, 24 Mar 2022 17:08:44 -0700 (PDT) MIME-Version: 1.0 References: <20220316024432.1454366-1-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Thu, 24 Mar 2022 19:08:33 -0500 Message-ID: Subject: Re: [PATCH] kunit: split resource API from test.h into new resource.h To: Brendan Higgins Cc: David Gow , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Wed, Mar 23, 2022 at 6:51 PM Brendan Higgins wrote: > > Another alternative workaround is to split even more stuff out into > other header files. > > Personally I would prefer not to wrap the lock/unlock functions; I > like seeing the kind of locking that's happening. Plus, such a helper > would be pretty gross: > > void kunit_lock(struct kunit *test, unsigned long* flags) {...} That's exactly why I didn't bother to try and wrap it, yeah. > > It wouldn't actually clean up the call site, just facilitate breaking > out code into a header. > > > > making users include this separately is probably the right thing to > > > do, as nesting the headers like this is a bit ugly, but I won't lose > > > sleep over leaving it till later. > > > > Ack, I can add a TODO to indicate we want to clean this up? > > I am fine with this. To clarify, are you saying you're fine w/ the nested header as-is, or fine with it + a TODO? > > > It's a bit annoying right now, but it'll only get more annoying in the future. > > > > > > > > > > > > > Now the first big comment in test.h is about kunit_case, which is a lot > > > > more relevant to what a new user wants to know. > > > > > > > > A side effect of this is git blame won't properly track history by > > > > default, users need to run > > > > $ git blame -L ,1 -C17 include/kunit/resource.h > > > > > > This is a pain, but is probably worth it. Thanks for including the > > > command in the commit message, which should mitigate it slightly. > > > > > > > > > > > Signed-off-by: Daniel Latypov > > > > --- > > > > > > This was starting to annoy me, too, as it was a pain to read through > > > everything in test.h. It'll be a bit of short-term pain, > > > merge-conflict wise if we have other changes to the resource system > > > (which I fear is likely), but is worth it. > > > > > > Reviewed-by: David Gow > > > > > > -- David > > > > > > > > > > > NOTE: this file doesn't split out code from test.c to a new resource.c > > > > file. > > > > I'm primarily concerned with users trying to read the headers, so I > > > > didn't think messing up git blame (w/ default settings) was worth it. > > > > But I can make that change if it feels appropriate (it might also be > > > > messier). > > > > > > Personally, I think it's probably worth splitting this out as well. > > > And the sooner we do it, the less history we'll obscure. :-) > > > > Yeah, that was my thought. > > But if you think this would help users, then I think we have a case to > > make this change. > > > > Should I send a v2 with resource.c split out? > > Brendan (and any others who have an opinion), what's your preference? > > I personally don't think test.c is so huge that it is a problem to > understand, but I can see it getting there. > > If it's going to happen, sooner is probably better. Ack. I can work on adding a second patch on to this series that splits out resource.c? That causes more churn for the other in-flight patches, but we already have some since David has some changes in test.h.