Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp590250pxb; Wed, 8 Sep 2021 08:01:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv5+396eqdHQCX08Ca1wNpymhFCkrGSi74+lUaocVIEo8vfnLXLDgc61RJUKjmDT+fIveD X-Received: by 2002:a2e:9055:: with SMTP id n21mr3160341ljg.451.1631113295911; Wed, 08 Sep 2021 08:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631113295; cv=none; d=google.com; s=arc-20160816; b=HbYamVQub1x1qTh1oEAm8UqAvprMThR1dTaYlkhsm/pEiQstVn8bK1lXXgYk0ULvX3 VvZ3oN0hLS0JSc9vobUtpulYXciZXFnJK5BQBYE66HjROkzLezyrvyhtUfXTGNUwotML L6rXhHg+n1jvRAarJlP9C07owBA9nxoV8rlAy5zhim8po4VMjkXZoKbGYv4+LLo3fLWI 97C0qXFrkIRTFX+il/0Py3f+TpqIKhvrRcUc2qHJ4H6w6D5Nvqs+he3ZIZZkDxLWeV39 qrRfJntgMfYOajlUmArKy2Zl5OXSsBnzvr57SStL55F+7Vg30e2okLJjYMuJcUZzt8Um cnvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N3F57Xarp6h7Mbo9i2crFGzU4SubM/3Lkp7PaJk83+A=; b=S7Hgl0h915TQ6cOjKnncsPB+bFuUGgVRiSYq9S5RMIayyaUUy4yI2DLO0oZ01WC1uq Pv4Oo5V6m3TpyGBYZhaQKt+NGImbRKtFIUkM9xaNgpLL0Kigon59cBTK1Z8ouf5iSj5c fW7YVTcF6mNAiDxFSUaPh3Qx3xaICFdPPHREqe4582oP4tnPeiTzw7mehxCGPwLPp5ID Exu5jkLd+GexqACA4/z1D9u+eNom8GxYf13xi/oh99ekENh2vLNFJOR3efTNDAMg+t7n JZOC3v2EMp8p6+dI4VAoKG8GTMVY1U0CGWtD9jxQL0pWnTjxCDcOKsMwPrXo6hdIBOXZ DVEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ewLdT7EM; 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 s26si2152128ejm.228.2021.09.08.08.01.10; Wed, 08 Sep 2021 08:01:35 -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=ewLdT7EM; 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 S1352006AbhIHPAR (ORCPT + 99 others); Wed, 8 Sep 2021 11:00:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbhIHPAK (ORCPT ); Wed, 8 Sep 2021 11:00:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 76BBC60E77; Wed, 8 Sep 2021 14:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631113142; bh=F2eheWIUBx/EoMu2x24ycu8JLAfsbzlSl0+DmRLYS14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ewLdT7EMeh9pFUUFlj6Q/p0EH/yG1sl/QMVVaxtdnfLoMyVN89I1KEcZJg6kpmeTI huXi1+L6izXXVg7Dbfwnv88iOPHz6XkNXGv2TVAzHL6tXvLyw3YIj6/f0eoJSYjDX8 E28fW4y/0u/DJpj/7qWEfbJxI6nrDu8Z8lPwxiPSiTU7OSiL8/zr8FGbMwMOozx51p QbctyfPNqLo6SIOxdvc+MjkuKlBSDPoKnRFK1cN+0R0piRxOzAgbPN8lX0Xms9+Kzg ICjTYy3yofphXN/Wn1dWWh70UZthbzwDo3t+D/OW+g7ztN5KDCECuncPaoyNf3DhqA HftgyRQBEcH7g== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mNz2S-006r3l-Ma; Wed, 08 Sep 2021 16:59:00 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Greg KH Cc: Mauro Carvalho Chehab , "Jonathan Corbet" , linux-kernel@vger.kernel.org Subject: [PATCH 3/9] scripts: get_abi.pl: add an option to filter undefined results Date: Wed, 8 Sep 2021 16:58:50 +0200 Message-Id: <504f317750e978861fbc713072d1a309ac8b14b3.1631112725.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The output of this script can be too big. Add an option to filter out results, in order to help finding issues at the ABI files. Signed-off-by: Mauro Carvalho Chehab --- scripts/get_abi.pl | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 7600e50b53bb..9ca43b225d9a 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -18,6 +18,7 @@ my $enable_lineno = 0; my $show_warnings = 1; my $prefix="Documentation/ABI"; my $sysfs_prefix="/sys"; +my $search_string; # # If true, assumes that the description is formatted with ReST @@ -31,6 +32,7 @@ GetOptions( "dir=s" => \$prefix, 'help|?' => \$help, "show-hints" => \$hint, + "search-string=s" => \$search_string, man => \$man ) or pod2usage(2); @@ -578,6 +580,7 @@ sub check_undefined_symbols { my $defined = 0; my $exact = 0; my $whats = ""; + my $found_string; my $leave = $file; $leave =~ s,.*/,,; @@ -585,6 +588,11 @@ sub check_undefined_symbols { my $path = $file; $path =~ s,(.*/).*,$1,; + if ($search_string) { + $found_string = 1 if ($file =~ m#$search_string#); + } + + print "--> $file\n" if ($found_string && $hint); if (defined($leaf{$leave})) { my $what = $leaf{$leave}; $whats .= " $what" if (!($whats =~ m/$what/)); @@ -610,6 +618,7 @@ sub check_undefined_symbols { if (substr($file, 0, $len) eq $new) { my $newf = $a . substr($file, $len); + print " $newf\n" if ($found_string && $hint); foreach my $w (split / /, $what) { if ($newf =~ m#^$w$#) { $exact = 1; @@ -632,10 +641,10 @@ sub check_undefined_symbols { next if ($file =~ m#/parameters/#); if ($hint && $defined) { - print "$leave at $path might be one of:$whats\n"; + print "$leave at $path might be one of:$whats\n" if (!$search_string || $found_string); next; } - print "$file not found.\n"; + print "$file not found.\n" if (!$search_string || $found_string); } } @@ -686,6 +695,10 @@ sub undefined_symbols { $what =~ s/\\([\[\]\(\)\|])/$1/g; $what =~ s/(\d+)\\(-\d+)/$1$2/g; + if ($search_string) { + print "What: $what\n" if ($what =~ m#$search_string#); + } + $leave =~ s/[\(\)]//g; foreach my $l (split /\|/, $leave) { @@ -748,6 +761,7 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. B [--debug] [--enable-lineno] [--man] [--help] [--(no-)rst-source] [--dir=] [--show-hints] + [--search-string ] [] Where can be: @@ -795,6 +809,11 @@ times, to increase verbosity. Show hints about possible definitions for the missing ABI symbols. Used only when B. +=item B<--search-string> [regex string] + +Show only occurences that match a search string. +Used only when B. + =item B<--help> Prints a brief help message and exits. -- 2.31.1