[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWqo7WVsiNk2xyTM=cqi883v0_-jh1Ry9R7yLBaoOYxoA@mail.gmail.com>
Date: Wed, 10 Mar 2021 09:43:42 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Rob Herring <robh+dt@...nel.org>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [RFC] dt-bindings: Consider DT_SCHEMA_FILES when finding
all json-schema
Hi Rob,
On Tue, Mar 9, 2021 at 6:42 PM Rob Herring <robh+dt@...nel.org> wrote:
> On Tue, Mar 9, 2021 at 4:21 AM Geert Uytterhoeven
> <geert+renesas@...der.be> 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 <geert+renesas@...der.be>
> > ---
> > 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@...ux-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
Powered by blists - more mailing lists