2024-02-19 20:27:52

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH v3 0/3] scripts: check-sysctl-docs: adapt to new API

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.

Per-namespace tables via __register_sysctl_table() are also handled.

Note that the script is already prepared for a potential constification
of the ctl_table structs.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
Changes in v3:
- Handle per-namespace tables
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Remove unused global variable "paths"
- Remove docs for deleted variables "children" and "paths"
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Thomas Weißschuh (3):
scripts: check-sysctl-docs: adapt to new API
ipc: remove linebreaks from arguments of __register_sysctl_table
scripts: check-sysctl-docs: handle per-namespace sysctls

ipc/ipc_sysctl.c | 3 +--
scripts/check-sysctl-docs | 65 +++++++++++++++++++++++------------------------
2 files changed, 33 insertions(+), 35 deletions(-)
---
base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d
change-id: 20231220-sysctl-check-8802651d945d

Best regards,
--
Thomas Weißschuh <[email protected]>



2024-02-20 09:17:02

by Joel Granados

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] scripts: check-sysctl-docs: adapt to new API

Hey Thomas

Thx for your V3. I'll put it on my sysctl todo list for friday.

Best

On Mon, Feb 19, 2024 at 09:19:21PM +0100, Thomas Wei?schuh 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.
>
> Per-namespace tables via __register_sysctl_table() are also handled.
>
> Note that the script is already prepared for a potential constification
> of the ctl_table structs.
>
> Signed-off-by: Thomas Wei?schuh <[email protected]>
> ---
> Changes in v3:
> - Handle per-namespace tables
> - Link to v2: https://lore.kernel.org/r/[email protected]
>
> Changes in v2:
> - Remove unused global variable "paths"
> - Remove docs for deleted variables "children" and "paths"
> - Link to v1: https://lore.kernel.org/r/[email protected]
>
> ---
> Thomas Wei?schuh (3):
> scripts: check-sysctl-docs: adapt to new API
> ipc: remove linebreaks from arguments of __register_sysctl_table
> scripts: check-sysctl-docs: handle per-namespace sysctls
>
> ipc/ipc_sysctl.c | 3 +--
> scripts/check-sysctl-docs | 65 +++++++++++++++++++++++------------------------
> 2 files changed, 33 insertions(+), 35 deletions(-)
> ---
> base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d
> change-id: 20231220-sysctl-check-8802651d945d
>
> Best regards,
> --
> Thomas Wei?schuh <[email protected]>
>

--

Joel Granados


Attachments:
(No filename) (1.56 kB)
signature.asc (673.00 B)
Download all attachments

2024-02-23 11:33:23

by Joel Granados

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] scripts: check-sysctl-docs: adapt to new API

On Mon, Feb 19, 2024 at 09:19:21PM +0100, Thomas Wei?schuh 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.
>
> Per-namespace tables via __register_sysctl_table() are also handled.
>
> Note that the script is already prepared for a potential constification
> of the ctl_table structs.
>
> Signed-off-by: Thomas Wei?schuh <[email protected]>
> ---
> Changes in v3:
> - Handle per-namespace tables
> - Link to v2: https://lore.kernel.org/r/[email protected]
>
> Changes in v2:
> - Remove unused global variable "paths"
> - Remove docs for deleted variables "children" and "paths"
> - Link to v1: https://lore.kernel.org/r/[email protected]
>
> ---
> Thomas Wei?schuh (3):
> scripts: check-sysctl-docs: adapt to new API
> ipc: remove linebreaks from arguments of __register_sysctl_table
> scripts: check-sysctl-docs: handle per-namespace sysctls
>
> ipc/ipc_sysctl.c | 3 +--
> scripts/check-sysctl-docs | 65 +++++++++++++++++++++++------------------------
> 2 files changed, 33 insertions(+), 35 deletions(-)
> ---
> base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d
> change-id: 20231220-sysctl-check-8802651d945d
>
> Best regards,
> --
> Thomas Wei?schuh <[email protected]>
>
This is fantastic because we went from a totally broken script to one
that has only some false negatives.

I used the following script to test:
for admin_guide in sunrpc kernel index user net abi vm fs ; do
./scripts/check-sysctl-docs -vtable="${admin_guide}" Documentation/admin-guide/sysctl/${admin_guide}.rst $(git grep -l sysctl)
done

Before the patch it gives me 205 "No implementations" out of 205
And after the patch it gave me 42 "No implementations" out of 285

There is still some work to be done, especially for the "fs" part
of this script where there remains some strangeness on how we parse the
rst file.

As this patch has not functional changes, I'll merge it in to
sysctl-next

Thx

Reviewed-by: Joel Granados <[email protected]>
--

Joel Granados


Attachments:
(No filename) (2.23 kB)
signature.asc (673.00 B)
Download all attachments