From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA2A9C433EF for ; Tue, 7 Dec 2021 22:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242305AbhLGWuR (ORCPT ); Tue, 7 Dec 2021 17:50:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232119AbhLGWuQ (ORCPT ); Tue, 7 Dec 2021 17:50:16 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A56C061574 for ; Tue, 7 Dec 2021 14:46:45 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id m24so372849pgn.7 for ; Tue, 07 Dec 2021 14:46:45 -0800 (PST) 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=Qo2gY9GkL4/3JxkwIdvL8NrT6jxwYuRAOPwQ/50yNqM=; b=fDXu9wWpReTzmmw0klosA3lK2h7JpNj+kabdgROoCxvh07v3DlpQzK9zRpYVgqpsDn Ee1V3C23ImrW6FmLBU2UhHrSHybZlyKUn/d9MmVhhx4UO8GpanF7FLi1DY7eZG+OO1uZ +0jusIKy7z+1cTdp2b3dTSIPPPW2FqKBarfv8tzDdaPkLtTzeG61Uj/97cJzEVn1v6i+ vxF9l82YyhpgdALKZNV1L4pFvXqYgKwqwUEMwzi910eCHDEUuP30bhCZrFe2kuY9cpmq eX6LQdV0GhAfQB/Ec9ccBVKRDs/crCVdnUtswtQftX2NDL+PcGG/P5r2gzQTJa71YjC4 zG5w== 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=Qo2gY9GkL4/3JxkwIdvL8NrT6jxwYuRAOPwQ/50yNqM=; b=0anwebdC35tre46FQVchjrJ+RvaH8wQACpjtX833bb7M5mc95HbWELLLsQrIK/+43I dkRHEA6UroohsehHAWKpSHXxry/menSyi3Z0Guzseqz8goS7WP9+xyvhR18d+Nk0YzXj yllyIodts22NtNXJwYx1Yn3yYcttEqTXQxKR9La/Xnd2ucjfepVtZH/pqBpVaQ0akrCO eNiohX9TffEFvgLS/haFs2ke49qbnctXyjMbgcVe0USE4sGEBtgDoBeF31TebP3UMCeH M9ugYZgQUfN4Zy7R1hFP91tGErEzmeYkRgrc2Of+Qq1uXKt2oIKwN/uLgVZUCeewCpK3 5UeQ== X-Gm-Message-State: AOAM533lpqQ4i3cKw5PU88Bp8otBa4TLnQ0TnBQ+RsilW+/thyD3ruYf 13cWRkGf1nTY4qXIu+K7Y2l8ira2CwGvK6IR+Ch0Ekth9Yg= X-Google-Smtp-Source: ABdhPJy+oA7nnc/C43NR8k9jnC+Den9LQj2xcpi0XhY+QR1GXKFlMHp+x7rUBtESBtf4d8/NY3VYxrBSaTQ7svxdN40= X-Received: by 2002:aa7:96b7:0:b0:49f:df90:e4ae with SMTP id g23-20020aa796b7000000b0049fdf90e4aemr2159519pfk.24.1638917204948; Tue, 07 Dec 2021 14:46:44 -0800 (PST) MIME-Version: 1.0 References: <20211106013058.2621799-1-dlatypov@google.com> <20211106013058.2621799-2-dlatypov@google.com> In-Reply-To: From: Brendan Higgins Date: Tue, 7 Dec 2021 17:46:33 -0500 Message-ID: Subject: Re: [PATCH 2/2] kunit: tool: add --kconfig_add to allow easily tweaking kunitconfigs To: Daniel Latypov Cc: David Gow , linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 18, 2021 at 2:11 PM Daniel Latypov wrote: > > On Mon, Nov 8, 2021 at 9:23 AM Daniel Latypov wrote: > > > > On Fri, Nov 5, 2021 at 9:07 PM David Gow wrote: > > > > > > On Sat, Nov 6, 2021 at 9:31 AM 'Daniel Latypov' via KUnit Development > > > wrote: > > > > > > > > E.g. run tests but with KASAN > > > > $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kconfig_add=CONFIG_KASAN=y > > > > > > This is very neat, thank you. I'm definitely going to use this quite a bit. > > > > > > My only real note is that we'll need to add some documentation (but > > > since the KUnit documentation is being reworked at the moment, I'm > > > okay with doing that later to avoid merge conflicts). > > > > Yeah, there's that and I was also unsure where exactly to mention it. > > I'd also want there to be the caveat about how removing the option > > won't trigger a rebuild. > > The part where we have that right now is really early on and doesn't > > need more stuff added there: > > https://www.kernel.org/doc/html/latest/dev-tools/kunit/start.html#creating-a-kunitconfig > > > > > > > > > This also works with --kunitconfig > > > > $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kunitconfig=fs/ext4 --kconfig_add=CONFIG_KASAN=y > > > > > > It's also worth noting that this can be appended multiple times to set > > > multiple options, which is useful > > > > Ah yeah, this could be called out in the commit desc if we want a v2. > > Checking the examples in the link down below, TuxMake doesn't actually > > include one with it being repeated. > > I had been banking on readers of this message assuming that it could > > be repeated either from previous familiarity with TuxMake or by > > clicking that link. > > > > But for tweaks that require multiple options, I'm personally going to > > stick with --kunitconfig and heredocs. > > E.g. coverage requires appending 3 kconfigs, so I'm sticking with > > > > ./tools/testing/kunit/kunit.py run --make_options=CC=/usr/bin/gcc-6 > > --kunitconfig /dev/stdin < > CONFIG_KUNIT=y > > CONFIG_KUNIT_ALL_TESTS=y > > CONFIG_DEBUG_KERNEL=y > > CONFIG_DEBUG_INFO=y > > CONFIG_GCOV=y > > EOF > > > > > > > > > This flag is inspired by TuxMake's --kconfig-add, see > > > > https://gitlab.com/Linaro/tuxmake#examples. > > > > > > > > Our version just uses "_" as the delimiter for consistency with > > > > pre-existing flags like --build_dir, --make_options, --kernel_args, etc. > > > > > > > > Note: this does make it easier to run into a pre-existing edge case: > > > > $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kconfig_add=CONFIG_KASAN=y > > > > $ ./tools/testing/kunit/kunit.py run --arch=x86_64 > > > > This second invocation ^ still has KASAN enabled! > > > > > > This behaviour is quite useful, and actually means we can turn on > > > individual items with > > > $ ./tools/testing/kunit/kunit.py config --kconfig_add=