Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp587706pxb; Sat, 18 Sep 2021 11:21:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/ib/CyYkWUllyU9tzC9cbA7nFGbAB3WLvLIez3Na4jTDX8xtmHd/IB85CB+qINvVMO5ag X-Received: by 2002:a05:6602:2c07:: with SMTP id w7mr13076636iov.122.1631989290991; Sat, 18 Sep 2021 11:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631989290; cv=none; d=google.com; s=arc-20160816; b=0+Csm6vdoLJi70G5JWCiQfJuHmVVYKiBDTFZ/zBbnsaErnoQLbuYOosviT2JRZBRpL 6ftSfEXbHsf+ICKhi87SM66WDGQaDsd9sP1qczR6AJ6vi13O0swGCuGy1CplGzeXRuKr jjKK+HO8YMoOmuxMxqvO2zSN/NMJpYCPgfhS1+/XbSxjhurQQS8CG95Rsw7xsy0tku8M i4fuOnGp0UQRoxs9XCpJUSOGJalRbzeypUc0etr2cbAfvp2YkKozAcVNiywljdzFO3/r qPmSeKeBgp/fFsTuCOHtSbXrSVLiqekoO0OBphOGIfdll+pin2eFb6TlzfAVBg4ilO7x r4Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=e9gJRqpd0hgFjLArmmax3kzd5dAu56QNbySWe+kvFsQ=; b=vXEVw/iCe+2rWiu98QySrxyI/cIYGWuc071unUuuA+O0mrImyIEF1TcmRBWKbw6MKd 9I7fAMnAkUtskpgu2UHNxV0mPPrfLX+obWDFpAf+qq4hs7EgW2d9AHiDIOtL2GsMB+JG wytUXdbXbuoDCFopXzM4eDwgIuzEIQ615M47YUuky8EjHdYWsq2vOm+1TIy8RktidYMo HkAueJ6qB5Nkjm69Pub1s/RXBcmqmxKVHgc3S+adAPFTFL2IrJvuy3igwfn22/KzQ0oO gy8Rb6WSzc7ZvvhH7iJWBl370BVSTMDl4ORJRexsVwlm2J7ZYjNQGnUEr9tUIsPq+PNr QtgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F7LsHblk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s85si4494028ios.68.2021.09.18.11.21.19; Sat, 18 Sep 2021 11:21:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F7LsHblk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244588AbhIRJyI (ORCPT + 99 others); Sat, 18 Sep 2021 05:54:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:54628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243499AbhIRJxq (ORCPT ); Sat, 18 Sep 2021 05:53:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B3F36127C; Sat, 18 Sep 2021 09:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631958742; bh=chE0EwEyFLVgeK91ZaRsMFr0q3GXSbTjQji/CWReA4o=; h=From:To:Cc:Subject:Date:From; b=F7LsHblk8kibVjke9F4qRsRbuXdKGZhsooGevq7y51p9Dd89TQIU6DVX99TH4ODWS EADfQA9+wiUv22xq472rz/3A0hKodUSVPaheglwLjxUu+YhLXck1WhlOGW/iLYlXoX BZpB+we+smu1ddXVArP0DkOXMOpskmSpFD/4TxhxSJ99BNU6NaKEsTbTuUe3Jbpkc3 hX+ir9h6F8WbEucTkj4R1vtRrO+lEQfoEzQYJDMu4jOJDIZDuCSlmcg5sm7qdjEuco U0IA2dfb69JX+H4CpegbS4cjnKMoA9SJC616s5MKd7OrwUoVKyfQPsStX1qJa3gifE F7Tzz5XawncBA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mRX1A-003b0n-FQ; Sat, 18 Sep 2021 11:52:20 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Greg Kroah-Hartman Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Anton Vorontsov , Colin Cross , John Fastabend , KP Singh , Kees Cook , Martin KaFai Lau , Song Liu , Tony Luck , Yonghong Song , bpf@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 0/7] get_abi.pl: Check for missing symbols at the ABI specs Date: Sat, 18 Sep 2021 11:52:10 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Add a new feature at get_abi.pl to optionally check for existing symbols under /sys that won't match a "What:" inside Documentation/ABI. Such feature is very useful to detect missing documentation for ABI. This series brings a major speedup, plus it fixes a few border cases when matching regexes that end with a ".*" or \d+. patch 1 changes get_abi.pl logic to handle multiple What: lines, in order to make the script more robust; patch 2 adds the basic logic. It runs really quicky (up to 2 seconds), but it doesn't use sysfs softlinks. Patch 3 adds support for parsing softlinks. It makes the script a lot slower, making it take a couple of minutes to process the entire sysfs files. It could be optimized in the future by using a graph, but, for now, let's keep it simple. Patch 4 adds an optional parameter to allow filtering the results using a regex given by the user. When this parameter is used (which should be the normal usecase), it will only try to find softlinks if the sysfs node matches a regex. Patch 5 improves the report by avoiding it to ignore What: that ends with a wildcard. Patch 6 is a minor speedup. On a Dell Precision 5820, after patch 6, results are: $ time ./scripts/get_abi.pl undefined |sort >undefined && cat undefined| perl -ne 'print "$1\n" if (m#.*/(\S+) not found#)'|sort|uniq -c|sort -nr >undefined_symbols; wc -l undefined; wc -l undefined_symbols real 2m35.563s user 2m34.346s sys 0m1.220s 7595 undefined 896 undefined_symbols Patch 7 makes a *huge* speedup: it basically switches a linear O(n^3) search for links by a logic which handle symlinks using BFS. It also addresses a border case that was making 'msi-irqs/\d+' regex to be misparsed. After patch 7, it is 11 times faster: $ time ./scripts/get_abi.pl undefined |sort >undefined && cat undefined| perl -ne 'print "$1\n" if (m#.*/(\S+) not found#)'|sort|uniq -c|sort -nr >undefined_symbols; wc -l undefined; wc -l undefined_symbols real 0m14.137s user 0m12.795s sys 0m1.348s 7030 undefined 794 undefined_symbols (the difference on the number of undefined symbols are due to the fix for it to properly handle 'msi-irqs/\d+' regex) - While this series is independent from Documentation/ABI changes, it works best when applied from this tree, which also contain ABI fixes and a couple of additions of frequent missed symbols on my machine: https://git.kernel.org/pub/scm/linux/kernel/git/mchehab/devel.git/log/?h=get_undefined_abi_v3 - v3: - Fixed parse issues with 'msi-irqs/\d+' regex; - Added a BFS graph logic to solve symlinks at sysfs; v2: - multiple What: for the same description are now properly handled; - some special cases are now better handled; - some bugs got fixed. The full series, with the ABI changes and some ABI improvements can be found at: https://git.kernel.org/pub/scm/linux/kernel/git/mchehab/devel.git/commit/?h=get_undefined&id=1838d8fb149170f6c19feda0645d6c3157f46f4f Mauro Carvalho Chehab (7): scripts: get_abi.pl: Better handle multiple What parameters scripts: get_abi.pl: Check for missing symbols at the ABI specs scripts: get_abi.pl: detect softlinks scripts: get_abi.pl: add an option to filter undefined results scripts: get_abi.pl: don't skip what that ends with wildcards scripts: get_abi.pl: Ignore fs/cgroup sysfs nodes earlier scripts: get_abi.pl: add a graph to speedup the undefined algorithm scripts/get_abi.pl | 327 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 320 insertions(+), 7 deletions(-) -- 2.31.1