Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp85417pxf; Wed, 10 Mar 2021 00:46:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFoPwls3vVsy8u9t2g9QGgd30wId+rm6eP6NkLoLorUU9WSK46pm5bn8sqm3TEk/llioU9 X-Received: by 2002:a17:906:3f87:: with SMTP id b7mr1003898ejj.139.1615365962258; Wed, 10 Mar 2021 00:46:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615365962; cv=none; d=google.com; s=arc-20160816; b=s8lJ4FwYR4ZsU386RervTC88ZkgwGYfiYAs17TXWNxeZPGC0YDUB8uVjrl/w6kbxNp ZuKJNTXNyqBxZaiVw01pkCQOnkXmrictccpcyCwJNy6nz3byU46amZrtRulyfGPYqTJd 7rH948hdnAyFhHCRowmPNWCwxOds9uU1z3VFzx7a3D3wmjvhiVP7zi3GAFL+VoQUnjNk PYH7UQJIj56zLp3IY5wb/wKGGCm1ixqleMX5PJaSeTTsa1vxWZbr6d/K6Fv3/OyaSIWY i6Vwcq56ILlJFlH05gjgdPCzw5RaWTONZOrNxlapNmBG/n4FxQqse7zRteogTpb3ujmc fvjA== 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; bh=YPUEK0LT27EUaM0kP8V6EnWzkWmYVmHulltUbBErJa4=; b=su/Y23afHkv3Pfcf/Ddhp9CMu+e3HC1l7cNWX+/eCwyEHQRXp7nIJQ+sAhRcBA5DQs +TXhYrL0JEBJgSqIrs1OeNO3a1gRTDs3TkLkUayamh+jeupGEYInXYjQfXuExD4LLv6n oGs8A379AQiVSDhHO4vLE+wCKpZy6sg48NYZpw8J3e+2THvg0fTpF+LwOkcLdXjZ1okI lAymqMeDaaogRYZS2s/Hy89c4glCMmL9luU7ZG/5M1sfljOZYXVhRq0dhdNPJE62fwFj EQ/VgWfujrZyyftCtRH+h3G1L2EU8sgl8LrMwSzIq03OTyvUmyeMOIfUGu9hTu1tzRmJ 9eYg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si5082621ejr.694.2021.03.10.00.45.40; Wed, 10 Mar 2021 00:46:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbhCJIo3 (ORCPT + 99 others); Wed, 10 Mar 2021 03:44:29 -0500 Received: from mail-vs1-f54.google.com ([209.85.217.54]:34266 "EHLO mail-vs1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbhCJIn5 (ORCPT ); Wed, 10 Mar 2021 03:43:57 -0500 Received: by mail-vs1-f54.google.com with SMTP id m18so8341912vsa.1; Wed, 10 Mar 2021 00:43:53 -0800 (PST) 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=YPUEK0LT27EUaM0kP8V6EnWzkWmYVmHulltUbBErJa4=; b=hhSudM/gerKRZxYxQ/O/zzf7fcAlxzLEhauzC0NGa7agVA3LHmulFQMsF0mPXWYOHk 6CVz9IBklALGTpP8CYHCltjIcuAujjBPQ3kfQSb49BMHdFi6H2E+t18FPs/x6oGujlvw ifslAWUQWjeDc862+wYWpY4aniZZ046aqddrKNbSJcDVlHs4jopdHpwlLzlD5aq2QrqS jB8d0cHqsuP6rON2wTRVxXFP0mREn7Tc8Y/5dS/eTAwL9Uk8FwApNq7e2zbWaWtllEWC JEaCP0zmYNd6KCWCS2sqLabYdgy/2IIS5WzkfkinJHV9frI/iJdvS0Z6GVRAqEjmHoxJ mSsA== X-Gm-Message-State: AOAM533agH3L9vbpbur7xiffgFh6pLGSx0GBD8AS5oOR15+shjbC/I+L ZirhIlt4HHb2/C1i2Odipftte3bPgTCjIRxRWzY4wERzkN0= X-Received: by 2002:a67:fe90:: with SMTP id b16mr1066469vsr.40.1615365833430; Wed, 10 Mar 2021 00:43:53 -0800 (PST) MIME-Version: 1.0 References: <20210309112148.2309116-1-geert+renesas@glider.be> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 10 Mar 2021 09:43:42 +0100 Message-ID: Subject: Re: [PATCH] [RFC] dt-bindings: Consider DT_SCHEMA_FILES when finding all json-schema To: Rob Herring Cc: Masahiro Yamada , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On Tue, Mar 9, 2021 at 6:42 PM Rob Herring wrote: > 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. Sounds better, but yamllint (on all files) would still take 80% of the time for a single binding check, assuming a reasonably fast multi-core machine. My main objection is that while working on a new binding, and using DT_SCHEMA_FILES, I don't want to waste time on checking other bindings, and being bothered with warnings about them. > > 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. Thanks, will respin to restrict to yamllint. > > --- 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 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds