Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp808619ybi; Fri, 21 Jun 2019 08:30:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnGbQeKDVCn8tBx0jiK8o1onDMunLHYMzjCfy1nGz9c9JwC+4WQ4vbnM51mWKMF6VK6vAh X-Received: by 2002:a63:c60b:: with SMTP id w11mr8475661pgg.356.1561131030862; Fri, 21 Jun 2019 08:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561131030; cv=none; d=google.com; s=arc-20160816; b=rq/kS4lpalryKr+eKvAmgOupmgDwMQaCb8C81PVzauhaudhxBx17sJy2Q7DB8yzF1+ chnCSSXzv0glRt7xzuKnUl9CbNoxrr6shJ4yyeUZGY56Tzh5+m5Ieq92RdgAlh2O4Uv5 fC06c8u2LrFof2eVEPNAw732Ufv64R9KK2Hzcqz2xQCkbdIsGLJsV5Hd8jssyAjEzUsN q7SsUDlVNp6BHaWW7fAUDwpmBqeDY9FwAjafbe6/A81SzKqr2EJ5YrNDeO9ZuSEDx4vD 1f75+bNH9igrEvEzaUwXWx8VKus8Jm8jwA4L6M6E5176qVW0ICjMvMMs+vDcV/qV1G5u sdAw== 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=dfnoVNT3V7SYvYtsn9Bs6s7MUJu5ylj7M4ocTJKuFPw=; b=CO1Yo7J7XQ0c3Nef5Ng5lJc9FTRxAZ/PEpb2z45hlaXGiLlGI94E9ZOGLSQxpw1Fxs h6p1rCgdZu3dsJY7KtKl8Eb3Wibe0vBIVM7atS+05fuyy030YJmHfVRDKl7fZbBl9sOV m0nI4pWl7miiuU5aIrSAwk73JcX2Y7MEEE5u+Hwpbx2Int1mpgzEcSqymLm6aOl8wV8m yRtNDy6h209TUXkX3ZBndJssQpHfTw/W00nMdpYXyWu0Li/V3piold6qagT3GIXnwttV DoSNC2wm/mG9kVnC8GLFiKKmQIgbyTtevO13lO2U+Qq1u9KnKNFRnADzrbEMMNcozJyV ErBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iEvd+xSq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si2968302pgc.9.2019.06.21.08.30.14; Fri, 21 Jun 2019 08:30:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iEvd+xSq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbfFUP2I (ORCPT + 99 others); Fri, 21 Jun 2019 11:28:08 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53292 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfFUP2I (ORCPT ); Fri, 21 Jun 2019 11:28:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dfnoVNT3V7SYvYtsn9Bs6s7MUJu5ylj7M4ocTJKuFPw=; b=iEvd+xSq7niAE59MOOzJX8jdAx oRxFd1hYSYtb06ntz0iKVE1A0ykBGRQBUpUnNxZryPDjhyB53aNTctGI2cNY9p0g6fz/R0M9VmaRq pl/4tBj6TmIdD+iWo+XeIn6Xs65FQpur9Yb72zhFk1eZ1UA+7+eTiA3TcTrQ0TFmPyOtJoicpnQi6 wksPo0+/IhOc1si1TPcmLyQOhhYEuBTGiuwOzu/tJD+2eDK2uOFDwVpJkZv0rKvTV4eIttz+AgU6+ +qtVBFGV+rvI2xrM70nbIgC07AMWFk6y+gabmXebpr02PvX0xq3EerBYoHRj5duSIABK36hqN4LXG YhN6smHA==; Received: from [177.97.20.138] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1heLSR-0006Au-LP; Fri, 21 Jun 2019 15:28:07 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1heLSO-0005iB-Ik; Fri, 21 Jun 2019 12:28:04 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , gregkh@linuxfoundation.org Subject: [PATCH 1/2] get_abi.pl: Allow optionally record from where a line came from Date: Fri, 21 Jun 2019 12:28:01 -0300 Message-Id: <00646c61f64f84f49c37d270b4c10511b0605c67.1561130657.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The get_abi.pl reads a lot of files and can join them on a single output file. Store where each "What:" output came from, in order to be able to optionally display it. This is useful for the Sphinx extension, with can now be able to blame what ABI file has issues, and on what line the What: description with problems begin. Signed-off-by: Mauro Carvalho Chehab --- scripts/get_abi.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 03f3c57af7ab..45453b7586bc 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -10,6 +10,7 @@ use Fcntl ':mode'; my $help; my $man; my $debug; +my $enable_lineno; my $prefix="Documentation/ABI"; # @@ -19,6 +20,7 @@ my $description_is_rst = 0; GetOptions( "debug|d+" => \$debug, + "enable-lineno" => \$enable_lineno, "rst-source!" => \$description_is_rst, "dir=s" => \$prefix, 'help|?' => \$help, @@ -134,6 +136,8 @@ sub parse_abi { if ($tag ne "" && $new_tag) { $tag = $new_tag; + $data{$what}->{line_no} = $ln; + if ($new_what) { @{$data{$what}->{label}} = @labels if ($data{$nametag}->{what}); @labels = (); @@ -229,6 +233,12 @@ sub output_rest { my $file = $data{$what}->{file}; my $filepath = $data{$what}->{filepath}; + if ($enable_lineno) { + printf "#define LINENO %s%s#%s\n\n", + $prefix, $data{$what}->{file}, + $data{$what}->{line_no}; + } + my $w = $what; $w =~ s/([\(\)\_\-\*\=\^\~\\])/\\$1/g; @@ -377,6 +387,10 @@ sub search_symbols { } } +# Ensure that the prefix will always end with a slash +# While this is not needed for find, it makes the patch nicer +# with --enable-lineno +$prefix =~ s,/?$,/,; # # Parses all ABI files located at $prefix dir @@ -403,7 +417,8 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. =head1 SYNOPSIS -B [--debug] [--man] [--help] --[(no-)rst-source] [--dir=] [] +B [--debug] [--enable-lineno] [--man] [--help] + [--(no-)rst-source] [--dir=] [] Where can be: @@ -433,6 +448,10 @@ selecting between a rst-compliant source ABI (--rst-source), or a plain text that may be violating ReST spec, so it requres some escaping logic (--no-rst-source). +=item B<--enable-lineno> + +Enable output of #define LINENO lines. + =item B<--debug> Put the script in verbose mode, useful for debugging. Can be called multiple -- 2.21.0