summaryrefslogtreecommitdiffstats
path: root/scripts/check-sysctl-docs
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-02-19 21:19:24 +0100
committerJoel Granados <j.granados@samsung.com>2024-02-23 12:13:09 +0100
commit4f1136a55dc8e2c27d51e934d0675e12331c7291 (patch)
tree2ab5973216b888316297231de9e571b46f038760 /scripts/check-sysctl-docs
parentipc: remove linebreaks from arguments of __register_sysctl_table (diff)
downloadlinux-4f1136a55dc8e2c27d51e934d0675e12331c7291.tar.xz
linux-4f1136a55dc8e2c27d51e934d0675e12331c7291.zip
scripts: check-sysctl-docs: handle per-namespace sysctls
Some sysctl tables are registered for each namespace. (Like in ipc/ipc_sysctl.c) These need special handling to track the variable assignments. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Joel Granados <j.granados@samsung.com> Signed-off-by: Joel Granados <j.granados@samsung.com>
Diffstat (limited to 'scripts/check-sysctl-docs')
-rwxr-xr-xscripts/check-sysctl-docs20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/check-sysctl-docs b/scripts/check-sysctl-docs
index 739afd766708..20274c63e745 100755
--- a/scripts/check-sysctl-docs
+++ b/scripts/check-sysctl-docs
@@ -93,6 +93,7 @@ BEGINFILE {
delete entries
curtable = ""
curentry = ""
+ delete vars
if (debug) print "Processing file " FILENAME
}
@@ -105,6 +106,7 @@ BEGINFILE {
/^};$/ {
curtable = ""
curentry = ""
+ delete vars
}
curtable && /\.procname[\t ]*=[\t ]*".+"/ {
@@ -125,6 +127,24 @@ curtable && /\.procname[\t ]*=[\t ]*".+"/ {
}
}
+/kmemdup.*/ {
+ match($0, /([^ \t]+) *= *kmemdup\(([^,]+) *,/, names)
+ if (debug) print "Found variable " names[1] " for table " names[2]
+ if (names[2] in entries) {
+ vars[names[1]] = names[2]
+ }
+}
+
+/__register_sysctl_table.*/ {
+ match($0, /__register_sysctl_table\([^,]+, *"([^"]+)" *, *([^,]+)/, tables)
+ if (debug) print "Registering variable table " tables[2] " at " tables[1]
+ if (tables[1] == table && tables[2] in vars) {
+ for (entry in entries[vars[tables[2]]]) {
+ printentry(entry)
+ }
+ }
+}
+
END {
for (entry in documented) {
if (!seen[entry]) {