Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2743647pxb; Tue, 9 Mar 2021 09:44:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzS2hVMG8dTwjhrR4a7Ne+AJ6uQRkCyQFFuHMHu2Y/awVzEk3pseFxSM6ljMaiCmLFZ2gNC X-Received: by 2002:a17:906:bc81:: with SMTP id lv1mr21568224ejb.135.1615311863960; Tue, 09 Mar 2021 09:44:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615311863; cv=none; d=google.com; s=arc-20160816; b=ejrWREkwOc4hsAGfYwOAIOdtzEVQdqVIuKbmdeoSABoh+vnRsvcWriyo1GKf2FxFnA 2kIGhSZh0gXQC0yNWpWmJ5NBL98ErbFUQuWa149JyI2yRpZ8vmzyxdsLQOhWIwinpAwE ymhjz79m1vtN/RiZncBS4f4hk6CM0X9loJnuxvcnSOum7u1sZfp+1yawC1fKWySj6DbO qiXGxFqiczrtkdpSgvBE2FVVNWTjCfs6GXws8KoaMEhzemgAiKcfr5SmDjf4yT/Wm2ev FE4kntfOi+zYpuMM8NfmQWZ4nCV66HQ3AB+TIiIdMhU7xjL6R4Hm6GbkJ3lpM3QCpFzR mkCw== 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=TxyMaDdxRty0PzM5Q0lfkkMQHZry5NLjFLIuAKbjzOo=; b=0Uy/08nnKJY9CUpkGtw/x+yZhMsS7tb0KpAEdh6mKHdzRzqP7kbtzDYO8mb0N4yGXx RhWCTO2bdu/R3t5B9zjunADdSP5hDnmHQXdjbSSNPEyJ0IqKH8B7kPqvwoG3ZjGQ+LSa xKf/KAxHfc5+yDV3WnRoJnUlXhoOgt5Tl23s62754uzvPJAN/nrIexbU/ZzZnR79QF7w Pf3mwHtRD/mOOm0/GabaBzGGw+yTLhs1QTPq7+btGeNFi9TEmQ93HTy2ATFb6lznQXxn ggMB9hYT+XkS2uz9RFfMJNg9u8XII4V0fepK9n4g4z4oSedc95F2/dmEX9HjcWz2KZeA ovTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AkerNW1o; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si9819623ejb.554.2021.03.09.09.44.00; Tue, 09 Mar 2021 09:44:23 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=AkerNW1o; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbhCIRmw (ORCPT + 99 others); Tue, 9 Mar 2021 12:42:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:46318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbhCIRmr (ORCPT ); Tue, 9 Mar 2021 12:42:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A5946523A; Tue, 9 Mar 2021 17:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615311767; bh=9GvvHE/FUuaHjAoFl5s/o4xB1kKuNNQZsvQhUv5aVSw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AkerNW1oXISUkhOs9q8Jhfqw8K6nO2FO9SkqY0nCKXn7/vXfFHJHiy9iqoUMd+9ZE BGSMCWNa0Q5DkCHvLrkodbWG6CKOYkcID70/4l9H7dqqR4cP7Yhw0qUuZNb5GRnayw 11CXrB8M4F71zldK3V7rY3jHLHeBwQ5NkpGPOBS9QWWR4xgdyMy/Cnke3AJekfYmEA 3eZ8bYp8B4xfZINvd8+H1iLJvxhETW3xhUEsOMUnZYHIzYgDwsSAQNOlPupri4u8Fq xvjAXjHLerB5NP9kuqsm+fSXNW+PYc8XBl6PQeTRTEoQxP+MAQ3OTL/PR2qJS59tB2 6MSPRbACsQ37A== Received: by mail-ed1-f51.google.com with SMTP id b7so21940370edz.8; Tue, 09 Mar 2021 09:42:47 -0800 (PST) X-Gm-Message-State: AOAM533P0lhS/Iqi5hiGLqQY+vSPBlkjyTgcBRrhyuWx/0yh8zY5Kpt5 l1OhLEVTkZVz8SPC9Tym8rveEsdRMxQLd+bqyg== X-Received: by 2002:a05:6402:c88:: with SMTP id cm8mr5497065edb.62.1615311765955; Tue, 09 Mar 2021 09:42:45 -0800 (PST) MIME-Version: 1.0 References: <20210309112148.2309116-1-geert+renesas@glider.be> In-Reply-To: <20210309112148.2309116-1-geert+renesas@glider.be> From: Rob Herring Date: Tue, 9 Mar 2021 10:42:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [RFC] dt-bindings: Consider DT_SCHEMA_FILES when finding all json-schema To: Geert Uytterhoeven Cc: Masahiro Yamada , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 9, 2021 at 4:21 AM Geert Uytterhoeven wrote: > > Setting DT_SCHEMA_FILES allows the user to restrict the > "dt_binding_check" make target to a specified set of DT binding files. > However, yamllint is still run on all available files, which can take > quite some time. > > Fix this by changing "find_cmd" to only return the specified files. > Note that this also affects the "cmd_chk_bindings" and "cmd_mk_schema" > rules. > > This reduces the execution time of > > make dt_binding_check DT_SCHEMA_FILES=/path/to/json/schema/file > > from ca. 22 to less than 2 seconds on an i7-8700K. We could use xargs sharding like 'chk_bindings' does. That goes from 18s to 5s for me (i7-7700HQ). Good enough? Not sure why I didn't other than thinking 20sec was fast enough. Another option would be doing yamllint as part of cmd_extract_ex or we could have a command line variable to disable yamllint. > Signed-off-by: Geert Uytterhoeven > --- > Should this be restricted to cmd_yamllint? > I'm not sure which users of find_cmd do and do not need all files. cmd_chk_bindings always does. cmd_mk_schema needs both. So I think this doesn't work for all cases. > --- > Documentation/devicetree/bindings/Makefile | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile > index 780e5618ec0ae2fc..60ac03bade2da0ad 100644 > --- a/Documentation/devicetree/bindings/Makefile > +++ b/Documentation/devicetree/bindings/Makefile > @@ -22,10 +22,18 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE > # Use full schemas when checking %.example.dts > DT_TMP_SCHEMA := $(obj)/processed-schema-examples.json > > +ifeq ($(DT_SCHEMA_FILES),) > + > find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ > -name 'processed-schema*' ! \ > -name '*.example.dt.yaml' \) > > +else > + > +find_cmd = echo $(addprefix $(srctree)/, $(DT_SCHEMA_FILES)) > + > +endif > + > quiet_cmd_yamllint = LINT $(src) > cmd_yamllint = ($(find_cmd) | \ > xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint) || true > -- > 2.25.1 >