Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp610783rdb; Mon, 15 Jan 2024 07:49:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAROIQ8KjKmC4qNm4A5aN5oSUlnu+wep10Di09DCl36d5tWsVKHZ7QC1QBWfR16GQwFfVF X-Received: by 2002:a05:620a:2544:b0:783:37f4:e536 with SMTP id s4-20020a05620a254400b0078337f4e536mr7603602qko.113.1705333794222; Mon, 15 Jan 2024 07:49:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705333794; cv=none; d=google.com; s=arc-20160816; b=BT7757YGnooPCrrOIAtK/gqaBA6mVaZL60dMWgqNJfp1y4wIK0rEJyyNTV+qoIG/0L sNmiAJvTBNg4xzSpKcSSb/OjB7fFV1xdnxVbmhTQUcNb8SP2BhPKPmCYykeJ/ifgeYI5 2hMblhUyZD2bKM5XJB3sDYn3QXHiBCNurT0dnmTf/saqd6WmsYe0SQnE52fsdyERD0mX LcjxLM5ySUlwfq003bnEcJ4CK7n0v7py/A6Pr43wRMmh1IKojvGWGaDbr28r+ghD1hUq 0DgQinEp1XDdwNq2bLyW0h8flgVknCeovry+Q7bqpCg0IfruVmY9X+1JuNDja6/1W6AB t+DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id :subject:cc:to:from:date:dkim-signature:dkim-filter; bh=DDK2iFTetcCqvO6VugL53gp2zlYJEjnscZ6upVA4Aj8=; fh=OKXbhfBzRRPIjLMfbOVxQmfxtSkh1vm12zo1gYft0VQ=; b=HRm6yXA9tQlePDwJgN6bt3hCgVnuyTgZ8zuY+JSEpQaaPU0iyMjYD3ELb1CB52njbo MEICWX2VfPpc830q6w3MnvYn8Xlu7mbtwqEUHR+CA/lUY3BDPdIdk7CZGNbk5Bo4LJKS rCLNqUT/2Uclsj/EHyv9TgQtQRl6Q/t85gSRRMabMq44EczOFoXBoScNIv4Z71ApMMEj fHi5Pv6idwlJJJfHEmPyrPwnP7qQOmTqn6oErg83QaDUj7fFHC/+3yZta4TMaXKNnnN1 VNn7d413ZoiQGFHo1LUYz23rkr18aIQ0BaJCBj+et0s0W5+rlYrYY5QhAbPaDqYQik/K w5NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ACr6gIzx; spf=pass (google.com: domain of linux-kernel+bounces-26196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vv25-20020a05620a563900b00781cac14dfdsi7932160qkn.705.2024.01.15.07.49.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:49:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ACr6gIzx; spf=pass (google.com: domain of linux-kernel+bounces-26196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E72791C21D15 for ; Mon, 15 Jan 2024 15:49:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50B9017BB2; Mon, 15 Jan 2024 15:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ACr6gIzx" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FB8A17BAF for ; Mon, 15 Jan 2024 15:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240115154913euoutp0152dfeb70d3dc37f52d9c7cf156681bbd~qkANipyGR0612206122euoutp01W; Mon, 15 Jan 2024 15:49:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240115154913euoutp0152dfeb70d3dc37f52d9c7cf156681bbd~qkANipyGR0612206122euoutp01W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1705333753; bh=DDK2iFTetcCqvO6VugL53gp2zlYJEjnscZ6upVA4Aj8=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=ACr6gIzxbXH3+A8pQF4Fmwhg01e8pC1YYZ3fcKf3xXlImI3Wq4mZf+hDDB5E3DuT7 cqHcWOnfKrExpPHF1vAYgprTAsZE8talg7v95eAaQBDSsGNXT0s/F09y78TW457D4c KyYI7TvDPjhWSR4Peh9jVgmdK54HB8pT+SnhvGYY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240115154912eucas1p177cc773f5a9f751eb8c6452c24b60f8a~qkANZi9ph1742917429eucas1p1d; Mon, 15 Jan 2024 15:49:12 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 3E.47.09552.8F355A56; Mon, 15 Jan 2024 15:49:12 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240115154912eucas1p2e5ebae8bbeed7bdbaec30f80dbf52df1~qkANAzrCE1315413154eucas1p2W; Mon, 15 Jan 2024 15:49:12 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240115154912eusmtrp2e1ba161be4b1e79231fae633f0e755da~qkANARVSS1355813558eusmtrp2k; Mon, 15 Jan 2024 15:49:12 +0000 (GMT) X-AuditID: cbfec7f5-83dff70000002550-b0-65a553f8fdaa Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1D.6D.09146.8F355A56; Mon, 15 Jan 2024 15:49:12 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240115154912eusmtip2dc8d3fbf9d5bdc3f1915671dbf9a58ae~qkAM2RsRB0679506795eusmtip25; Mon, 15 Jan 2024 15:49:12 +0000 (GMT) Received: from localhost (106.210.248.50) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 Jan 2024 15:49:11 +0000 Date: Mon, 15 Jan 2024 16:49:07 +0100 From: Joel Granados To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= CC: Luis Chamberlain , Subject: Re: [PATCH v2] scripts: check-sysctl-docs: adapt to new API Message-ID: <20240115154907.ubr4admknmousjbz@localhost> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="j7wblihvlqrnvzk4" Content-Disposition: inline In-Reply-To: <20231226-sysctl-check-v2-1-2d4f50b30d34@weissschuh.net> X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPKsWRmVeSWpSXmKPExsWy7djP87o/gpemGky7YWZxedccNovfP54x WdyY8JTRgdlj06pONo/Pm+Q8+ruPsQcwR3HZpKTmZJalFunbJXBl3J69ia2gXadiy+55bA2M y5W7GDk5JARMJBbeWsvcxcjFISSwglFi6qsLjBDOF0aJm+ufQDmfGSX+PrjDBNPSefM0C0Ri OaPEohPn2eCqug+0MEE4WxglNnbuYwFpYRFQlZjdMIMNxGYT0JE4/+YOM4gtImAjsfLbZ/Yu Rg4OZgEPib0TQkHCwgIuEqvvT2AEsXkFzCXO/jvEBGELSpyc+QRsJLNAhcSMvhOsEK3SEsv/ cYCEOQVcJa50XAELSwgoSXxf7QVxc63EqS23wC6TEHjDIbF/9lw2iISLxL0vd6EeE5Z4dXwL O4QtI/F/53yohsmMEvv/fWCHcFYzSixr/ArVYS3RcuUJVIejxKe7PVCb+SRuvBWEuJNPYtK2 6cwQYV6JjjYhiGo1idX33rBMYFSeheSzWUg+m4XwGURYT+LG1ClsGMLaEssWvmaGsG0l1q17 z7KAkX0Vo3hqaXFuemqxcV5quV5xYm5xaV66XnJ+7iZGYDo6/e/41x2MK1591DvEyMTBeIhR Baj50YbVFxilWPLy81KVRHir7yxJFeJNSaysSi3Kjy8qzUktPsQozcGiJM6rmiKfKiSQnliS mp2aWpBaBJNl4uCUamCqrVVbnBO21Nxe3mcC53TftUssNB7GamQUxKawLEjQnhBd07djU29Q gj9nzewH5y6mOLOa7eJOyYo3M/1sfr1s4h6bBtcYh22MzIv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Bd0H M7bbnznrfGLR/4pTqnyegn/UFk+ZMdHmo5vs+S3WGxc+N16tWcJ4kkk2YZvu+UaDA+4W2T6h V26/SO5YPHtGS3brsjhfY13eH6mVF019l6y4F3G1M7pK8Ennlwu5W1Z77XvRrHejP9qwc9qE 1faT279eeXQkPs7JcH2kKHtZuO6fVbtnOea7eVQunu115UPCm21+4Vum8540imz/9umpbHdM /4usnXpBMbeEV/ofXzpNn+dDfVjEiaqs60osxRmJhlrMRcWJAL9MmapeAwAA X-CMS-MailID: 20240115154912eucas1p2e5ebae8bbeed7bdbaec30f80dbf52df1 X-Msg-Generator: CA X-RootMTR: 20231226113448eucas1p2790755bc45518304822dc9b24c93c2a3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231226113448eucas1p2790755bc45518304822dc9b24c93c2a3 References: <20231226-sysctl-check-v2-1-2d4f50b30d34@weissschuh.net> --j7wblihvlqrnvzk4 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Thomas I lost track of the thread here. Did you get my latest answer to your V1? https://lore.kernel.org/all/20231231143455.tvwb464awfzv5uti@localhost/ Best On Tue, Dec 26, 2023 at 12:34:38PM +0100, Thomas Wei=DFschuh wrote: > The script expects the old sysctl_register_paths() API which was removed > some time ago. Adapt it to work with the new > sysctl_register()/sysctl_register_sz()/sysctl_register_init() APIs. >=20 > In its reference invocation the script won't be able to parse the tables > from ipc/ipc_sysctl.c as they are using dynamically built tables which > are to complex to parse. >=20 > Note that the script is already prepared for a potential constification > of the ctl_table structs. >=20 > Signed-off-by: Thomas Wei=DFschuh > --- > Changes in v2: > - Remove unused global variable "paths" > - Remove docs for deleted variables "children" and "paths" > - Link to v1: https://lore.kernel.org/r/20231220-sysctl-check-v1-1-420ced= 4a69d7@weissschuh.net > --- > scripts/check-sysctl-docs | 45 ++++++++++++-----------------------------= ---- > 1 file changed, 12 insertions(+), 33 deletions(-) >=20 > diff --git a/scripts/check-sysctl-docs b/scripts/check-sysctl-docs > index 4f163e0bf6a4..739afd766708 100755 > --- a/scripts/check-sysctl-docs > +++ b/scripts/check-sysctl-docs > @@ -8,7 +8,7 @@ > # Example invocation: > # scripts/check-sysctl-docs -vtable=3D"kernel" \ > # Documentation/admin-guide/sysctl/kernel.rst \ > -# $(git grep -l register_sysctl_) > +# $(git grep -l register_sysctl) > # > # Specify -vdebug=3D1 to see debugging information > =20 > @@ -20,14 +20,10 @@ BEGIN { > } > =20 > # The following globals are used: > -# children: maps ctl_table names and procnames to child ctl_table names > # documented: maps documented entries (each key is an entry) > # entries: maps ctl_table names and procnames to counts (so > # enumerating the subkeys for a given ctl_table lists its > # procnames) > -# files: maps procnames to source file names > -# paths: maps ctl_path names to paths > -# curpath: the name of the current ctl_path struct > # curtable: the name of the current ctl_table struct > # curentry: the name of the current proc entry (procname when parsing > # a ctl_table, constructed path when parsing a ctl_path) > @@ -94,44 +90,23 @@ FNR =3D=3D NR { > =20 > # Stage 2: process each file and find all sysctl tables > BEGINFILE { > - delete children > delete entries > - delete paths > - curpath =3D "" > curtable =3D "" > curentry =3D "" > if (debug) print "Processing file " FILENAME > } > =20 > -/^static struct ctl_path/ { > - match($0, /static struct ctl_path ([^][]+)/, tables) > - curpath =3D tables[1] > - if (debug) print "Processing path " curpath > -} > - > -/^static struct ctl_table/ { > - match($0, /static struct ctl_table ([^][]+)/, tables) > - curtable =3D tables[1] > +/^static( const)? struct ctl_table/ { > + match($0, /static( const)? struct ctl_table ([^][]+)/, tables) > + curtable =3D tables[2] > if (debug) print "Processing table " curtable > } > =20 > /^};$/ { > - curpath =3D "" > curtable =3D "" > curentry =3D "" > } > =20 > -curpath && /\.procname[\t ]*=3D[\t ]*".+"/ { > - match($0, /.procname[\t ]*=3D[\t ]*"([^"]+)"/, names) > - if (curentry) { > - curentry =3D curentry "/" names[1] > - } else { > - curentry =3D names[1] > - } > - if (debug) print "Setting path " curpath " to " curentry > - paths[curpath] =3D curentry > -} > - > curtable && /\.procname[\t ]*=3D[\t ]*".+"/ { > match($0, /.procname[\t ]*=3D[\t ]*"([^"]+)"/, names) > curentry =3D names[1] > @@ -140,10 +115,14 @@ curtable && /\.procname[\t ]*=3D[\t ]*".+"/ { > file[curentry] =3D FILENAME > } > =20 > -/\.child[\t ]*=3D/ { > - child =3D trimpunct($NF) > - if (debug) print "Linking child " child " to table " curtable " entr= y " curentry > - children[curtable][curentry] =3D child > +/register_sysctl.*/ { > + match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, tab= les) > + if (debug) print "Registering table " tables[3] " at " tables[2] > + if (tables[2] =3D=3D table) { > + for (entry in entries[tables[3]]) { > + printentry(entry) > + } > + } > } > =20 > END { >=20 > --- > base-commit: de2ee5e9405e12600c81e39837362800cee433a2 > change-id: 20231220-sysctl-check-8802651d945d >=20 > Best regards, > --=20 > Thomas Wei=DFschuh >=20 --=20 Joel Granados --j7wblihvlqrnvzk4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEErkcJVyXmMSXOyyeQupfNUreWQU8FAmWlU/IACgkQupfNUreW QU+z9wv/SfmB+xmpyKa9R2Gwimo/vOJ/aUGmeafjnaCVGIugl6ZoW70A4pv0OO1z 1SueAfBzIiXG+8MSduB9aHF2xa83fxLHVw3fuEeMivJMowW26vC9Jsd07eLEYIPJ Fr3ZD1oXcdDdaI0V3eShij4+/CwkAl1zf9VlrKBlsJNYmqn+egdV054r3XZqoh3s cux5o/NZB6rDCmATTLoqv45WYZaydtytqJErTmPWHo1RDhp+dd4D0I6NNskt2uEw TlIZpRdRj7IZ+/8EjmiM7P6PMs2faI/86Zeb2vYYdQ5GDomVRh+Ff3ZF9wxCavCq g59c8qpcfAX59NZK6iUE4LI1B/eweDoPDXMKhvniMfm1Jv+KwyPL8i/BuWHysgl+ NaNbAlKKQE6zbxFci9YrAG2qSoivIwAgGM94Xq9cZmS7zcz/Y+yZuk7zz096XoTD 200WIoL0/JzVlNpTpgZUoFCWxR7gGEJ1fsh7y8PKrv4GMKsXoizaetHCeIrXi2s8 rGesrIWO =ikP5 -----END PGP SIGNATURE----- --j7wblihvlqrnvzk4--