From patchwork Mon Feb 19 20:19:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 203267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp23873dyc; Mon, 19 Feb 2024 12:28:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX3XZwbhOEGoKogwgoaX6sAfYyK0SV1i/ik2lW7ZZDiOeE/e3R5EfxJ2sibXN5FhJPGn8t3bgjPPE5iX+ZBORDMx01NBw== X-Google-Smtp-Source: AGHT+IFJryid3ytu8LWnmU5nEx5QecHMkjBdnK7fBbKi2Ry1wtsNhmSlLPsw6r16aBDxgz8FL+jh X-Received: by 2002:a92:d94a:0:b0:363:b8fb:fcb7 with SMTP id l10-20020a92d94a000000b00363b8fbfcb7mr11791451ilq.16.1708374483212; Mon, 19 Feb 2024 12:28:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708374483; cv=pass; d=google.com; s=arc-20160816; b=eH/LFyksxVhzEQBlBmEWN0oAT0hm8rO79eEj4Qui6VGQdOKZh2AOLmQXYRQat2AJo+ ReKqVtEwopkW/PqBgygHZWh+N02mwAJK3Q++DTz3z3jVVNlwSYxthxasNmvHV7+0ZVPa FX4lR1EKHT5UUleApY3cKR1c5xMEeyAj8DrS6gSALpcQky8NrEIyaqo8p2oP2qbFCnCw OWFXt2AeyzsBlJEHgU7ZB4ehWj/X19Uxc0S+xCx6thQmSnmtm/XSpcasCyx/vgYFTiPo I1TIx+47SVqDcummAPYSGtweYXdEHy0GMnQPeE8S2QfcoXnCzO1W2SqYMaL4skGVEZXo 8HRw== 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=tX9vFqpGj3vp4SJ7KeYmZX1HR3Xu7ydmzHf3opDOXMY=; fh=mL0lp98nCa/OPvHpjHb1CtZuW34GhYDzI2Ze+Ry5Jg8=; b=g3gAbXmB5o4ddyC9OlZf7K2zBlNRjM8BE9aD6zf7tviiWbQc0liZ2neNRZBp/jm3ap cZ557D/+61352oLB83nW0fSQNbIOFcsm0ZiZTLGSGIraMoR6kqGFaGloDGrEVO94Gh3f +HBj25bNmt9xnRzYvaTmn35ptKgkdatrzDOJDRreH+R56UAiPMyBhZj5JNZU0NsNibLO DjW4ahSCnAvn2itFTRJSu4c5bIV+WzgsRTr+N0BoxOXihDMzXOKg1LJLXwfs88CFuE5x S1xF0uuSvqdZrdOnAZL7ZOs7OWlGdvG+K7NPgWYGfvOdoRUozCEctkqYcH4olSCPPUoG SnNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=ZxL5maTc; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-71964-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71964-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q26-20020a65685a000000b005ce7efd2eb5si4858804pgt.266.2024.02.19.12.28.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71964-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=ZxL5maTc; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-71964-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71964-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 07E25282097 for ; Mon, 19 Feb 2024 20:28:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5536454657; Mon, 19 Feb 2024 20:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="ZxL5maTc" 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 339CF524BC 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=IOokB9Rio2sGD/S2cm4kksz2ryidbWK5LpADMswTokgS+ld3mNeyUHSwzgQV7tDzKCwApxd/7vlokkTcz1LrdCmfNeORiZCkreGIRiRGytiOtpPnJgo34tUftLV8jnxZBOW90kYTz4H26ydExY0PO9wIt6hWbfAN2FbbAVH0Aos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708374445; c=relaxed/simple; bh=uNI9A4+TJF5i7pPxyp9+QkZo2T/8fL0GY2fuRb0TubU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ldnkmC9S1gaEKg8hFZ/zz5WjZ0QLb2FZVwMZa2VQn40xW9bIA5Z7/Jz9YyxpUyhloXbmEEnqh+AvetfM0Ul7q/dYylCfOw7CxD+kwkKCV0bAOyFZNkYJn3E6SrGQxZuiHOIB86YwrOz1IQngTpOGaOzE7opV8xmfSXodt/iL+Hk= 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=ZxL5maTc; 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=uNI9A4+TJF5i7pPxyp9+QkZo2T/8fL0GY2fuRb0TubU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZxL5maTcxrrgWQKt1rczLFI4gK0avOX0UAcNV9L3twfJBzn/+9imqIwY0+ISrOr2S 6B3rVjOlXlH5TOJTv+RvzEhXzqwTPjKjXodVctaHHCvRDOR5aT3Nde0FNpuq1AM+RF /lu2zJl9hzTDIAQcp5dw1DEH1uYQ4E7yUfJaxaOM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 19 Feb 2024 21:19:22 +0100 Subject: [PATCH v3 1/3] scripts: check-sysctl-docs: adapt to new API Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240219-sysctl-check-v3-1-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=3441; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=uNI9A4+TJF5i7pPxyp9+QkZo2T/8fL0GY2fuRb0TubU=; b=pkAhhEiUYGBNfr4QbfStCKcV4IhzZw3S2XloiuS1+C2X6eMcatL3JlLcIk2uEmexPuzowZYDt LE0H4okIbr3Be3L+JSgBFjgZCW0myUgHP85ppoob5ZqgTxhjixRDvBp X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791360482151606418 X-GMAIL-MSGID: 1791360482151606418 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. Signed-off-by: Thomas Weißschuh --- scripts/check-sysctl-docs | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) 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="kernel" \ # Documentation/admin-guide/sysctl/kernel.rst \ -# $(git grep -l register_sysctl_) +# $(git grep -l register_sysctl) # # Specify -vdebug=1 to see debugging information @@ -20,14 +20,10 @@ BEGIN { } # 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 == NR { # Stage 2: process each file and find all sysctl tables BEGINFILE { - delete children delete entries - delete paths - curpath = "" curtable = "" curentry = "" if (debug) print "Processing file " FILENAME } -/^static struct ctl_path/ { - match($0, /static struct ctl_path ([^][]+)/, tables) - curpath = tables[1] - if (debug) print "Processing path " curpath -} - -/^static struct ctl_table/ { - match($0, /static struct ctl_table ([^][]+)/, tables) - curtable = tables[1] +/^static( const)? struct ctl_table/ { + match($0, /static( const)? struct ctl_table ([^][]+)/, tables) + curtable = tables[2] if (debug) print "Processing table " curtable } /^};$/ { - curpath = "" curtable = "" curentry = "" } -curpath && /\.procname[\t ]*=[\t ]*".+"/ { - match($0, /.procname[\t ]*=[\t ]*"([^"]+)"/, names) - if (curentry) { - curentry = curentry "/" names[1] - } else { - curentry = names[1] - } - if (debug) print "Setting path " curpath " to " curentry - paths[curpath] = curentry -} - curtable && /\.procname[\t ]*=[\t ]*".+"/ { match($0, /.procname[\t ]*=[\t ]*"([^"]+)"/, names) curentry = names[1] @@ -140,10 +115,14 @@ curtable && /\.procname[\t ]*=[\t ]*".+"/ { file[curentry] = FILENAME } -/\.child[\t ]*=/ { - child = trimpunct($NF) - if (debug) print "Linking child " child " to table " curtable " entry " curentry - children[curtable][curentry] = child +/register_sysctl.*/ { + match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, tables) + if (debug) print "Registering table " tables[3] " at " tables[2] + if (tables[2] == table) { + for (entry in entries[tables[3]]) { + printentry(entry) + } + } } END { From patchwork Mon Feb 19 20:19:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 203268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp23874dyc; Mon, 19 Feb 2024 12:28:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWCY9W04cKPiHODI5dtzF8aPoAdXfd4AGZSJvCpEPgAbJ6SPislXqX/NiaDRbNdLw5Py3nT80EfBLh0Q46DnUuEfPcRmg== X-Google-Smtp-Source: AGHT+IHfv/8bpmg3wAHF0s5vqhc9hpDy15cBFEmE5ZtC7st7AU/DtcA/F+Pap8Ezeby0uPoYsl0N X-Received: by 2002:a17:906:13d3:b0:a3e:b0b4:a838 with SMTP id g19-20020a17090613d300b00a3eb0b4a838mr2223124ejc.39.1708374483228; Mon, 19 Feb 2024 12:28:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708374483; cv=pass; d=google.com; s=arc-20160816; b=bxnb5HwznU/k3nS6KgtBsIiYPtGztlHbDVUpljyo+v8yh7Ra4HN6dAYpWMGNHOq0uM B7AHmT8ansb/bgvUN50aqdc4KyHbnbV4FwP7Eb+wvpL3LXJQ4gWSR8efI2QuPhnEWy/L Cwb9+dqhySQ03wRTTTRimhn90bac8iU5QBnwQnF4WFOTqy0aYNyTlrnW+XaNYlBPwYe3 u9zS78axV4BYiFV6QSslfQrLVKOEIkCEM+JjlMcO8sOIGp3BztQNHAxurmKUV8hlqVhX NFFT06/MKKo1OKDHWR5zp2NAZ58YILfwisgm2Spkg0Ow4eeDdf8IynXtHe2bwYkKbUCG evaw== 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=SRCgFXkPdCS+r/SA3TqnHdW0KTZwbjzals9S5BVqjHI=; fh=mL0lp98nCa/OPvHpjHb1CtZuW34GhYDzI2Ze+Ry5Jg8=; b=bYDZet8/Yg0VLlvPviCSe42KtF1ZWUzhOdhczW3hgPVhQFO2579SbwF3s4C6MYk9o8 OvSoLne9gHJKQghndrH7ln1SvmDVy7qhWVYm3gkp3kYp+7SJAnQCt/68mT1Y8YVPHTSF rKik4kev7hoy24iMPS2oaSSmtpC/p1toCYz8ZQeLWtnip0f+k+40i/I4A94jRmbiFlFv Fsv2w+A6ELBa4s8r8apNnKOwAY8/Mdsyd/2HrDfXnK9lW9Icyg4SVIeiein2Icv7U9+4 YoigKUmPYOD1C7fowy3lquXmCtXOLnuBzzf4ff7gnZzQwDKWOelTGf1/ty5rrecFtkpT K36Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Nn6oRj52; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-71963-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71963-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a20-20020a1709062b1400b00a3e932f7a37si1118177ejg.23.2024.02.19.12.28.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71963-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Nn6oRj52; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-71963-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71963-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id D1D1F1F21F4E for ; Mon, 19 Feb 2024 20:28:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3925653E3E; Mon, 19 Feb 2024 20:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Nn6oRj52" 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 339563D38C 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=ItIZgHug2xVZBEfJB+zvtlw/Yr5m0XsHymRHfaJVId984miSrGs3aTZRaoOjyjsdWdSrte6g53IXxwn0IVuG85N4IGb8HBjK9oXnpxp/feYueNPwANTbbZKBcq7OpIKVQ4ry//URYNl6D8ey6Cwj/2KF9AfKZ4Q3T8OpaA05Q2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708374445; c=relaxed/simple; bh=2+aoCwOd06/v1RwfWjtXRvkTzvzg3Gip4JPINzS5zGw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C5zKRaONF1q0812ogaVUp5v29rsXv1U82sOHLE8byfOwGi8rlK9rJOQvQP+K4B80+Emc7CO9ToJpUTzjctHFInFxSoxfBxuqRODsNA9kkqHWoSvpIQVjR+vicD/sTluN8gOLy2qXPCP6zAabel0NA738AY5apSN3wMAK5swAvvU= 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=Nn6oRj52; 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=2+aoCwOd06/v1RwfWjtXRvkTzvzg3Gip4JPINzS5zGw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Nn6oRj52uOevfeinneNNvv6zz5iNu4l5SM6k0SPBlWNKzB+XAtRQbp2qom68SVsmc +Ld3fukJ0WuH9QLVzXYl+DCatXDgPKScmW59/5xWJOkwXc0HOUdopR5Pt2Je1YvUx9 Vl25Uu+s81Wph/veKdYwujymErvsj21BzWOU+Tu4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 19 Feb 2024 21:19:23 +0100 Subject: [PATCH v3 2/3] ipc: remove linebreaks from arguments of __register_sysctl_table Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240219-sysctl-check-v3-2-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=797; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=2+aoCwOd06/v1RwfWjtXRvkTzvzg3Gip4JPINzS5zGw=; b=4a1lYJ1PBMTeJ+6XFqt0TOA2ayoWIl3GQxZ8fy2AU3RjjsgobW0N8db4rYq9EkMvbSHXaa8/w IIHgKKGd4BLAjxli2DumdMyGGqqf89gO1OGf+heF13ZUPDvVx3mto5p X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791360482081781022 X-GMAIL-MSGID: 1791360482081781022 Calls to __register_sysctl_table will be validated by scripts/check-sysctl-docs. As this script is line-based remove the linebreak which would confuse the script. Signed-off-by: Thomas Weißschuh --- ipc/ipc_sysctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 8c62e443f78b..e4008288a3ba 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -259,8 +259,7 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns) tbl[i].data = NULL; } - ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set, - "kernel", tbl, + ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set, "kernel", tbl, ARRAY_SIZE(ipc_sysctls)); } if (!ns->ipc_sysctls) { From patchwork Mon Feb 19 20:19:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 203269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp23888dyc; Mon, 19 Feb 2024 12:28:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKdCNc/6jVt69fzWltjEwrNzgRc8BR5SisQo6uIJwBykFckFH4uZlago/djm54vgHtPYVV+7xAeNOdXuB2AcSPgDB57Q== X-Google-Smtp-Source: AGHT+IEkUVDD06ZPb1LpNLvvHDioHHOu8HibAcFZRTAQ6GxWF8+PYlmjnUB0Th2562F2LY42uU5X X-Received: by 2002:a2e:82d5:0:b0:2d0:a60c:5c36 with SMTP id n21-20020a2e82d5000000b002d0a60c5c36mr8334591ljh.21.1708374486603; Mon, 19 Feb 2024 12:28:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708374486; cv=pass; d=google.com; s=arc-20160816; b=ZgX990sobbTJ1p3RIx/ukONrHKjo7CICpH9VWviY2h678emgWn38nvQq/8uY4HRCKm npjxKdp+8jEYWiOoYQ/ASPo/LF4oE2m52czveXiF67nFa7NYnWzR9z7VEK4lbcJmDd+q 9Xxzk3SWp3zcbP+1NLVlOqtzklyXvyXkbtilyU4g79yLh8HWaLIQ6jwEijVQEJaXniDI yuoTqniN6Icl9TVSuXqJQ4/a1r+nS89/LVBVXOvQacZChKAtNrJYSwxMGS2g3OX34Aml ObDS+maBwp/d/YdpNcSev8/3mV4aBWJjEPd6iGO5o9NG6wDlFYqGAvZirPKl227GfKDL 5koQ== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71965-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t17-20020a50ab51000000b00563e0aa402csi2707614edc.23.2024.02.19.12.28.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:28:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71965-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71965-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 37F151F233EE for ; Mon, 19 Feb 2024 20:28:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71B285467F; Mon, 19 Feb 2024 20:27:28 +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 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= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791360485666350083 X-GMAIL-MSGID: 1791360485666350083 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]) {