Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp542450ybv; Wed, 5 Feb 2020 09:59:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzAVl8SlhSAL0pyJ3DfCT9xUGGL0sOZX5WDEr/aPR27z6a2LCGKZ0lw13mzs2/SRDjOHMeG X-Received: by 2002:a9d:7b50:: with SMTP id f16mr27225283oto.18.1580925582186; Wed, 05 Feb 2020 09:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580925582; cv=none; d=google.com; s=arc-20160816; b=Qs4CNwPu+iCQEvpChxvgABnSEXqA6JgSBwcvBxS2MXE27WnwV29mUhIJrHlD2ea0FZ TTqiO0GOFrejZ+PCYviXUnrU12URjFlSuR1+1zJl6L415/Gon91wWXbApzHV0fjuT3z8 8DbUynE7rsKqbiI+6wYg9rwmRoM3XFTncgAODMOuo1A+q+qBUYj5jklNBnqYq7fI4SrP VQ1NoWoLHq7PgRgoQRd7mkqac6Dl/Jx55S2R5DsR952QuHjmyU89/kmKvgsOP/TTkfA1 MXnTmvmQZ9ZvYBKRVRtc30uvhc8KbAVswd0269Qig0zHBjGti+dzH79FaXNlVtM8NvUk rZMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fJvZ+LESdZtd5WGeTnbWB5+DEtp+eP7zYdHNLW4NGgw=; b=A4UCIgcxvQ3r3kEcf1psoZ4Av+yzjIuvFgnS+ds1F6H1s5Nt0w+AyWW2sBBMxIb1+F zjTpTkvCPBk0fldexBjROhO/aOVyu0gu40C7uLRwj394qUfr2m+SLjeMVGpGnpHgxLqI VVTq2lhgL9HeYr1SEVCPS2Oj2lQlce9oIjfe6y5+mZm4cZfnvDTJPhrxucBNhBXsP/Rs JXRta9ea8iAgqNtNPcN2cFumgCwT5fdAg5tEfOYQNghNLj3IKzC6pGUCXvt3ZaUAs2yv T8HodoCnZzYM+d65RbgDKbgTAzFzsHRSKfxUpB9m3OKVVBgpKYHIH6DsEGEd+iXMmSNM gu3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hF6ZtELc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si117351otp.230.2020.02.05.09.59.29; Wed, 05 Feb 2020 09:59:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hF6ZtELc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727282AbgBER6j (ORCPT + 99 others); Wed, 5 Feb 2020 12:58:39 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33156 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727052AbgBER6j (ORCPT ); Wed, 5 Feb 2020 12:58:39 -0500 Received: by mail-wr1-f65.google.com with SMTP id u6so3902023wrt.0 for ; Wed, 05 Feb 2020 09:58:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fJvZ+LESdZtd5WGeTnbWB5+DEtp+eP7zYdHNLW4NGgw=; b=hF6ZtELcfVJ5Was2i3jUYVdbVhGlpsIdk7OQDTWzsSp+OxfC+NMNb4lFErpdSM589m AambAQRybraD8+auTE49pcp7s9Kndskbd4cZO/8bhBAgeofqGbVPf3U5YmcIL46d3xf3 7rZF/Wp1aoZ3bmzK4+YqSuqVQj+myTGar5Old7WPMLZJGifN6D/mgyHGE0ZMaiEV4XMk Ukc5TmMAD/wOD+3MKf5KLCkQvDXilM8YxFNqKEtEHJ+yQlevFWo2wcfwsbAACAxdjhJB CbS451mst3RHRuyAPxvNGExC7mEX2QBDbZmqejgCgk73JbRdGWy31j0ptdR1hOCEUJm8 HU4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fJvZ+LESdZtd5WGeTnbWB5+DEtp+eP7zYdHNLW4NGgw=; b=OtnhbRKR3DsgVvzJ8xsaPMMZkfxLG2xRrJ7yMRNwGOmidWLnBD+4ZRb4fzSgP9GgE6 K7yNnEU6iuyhKFHWtR07k04Ezw5ZXEsnU9R7cbJY8P5oCNIlm9ZR8anXWa6LxreoTBgO 3c3TAA7HDxKS4P2H8RoQgHh+6zFQpus6hrJMIuF+H/UI3KJ0AsRiofCOjR6VsGvdfyku CK19FLx+VBMK+abI/m98UUgqQmaR3TNUbw3t8OJsj/OmOySscrhvH0uduAgbRHVxnxpp vRE4ORETYTdxr2TRAiydXew1AaowZxAFSlycXyAvGFvlMST6yiOYDeFCj9trDsqZhO+3 kIpw== X-Gm-Message-State: APjAAAW4LXnDtLVzb5UM1A4mk/mLtMYOApCD+1/pPU2b4JYjnAl8Scx9 3WJy4PhtRhvT73yDEsk3igYK1G7+8rL6XNTqhXUBsA== X-Received: by 2002:adf:ef4c:: with SMTP id c12mr30274271wrp.203.1580925516197; Wed, 05 Feb 2020 09:58:36 -0800 (PST) MIME-Version: 1.0 References: <20200205021428.8007-1-sj38.park@gmail.com> In-Reply-To: <20200205021428.8007-1-sj38.park@gmail.com> From: David Gow Date: Wed, 5 Feb 2020 09:58:23 -0800 Message-ID: Subject: Re: Re: Re: [PATCH] kunit/kunit_kernel: Rebuild .config if .kunitconfig is modified To: SeongJae Park Cc: Brendan Higgins , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , SeongJae Park , "Theodore Ts'o" , Bjorn Helgaas Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One thing we'd like to do with kunit_tool is to make its functionality a bit more independent: in particular, allowing the configuration, running the kernel, and parsing the results to be done independently. If that's the case, it may make sense for "kunit.py run" or similar to not do anything with the .config, and to relegate that to a separate "configuration" step, which would allow someone to modify the configuration themselves (e.g., using make menuconfig) and re-run the tests, but also allow the config to be explicitly regenerated when helpful. Exactly what that'd end up looking like (and to what extent we'd still want to support a single command that'd do both) are still up in the air: but I think a general "separation of concerns" like this is probably the right path forward for kunit_tool. Cheers, -- David On Tue, Feb 4, 2020 at 6:14 PM SeongJae Park wrote: > > On Tue, 4 Feb 2020 16:46:06 -0800 Brendan Higgins wrote: > > > Sorry for the delay. > > > > On Mon, Jan 27, 2020 at 10:03 PM SeongJae Park wrote: > > > > > > On Mon, 27 Jan 2020 16:02:48 -0800 Brendan Higgins wrote: > > > > > > > On Sat, Jan 25, 2020 at 5:59 PM wrote: > > > > > > > > > > From: SeongJae Park > > > > > > > > > > Deletions of configs in the '.kunitconfig' is not applied because kunit > > > > > rebuilds '.config' only if the '.config' is not a subset of the > > > > > '.kunitconfig'. To allow the deletions to applied, this commit modifies > > > > > the '.config' rebuild condition to addtionally check the modified times > > > > > of those files. > > > > > > > > The reason it only checks that .kunitconfig is a subset of .config is > > > > because we don't want the .kunitconfig to remove options just because > > > > it doesn't recognize them. > > > > > > > > It runs `make ARCH=um olddefconfig` on the .config that it generates > > > > from the .kunitconfig, and most of the time that means you will get a > > > > .config with lots of things in it that aren't in the .kunitconfig. > > > > Consequently, nothing should ever be deleted from the .config just > > > > because it was deleted in the .kunitconfig (unless, of course, you > > > > change a =y to a =n or # ... is not set), so I don't see what this > > > > change would do. > > > > > > > > Can you maybe provide an example? > > > > > > Sorry for my insufficient explanation. I added a kunit test > > > (SYSCTL_KUNIT_TEST) to '.kunitconfig', ran the added test, and then removed it > > > from the file. However, '.config' is not generated again due to the condition > > > and therefore the test still runs. > > > > > > For more detail: > > > > > > $ ./tools/testing/kunit/kunit.py run --defconfig --build_dir ../kunit.out/ > > > $ echo "CONFIG_SYSCTL_KUNIT_TEST=y" >> ../kunit.out/.kunitconfig > > > $ ./tools/testing/kunit/kunit.py run --build_dir ../kunit.out/ > > > $ sed -i '4d' ../kunit.out/.kunitconfig > > > $ ./tools/testing/kunit/kunit.py run --build_dir ../kunit.out/ > > > > > > The 2nd line command adds sysctl kunit test and the 3rd line shows it runs the > > > added test as expected. Because the default kunit config contains only 3 > > > lines, The 4th line command removes the sysctl kunit test from the > > > .kunitconfig. However, the 5th line still run the test. > > > > > > This patch is for such cases. Of course, this might make more false positives > > > but I believe it would not be a big problem because .config generation takes no > > > long time. If I missed something, please let me know. > > > > I think I understand. > > > > It is intentional - currently - that KUnit doesn't generate a new > > .config with every invocation. The reason is basically to support > > interaction with other methods of generating .configs. Consider that > > you might want to use make menuconfig to turn something on. It is a > > pretty handy interface if you work on vastly different parts of the > > kernel. Or maybe you have a defconfig that you always use for some > > platform, I think it is easier to run > > > > make foo_config; tools/testing/kunit/kunit.py run > > > > Then having to maintain both your defconfig and a .kunitconfig which > > is a superset of the defconfig. > > > > Your change would make it so that you have to have a .kunitconfig for > > every test environment that you care about, and you could not as > > easily take advantage of menuconfig. > > Thank you for this kind answer. Now I understood the intention and agree with > that. :) > > > > > I think what we do now is a bit janky, and the use cases I mentioned > > are not super well supported. So I am sympathetic to what you are > > trying to do, maybe we could have a config option for it? > > > > I think Ted and Bjorn might have opinions on this; they had some > > related opinions in the past. > > I'm ok with current state, but if related discussions continue and my opinion > is required, I will join in. > > > Thanks, > SeongJae Park > > > > > -- > You received this message because you are subscribed to the Google Groups "KUnit Development" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/20200205021428.8007-1-sj38.park%40gmail.com.