Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1352534rdb; Mon, 19 Feb 2024 12:27:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXTLoG3kuKzKwI8NCg/fW8hZFtF9BAvRWCHWK2VzbfSWoOy497GohfB0WnYt6+OTtINNInJnur32dfX4ACtpWFXDryjIcqaiCfa6xDI5Q== X-Google-Smtp-Source: AGHT+IHt6T5CX659Ndu72F3WYQ4tyo32eF4X09wk3vJmviwCmr+sOOeIgbMtzs2a0y/zqSA6ejHS X-Received: by 2002:ad4:5b89:0:b0:68c:9d36:db88 with SMTP id 9-20020ad45b89000000b0068c9d36db88mr701406qvp.6.1708374459873; Mon, 19 Feb 2024 12:27:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708374459; cv=pass; d=google.com; s=arc-20160816; b=Y0p4V8aRvZop5zvHk2ITgNXNxYUcx/GH66RwT2RG98ZfYy68O/gLHXXlqxLMpO/4r1 +XR3Lnemy95SncmJzpmxhqwCYSSrJtpimE38mj+/iiypdRh3A4aSuTDM8JPiRRMGDyrU Iq41hTRQUKAx0+/s45A6xBn5cfCcV6dIdMOIZ3Dl6wYQ8kobRmEBV6DKNL0Xr+H8U7Te hSBYEriannRAMsQf63M/u1wBo9QzuBhhMFXjC+VeLNcdQspu0AesYjC2rAa1ruGQ8VTu LWBT9zSrh/StAKN9l0RtalgmvpwBbFGoIeSIuEoMF/HlX/19Rn6WDZ05fgJMgO1Y1FMs LugA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=oGNAJTyD7fmzdfnpUQPELklbPNyEv/wafgtWZZk1zVk=; fh=mL0lp98nCa/OPvHpjHb1CtZuW34GhYDzI2Ze+Ry5Jg8=; b=Oo0hTJIGWmWpF5uelX2EGRo4bTy6qbkNmYnjm3s7byXn9/vJYjRn7+lVpOoWHGh/CM BUv6VdaaFKq4l1zRGQnKR8muB+hIU0UA/x13o167jaKgYUg4ZkE00moDmQjIMyDXj7bI yV4N04pK9aBLfZH5tcZsvxohbBwemIz5SU38MRJcMmGw5NxVfOM9/GFbM5uSzeBA7TYe t2h8TXmNa3TbUQ7Idi8/eP/2OWRXDGQl3E91TwpECotfBM0Zrcv0Yi+U2FlGsnOW8UBH NfI/xqSWrrEAJDhyVy7759B4gjVerfs66ZkqYabbshekz93D7lE780yDpq8QvN4veapW n+Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=sWS1Ua1F; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-71965-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71965-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jr5-20020a0562142a8500b0068c879eb37esi6992974qvb.438.2024.02.19.12.27.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:27:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71965-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=@weissschuh.net header.s=mail header.b=sWS1Ua1F; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-71965-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71965-linux.lists.archive=gmail.com@vger.kernel.org" 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 6089E1C216B6 for ; Mon, 19 Feb 2024 20:27:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6693535D5; Mon, 19 Feb 2024 20:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="sWS1Ua1F" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 3399E51037 for ; Mon, 19 Feb 2024 20:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708374445; cv=none; b=KuxqjgI+jIuS09C5zuumMfrWHjRDCS8ji31rXzhK9avAmf1HeKfPtbX5/h9Gf7Ad3pU5FpjMXom7baji3Ci+l9HUo9Aw81rup50Ju4q1HY2GdEEwlxbfqR5miRxfUl74ULGzFItvt/HdeWxlNethqzE7nKSYf07/SlmthJEezXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708374445; c=relaxed/simple; bh=EA5jBFUYpIY/y4RMC8tQE5p9Mv3S3wcaYM7/mxK/iFY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ot5zDQLprkV9VOnno6bhNjQ6Xov6DVKvIbCqdqUWsZvqY8bezukWr4MyNXqZ1GqoNmLhyVCJQwMSa2qr2frU+8czcHWKpdhVi31Dry8IrBH5+EwqSsFY2y99ydSQQ1BlOo9cBbM/DUAiLfFUPNDVF+gYrSC1ZGzuxmz65dS3gTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=sWS1Ua1F; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1708373975; bh=EA5jBFUYpIY/y4RMC8tQE5p9Mv3S3wcaYM7/mxK/iFY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sWS1Ua1F1EpI89I8bH9VwCpXymaYW4QZKGvh29/bHpv2aoUukVXZ16fbpBGD1Pblr 53ytfLuiV1AUOVT3wFuV5Mjg8slJbqQ5u97+OGgqFSB6T/F+YDcjymRjogKjF/+kw6 yrm5THllBEwE72fshIHfOuFLk1FNtJO+hVvrKyrQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 19 Feb 2024 21:19:24 +0100 Subject: [PATCH v3 3/3] scripts: check-sysctl-docs: handle per-namespace sysctls Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240219-sysctl-check-v3-3-6940d5ff747b@weissschuh.net> References: <20240219-sysctl-check-v3-0-6940d5ff747b@weissschuh.net> In-Reply-To: <20240219-sysctl-check-v3-0-6940d5ff747b@weissschuh.net> To: Luis Chamberlain , Joel Granados Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708373973; l=1552; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=EA5jBFUYpIY/y4RMC8tQE5p9Mv3S3wcaYM7/mxK/iFY=; b=eqXM5vpp2Z6p7wWyuD0lxi8xux1yT5tWJwNIXFitZlx8OW+WZmaowTUkFYiMKUtjEWW5ew8J5 qMQ3BLPJheaDvJTE53ulheeOYVZpBA6XGvKeHtWsyr/CnNI+RhMKuxb X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= 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 --- scripts/check-sysctl-docs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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]) { -- 2.43.2