Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4042999pxb; Wed, 13 Oct 2021 19:19:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRoQ/StzC6ugbTdhj/M/NhX48pNPq+5jznutvUZ4r3QVmsay9PhKfoDB5w2FabzN9CrqLU X-Received: by 2002:a17:906:4e89:: with SMTP id v9mr517368eju.354.1634177979849; Wed, 13 Oct 2021 19:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634177979; cv=none; d=google.com; s=arc-20160816; b=Mj6J3cjT53Y1KEIiiAQz8zH4Vopd6OCsAcKVWB1q2IEL+hf21cbOYuw/rM4EDU4z4e 6Qd/6Q4Q6mGj9I4+Os9zGasIrxrZGL62Fl1Pvl1uQireNOC/otPIp4q0JHDAMjyA3lNC jEWU2Z7ofh+COwayQuPTd84c45LFylg654Hs09iK6+synquF39yPxLX/LMS+DfyxmIOX m5R9m56QjUUUGvahlyTaOcMWA7wZ6e6UnFXijPFTBsG5dQcmCnIRKqaQcYvDNL4vOAcn ekNoUryWTGJ/+QSR3X2Z2CFsbrPmnocpmi2RLtQ1cMmJsGx6+U3tYxuoQ6Ssh7u5w/0L fc4w== 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=XzIMZBii1B9/Pl5CKvtqcbQpf1sbazCTszvhVplMfsk=; b=x3AKr4Xtqbvw1TJBI98bF1kV1oKFriCbOQdDcWB04LFXJ25qnLzDViKNvAURN+PPAj jkFlfLPSIkG5M5pUjAwe4STaCcgjhgRlSqnh4QsSyDjoOZDoN20zQ0NExRpQQjUdwwbu WpmOJxm8Chculfy7+SCzxztet3KJ8x0VMs3gPiX+fW5wU/r5IVT/4C0adh3kkdHMXlJl HFDWzIkb9hr4R/20e3BiOoh4d1/BfscVZEv7JjMVO74LhRxf54ec6a9hyodebVZfNE8q 6ZmLqbbgRUYZsghhxIaEyLJGnfiUg+t2CXo0m1QHOsgmKHVnE6pUCJzxax+FSqthctxf pGkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eR5WWivX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id jv16si1931399ejc.459.2021.10.13.19.19.14; Wed, 13 Oct 2021 19:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eR5WWivX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229754AbhJNCSx (ORCPT + 99 others); Wed, 13 Oct 2021 22:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbhJNCSw (ORCPT ); Wed, 13 Oct 2021 22:18:52 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61AB8C061570 for ; Wed, 13 Oct 2021 19:16:48 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id o20so14584545wro.3 for ; Wed, 13 Oct 2021 19:16:48 -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=XzIMZBii1B9/Pl5CKvtqcbQpf1sbazCTszvhVplMfsk=; b=eR5WWivXxsYD4AvfSq8h0MPr3xrg/pIxz6EkLM9R3ZlaygXidTDYqvFMGEKDXcVHdn Xd4u82ntGVpsMCHLydhmvxj+AHFjzhujBSICixBy+hrmf/H788RRwQ2bg8eBUsKq1EIg 7pRJ43TwBQXHWVQRY2vHEOI3RVyEnJ5RBdUbN/Sjn2gi1aANV4hMe/OhbF1w3qyfnENt d2g9F+MlQQ9ly1vgYuzgaIq5ch2o8pnvpDWyPIhMHDSrYTJnJjCoV1g6xozasWAhIme6 wBGaEvjg//bSjh6fBa40dUGytOP9mKpQq7Fe/toPWd27TUJFr6eSGyZe0bhfaCYWMccO Na5Q== 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=XzIMZBii1B9/Pl5CKvtqcbQpf1sbazCTszvhVplMfsk=; b=L+m4GkTHEm9kUTgEsGd+JReZuEtlAj2JYpj9YnzbBomgMEwHlcQ/GyjMTKEAOD0rhP CaveRT644nux8VCtLqLrvPOkzuORQx3vGMoaWMdexAht0CE5iA46mALWQhnnOQUCPAaW l2QNkfG18QFfeX4uE4pYoP9hZTEQ5mTWvUkkIDZAuBhPFn+nyCiiTNkGRuoR0QJz6r3W ynYKw4JUSO3lGHZAayhQYMxyxm4XcIatEDcfYOM30DGv1M64CSwpz2y7Yc+P0tShpOY7 tIIKNB1rKco7YUlGa1VDCz9ZZySgdYfzeduV/pucb/hCfxtDe9PywhRCvfFDrTTNj+Ar z+rA== X-Gm-Message-State: AOAM531Oe4tiYquRd0ZcZWzLZYWxd2XThDaGI3hPSNUVxzXZwjLct9eb lqeWWp7hQZsXDOO5MmD1CdYAxDCMAusHtJfDiugJJA== X-Received: by 2002:adf:9c11:: with SMTP id f17mr3434551wrc.147.1634177806847; Wed, 13 Oct 2021 19:16:46 -0700 (PDT) MIME-Version: 1.0 References: <20211013191320.2490913-1-dlatypov@google.com> In-Reply-To: <20211013191320.2490913-1-dlatypov@google.com> From: David Gow Date: Thu, 14 Oct 2021 10:16:35 +0800 Message-ID: Subject: Re: [RFC PATCH] kunit: flatten kunit_suite*** to kunit_suite** in executor To: Daniel Latypov Cc: Brendan Higgins , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , Jeremy Kerr Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 14, 2021 at 3:13 AM Daniel Latypov wrote: > > Per [1], we might not need the array-of-array of kunit_suite's. > > This RFC patch previews the changes we'd make to the executor to > accommodate that by making the executor automatically flatten the > kunit_suite*** into a kunit_suite**. > > The test filtering support [2] added the largest dependency on the > current kunit_suite*** layout, so this patch is based on that. > > It actually drastically simplifies the code, so it might be useful to > keep the auto-flattening step until we actually make the change. > > [1] https://lore.kernel.org/linux-kselftest/101d12fc9250b7a445ff50a9e7a25cd74d0e16eb.camel@codeconstruct.com.au/ > [2] https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit&id=3b29021ddd10cfb6b2565c623595bd3b02036f33 > > Cc: Jeremy Kerr > Signed-off-by: Daniel Latypov > --- I really like this. My only real concern is that it's a little unclear exactly what the resulting layout is, particularly as to what the "make_suite_set" function does. It'd be nice to have some more documentation, either as a comment on the function or a more detailed commit message, which explicitly describes the old format (an array (with start and end pointers) of NULL-terminated arrays of suites), and the new format (a single, NULL-terminated array with both start and end pointers). Re: NULL termination. If we're already using both start and end pointers, the NULL terminator seems useless. (And if we've got a NULL terminator, why are we passing the end pointer around.) It's not super-clear why we'd want both, though the comments in this reply do clarify things a bit: https://lore.kernel.org/linux-kselftest/CAGS_qxoziNGNVpsUfvUfOReADY0PdriV2gJJ7+LUzzd+7BU-Ow@mail.gmail.com/ Finally, if we do want a runtime way of adding suites to the executor's list at runtime (which was suggested as a way of working around some suites which might need extra, global, initialisation), this might change how that'd have to be implemented a bit. I'm not too worried about that, though: it's something that's probably better served with something like a linked list of suite_sets or the like, anyway. In any case, I've tested this in the non-module case, and it seems to work fine. Tested-by: David Gow Cheers, -- David