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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C94D5C433F5 for ; Thu, 18 Nov 2021 19:11:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B03F26117A for ; Thu, 18 Nov 2021 19:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233487AbhKRTOT (ORCPT ); Thu, 18 Nov 2021 14:14:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbhKRTOS (ORCPT ); Thu, 18 Nov 2021 14:14:18 -0500 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFEBAC061574 for ; Thu, 18 Nov 2021 11:11:17 -0800 (PST) Received: by mail-io1-xd2a.google.com with SMTP id v23so9425195iom.12 for ; Thu, 18 Nov 2021 11:11:17 -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=3kTTbw0wxNJ2WJq/0m4wL50EwrDS/E2+zk2MZkwiuPA=; b=eOLtAgi3C9LcESqiPOWdQLyxW+z5ZsYxjyA6hZIK5CtOBadPMRp04YG971xzRfKEWq 381ufaxkjonPCGZvbSCVAtiFktUtoBzkiH1y2ynTQOG7BgaS9e6Afm50NUUsrOan7Xml sn+DaPGPNSW905QdFMSZZWnu0T1dprdy5orKru5CoHfKPvVgDefOrEa/e/QP74KBkhF4 cZCj+HPH2XI4mqupQFFv4FZBjf/ENNWcfaZQGs7wIioTjGtSgdmGyeN7a99BttqOJnuq uXatPCgX/KfU3eVCSvdyAyKgKdcqxZ6qgsS5CzUGAuTIlmavJL+Dg5S0fw61U3Oqoj3o IxoQ== 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=3kTTbw0wxNJ2WJq/0m4wL50EwrDS/E2+zk2MZkwiuPA=; b=HCaJPDThRd2Ls8oNpY69V8Rbix0OaclojDsg09SGVKnSsM7EY2s+gxun2hPMmpCEoX 3sVnxEYAgaLVmerTZujbwNoTC4KRVsx3fpwuJjY44X8JUmtt2hOVKF8OGOd8gLPHGQJq PzyL6gid+TAzIAY1mCzU0b2l0USGsELulErSVEYU1F8Sf3/aHQGaoMPWlwNKKusbv9RC M8vucBVMyB33U6ITAQ7+2eAWEMaWr0PaDUarRGiYoO6dJi9DH8EelsZdip0JhGNXlJhr Y1Ds1mHcbb0XoJAp7EwuAEmWbfcWzXgHXCNvRZxxC3XgExmBhHAK4iSxfC9dV/wz5qpP 00yQ== X-Gm-Message-State: AOAM532v3ylZRNqe+Fq99yeCV2HuzzH4H72+rk5WmMB0ZY/CJ86+pHnF cJb9dPxaZD9cK55MzLYfc4RpB8KrugdE+04qDKmugw== X-Google-Smtp-Source: ABdhPJxaNazcik9X1qrk6hwvFgzu2eRpoP5s28rY7bIhXh0iXyYRIJpNaQdxw1TTf5YLAzrntkcsnp/mEViiZ3qykBE= X-Received: by 2002:a05:6602:1342:: with SMTP id i2mr1051698iov.153.1637262676912; Thu, 18 Nov 2021 11:11:16 -0800 (PST) MIME-Version: 1.0 References: <20211106013058.2621799-1-dlatypov@google.com> <20211106013058.2621799-2-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Thu, 18 Nov 2021 11:11:05 -0800 Message-ID: Subject: Re: [PATCH 2/2] kunit: tool: add --kconfig_add to allow easily tweaking kunitconfigs To: David Gow Cc: brendanhiggins@google.com, 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 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=