From nobody Sat Jun 20 01:51:25 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB28FC433F5 for ; Fri, 25 Mar 2022 14:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359302AbiCYOHH (ORCPT ); Fri, 25 Mar 2022 10:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359279AbiCYOGz (ORCPT ); Fri, 25 Mar 2022 10:06:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F4DD8F4A; Fri, 25 Mar 2022 07:05:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7F618B82833; Fri, 25 Mar 2022 14:05:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AC19C340E9; Fri, 25 Mar 2022 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648217118; bh=InqS59/swCZqQjPOSQ38Dh01/JCHMdXS9AaJZgOmLnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4e5qt1x2Z36b6bGLw/xt748snta88/BzOap/WiIJHUEK3WrGtWreQOunZTrqrcvz Uf6m9caxu4tWMNgeW7AvweqKRJYzKZD/MA7Cd2CH4Gnn+xwq1o0DEBpzXTI51H2Hqn tzZejZUUxGrmvtIgbeRNhNJB0yPhUeupaKt82gT6P/rpe5tDY1oD9GWm4M9OifbtpG xkHfqM/M0Pwr2MyU35ekzRu1J9mSuby0JARxCEdKrUS+CwN+u6J51Fpnf+2ON+/Hwg skKJw9BnvcG3DHzzzvVyP5pvzL2yFJinRYwYeNKsUV4de7Yp8UPnfca0HUjU2fs1+i 72MLQ+uwaxTmg== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nXkZ1-00Axyt-O2; Fri, 25 Mar 2022 15:05:15 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Hans de Goede" , "Stephen Rothwell" , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] scripts/get_feat.pl: allow output the parsed file names Date: Fri, 25 Mar 2022 15:05:11 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Such output could be helpful while debugging it, but its main goal is to tell kernel_feat.py about what files were used by the script. Thie way, kernel_feat.py can add those as documentation dependencies. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C= /C on the cover. See [PATCH v2 0/4] at: https://lore.kernel.org/all/cover.1648216561.git.mch= ehab@kernel.org/ scripts/get_feat.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/get_feat.pl b/scripts/get_feat.pl index 457712355676..b7154cf60c1d 100755 --- a/scripts/get_feat.pl +++ b/scripts/get_feat.pl @@ -13,6 +13,7 @@ my $man; my $debug; my $arch; my $feat; +my $enable_fname; =20 my $basename =3D abs_path($0); $basename =3D~ s,/[^/]+$,/,; @@ -31,6 +32,7 @@ GetOptions( 'arch=3Ds' =3D> \$arch, 'feat=3Ds' =3D> \$feat, 'feature=3Ds' =3D> \$feat, + "enable-fname" =3D> \$enable_fname, man =3D> \$man ) or pod2usage(2); =20 @@ -95,6 +97,10 @@ sub parse_feat { return if ($file =3D~ m,($prefix)/arch-support.txt,); return if (!($file =3D~ m,arch-support.txt$,)); =20 + if ($enable_fname) { + printf "#define FILE %s\n", abs_path($file); + } + my $subsys =3D ""; $subsys =3D $2 if ( m,.*($prefix)/([^/]+).*,); =20 @@ -580,6 +586,11 @@ Output features for a single specific feature. Changes the location of the Feature files. By default, it uses the Documentation/features directory. =20 +=3Ditem B<--enable-fname> + +Prints the file name of the feature files. This can be used in order to +track dependencies during documentation build. + =3Ditem B<--debug> =20 Put the script in verbose mode, useful for debugging. Can be called multip= le --=20 2.35.1 From nobody Sat Jun 20 01:51:25 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05528C433EF for ; Fri, 25 Mar 2022 14:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359306AbiCYOHJ (ORCPT ); Fri, 25 Mar 2022 10:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359278AbiCYOGz (ORCPT ); Fri, 25 Mar 2022 10:06:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4B45D8F48; Fri, 25 Mar 2022 07:05:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8AE6BB82892; Fri, 25 Mar 2022 14:05:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B137C340F3; Fri, 25 Mar 2022 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648217118; bh=2D/dTzYT0VeIm/mTkB4UUkqS1y1RpVZCZTgMnIjY/m8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=roKqEQZa30ZCjFSe95w3/zNnmw+s1QUTJp2189zfM8KvKmzCoxEQ41BdGgjrlHBFG BKZsA8b09FAaMAaBCLp6b0JrOZ2ZDwFh3sKPdCKRKr6gSgcIF00hbYgtIh2ue+dLHR jDvNi1XtAFP/G+jEo7NxfBCyxcXuM927rA+66C2Zy6OPHQ2XX/enFcavFZAOMt7Pyv tCX9gEKHxjB+L63m6fyJ2RhvU6ZrrWRFwD6WAS0DUasmGXjySRzxWzGi6CBKJUXMEB QfwOVFNtIYmxmeAMKoeCcgt7JwRiAF5mIO3GpVSbI1I339BuYOU3SyD2zSv+MpHCjm E/HHdXT5jlQbw== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nXkZ1-00Axyw-PW; Fri, 25 Mar 2022 15:05:15 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Hans de Goede" , "Stephen Rothwell" , Randy Dunlap , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] docs: kernel_abi.py: add sphinx build dependencies Date: Fri, 25 Mar 2022 15:05:12 +0100 Message-Id: <2c53fbfe3c02a47a5eae4beb298a6db0c95be54a.1648216561.git.mchehab@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Ensure that Sphinx-build will handle the files parsed by get_abi.pl as dependencies. This way, if they are touched, the ABI output will be regenerated. Reported-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C= /C on the cover. See [PATCH v2 0/4] at: https://lore.kernel.org/all/cover.1648216561.git.mch= ehab@kernel.org/ Documentation/sphinx/kernel_abi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kern= el_abi.py index 4392b3cb4020..efab9b14a9f5 100644 --- a/Documentation/sphinx/kernel_abi.py +++ b/Documentation/sphinx/kernel_abi.py @@ -128,6 +128,7 @@ class KernelCmd(Directive): return out =20 def nestedParse(self, lines, fname): + env =3D self.state.document.settings.env content =3D ViewList() node =3D nodes.section() =20 @@ -154,6 +155,9 @@ class KernelCmd(Directive): self.do_parse(content, node) content =3D ViewList() =20 + # Add the file to Sphinx build dependencies + env.note_dependency(os.path.abspath(f)) + f =3D new_f =20 # sphinx counts lines from 0 --=20 2.35.1 From nobody Sat Jun 20 01:51:25 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87FF9C433F5 for ; Fri, 25 Mar 2022 14:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359294AbiCYOHC (ORCPT ); Fri, 25 Mar 2022 10:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359264AbiCYOGx (ORCPT ); Fri, 25 Mar 2022 10:06:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53AC4D8F4B; Fri, 25 Mar 2022 07:05:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E551D61AFB; Fri, 25 Mar 2022 14:05:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4396AC340F5; Fri, 25 Mar 2022 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648217118; bh=WUbC8iv4z1FG3/dSJ3crKi1kvQQgoCPRCCQlmTdH6fM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VrsvSUsJfXJ8qBH/DFssjDNCvUv3ZrJdlq+jA6yYU4rWDt89hoIdFF4g8HB2vBZHa eyBPxVIirW6iquG4DcAOQfqwY3v6Z8GviMCJy6ZHPtMFx/cASuarYLBZxjNuOgef5m +FTXX3EGNh5/hmPxg9SgM6MaamOiw4d0t2n5LzGzSmSqJQPB6SkYbGzhrfecPSohux iP+32gh8wEyWzEiBxlzkGi8yZlVuMM6GCV0oFJqedt7VEP159hVAoYZ5wJ0YEBZk0r ezG3jjX4ylfFONrr3NKS6dtm4W+6JohqdgcpNm+/2Ub7rDpzoxNKobI8hyeZbWnsTN 346I1xwlWUzEg== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nXkZ1-00Axz1-Rb; Fri, 25 Mar 2022 15:05:15 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Hans de Goede" , "Stephen Rothwell" , Randy Dunlap , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] docs: kernel_feat.py: add build dependencies Date: Fri, 25 Mar 2022 15:05:13 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Ensure that the feature files will be regenerated if any changes happen at the Documentation/features files that were processed by gen_feat.pl. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C= /C on the cover. See [PATCH v2 0/4] at: https://lore.kernel.org/all/cover.1648216561.git.mch= ehab@kernel.org/ Documentation/sphinx/kernel_feat.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/sphinx/kernel_feat.py b/Documentation/sphinx/ker= nel_feat.py index 8138d69a6987..6b40ac1806bb 100644 --- a/Documentation/sphinx/kernel_feat.py +++ b/Documentation/sphinx/kernel_feat.py @@ -33,6 +33,7 @@ u""" =20 import codecs import os +import re import subprocess import sys =20 @@ -82,7 +83,7 @@ class KernelFeat(Directive): =20 env =3D doc.settings.env cwd =3D path.dirname(doc.current_source) - cmd =3D "get_feat.pl rest --dir " + cmd =3D "get_feat.pl rest --enable-fname --dir " cmd +=3D self.arguments[0] =20 if len(self.arguments) > 1: @@ -102,7 +103,22 @@ class KernelFeat(Directive): shell_env["srctree"] =3D srctree =20 lines =3D self.runCmd(cmd, shell=3DTrue, cwd=3Dcwd, env=3Dshell_en= v) - nodeList =3D self.nestedParse(lines, fname) + + line_regex =3D re.compile("^#define FILE (\S+)$") + + out_lines =3D "" + + for line in lines.split("\n"): + match =3D line_regex.search(line) + if match: + fname =3D match.group(1) + + # Add the file to Sphinx build dependencies + env.note_dependency(os.path.abspath(fname)) + else: + out_lines +=3D line + "\n" + + nodeList =3D self.nestedParse(out_lines, fname) return nodeList =20 def runCmd(self, cmd, **kwargs): --=20 2.35.1 From nobody Sat Jun 20 01:51:25 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07BABC433FE for ; Fri, 25 Mar 2022 14:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359287AbiCYOG6 (ORCPT ); Fri, 25 Mar 2022 10:06:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359263AbiCYOGx (ORCPT ); Fri, 25 Mar 2022 10:06:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50ED5D8F4A; Fri, 25 Mar 2022 07:05:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E556561B27; Fri, 25 Mar 2022 14:05:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A458C340F4; Fri, 25 Mar 2022 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648217118; bh=m65/Et1iHVv6XP+JP+iGhMq2qae+wAHPwH92tV4AmNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LL8PaMmMGJAI8oNbT6uPdYJ0tVOHWey22HqjkB57P4tUnAKX7JWx6Fs916lWUJh7I fgthCih3V7WkfAK0K562/PMBeW0Uz7qcOxLc9gurSVIM1ADqcsGy2Gh8q7eQp8UhDJ AW9B0Dp2am/vW6ngPhIgMBw6w4o3oFd/HemhDI+n2mmQmIhaDgTC/QTr84NFipVayh yrqbwl2sua/Jrv91hVJaxZIwtNiBnqM8DMvD1AAJCraIWEZOTJE70IFhlT04XEFhoj 717HTfSB2PszU0Dm2FZUKkQdp+Zjp69Xy0posk/73lYaiQ4GOciIFeLkCOOIGOTQeD tZGjOjdn/9Azg== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nXkZ1-00Axz5-Tc; Fri, 25 Mar 2022 15:05:15 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Hans de Goede" , "Stephen Rothwell" , linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] docs: kernel_include.py: add sphinx build dependencies Date: Fri, 25 Mar 2022 15:05:14 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The files included by kernel-include should be added as build dependencies, in order for sphinx-build to rebuild the corresponding docs if any changes at the included file happens. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C= /C on the cover. See [PATCH v2 0/4] at: https://lore.kernel.org/all/cover.1648216561.git.mch= ehab@kernel.org/ Documentation/sphinx/kernel_include.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/= kernel_include.py index f523aa68a36b..abe768088377 100755 --- a/Documentation/sphinx/kernel_include.py +++ b/Documentation/sphinx/kernel_include.py @@ -59,6 +59,7 @@ class KernelInclude(Include): u"""KernelInclude (``kernel-include``) directive""" =20 def run(self): + env =3D self.state.document.settings.env path =3D os.path.realpath( os.path.expandvars(self.arguments[0])) =20 @@ -70,6 +71,8 @@ class KernelInclude(Include): =20 self.arguments[0] =3D path =20 + env.note_dependency(os.path.abspath(path)) + #return super(KernelInclude, self).run() # won't work, see HINTs i= n _run() return self._run() =20 --=20 2.35.1