From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by sourceware.org (Postfix) with ESMTPS id A1F4D3858C2C for ; Fri, 8 Jul 2022 08:29:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1F4D3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id 179D81C0004; Fri, 8 Jul 2022 08:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seketeli.org; s=gm1; t=1657268962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KtYOay5QxI8qHCJAngQu1qIRmQ3lcPXDc5zq3hqdDWw=; b=ZcAYzXMWwNsW4iH+uapN0u2qdGx6xEcunQKwMgWKhshQ911LhwQ8r245i4uRk3wSsUpCXw M/dB9yMfupgbnBbwgtnSKYV4F/A1G3iChXq7GZCQ1KypDhLA39NNNrkUz/+zHRJXHZ7IYx XcjdRi+X5EVECy3E5rYscdXekfL4aV5JCA3eFjtLPE7rrAaNHxjEpRkPSfQ9dgNbODXke1 P1ItveWwoG0ok68HWiUiH+coGAacNN79v8APfQY2v7YSQh/lYF1KIna/j0Y8rkijPwZ8p3 pFuVKo7sh0bAYYcrZxjOk13o+vMT5fKNOPQqBE2IfDbvmQK7gKImoYv2eYKATQ== Received: by localhost (Postfix, from userid 1000) id 29C345800FC; Fri, 8 Jul 2022 10:29:21 +0200 (CEST) From: Dodji Seketeli To: "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH] kmidiff: Add --ctf option to compare kernel trees Organization: Me, myself and I References: <20220704154435.37568-1-guillermo.e.martinez@oracle.com> X-Operating-System: Fedora 37 X-URL: http://www.seketeli.net/~dodji Date: Fri, 08 Jul 2022 10:29:20 +0200 In-Reply-To: <20220704154435.37568-1-guillermo.e.martinez@oracle.com> (Guillermo E. Martinez via Libabigail's message of "Mon, 4 Jul 2022 10:44:35 -0500") Message-ID: <87let4aty7.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2022 08:29:27 -0000 Hello Guillermo, "Guillermo E. Martinez via Libabigail" a =C3=A9crit: > Hello, > > This patch add a new option to kmidiff tool to compare Kernel trees > with CTF debug information. Please let me know your thoughts. Thanks a lot for this great patch! I have just added the ChangeLog part to its commit log and applied to the master branch, thanks again! Please find below the patch that was applied. Cheers, >From 68f369f2182fe1f1fce5434111ced1742b27b31c Mon Sep 17 00:00:00 2001 From: "Guillermo E. Martinez via Libabigail" Date: Mon, 4 Jul 2022 10:44:35 -0500 Subject: [PATCH] kmidiff: Add CTF support to comparing Kernel trees This patch adds a new --ctf option to kmidiff to make it support CTF type information when analysing Linux Kernel trees. * doc/manuals/kmidiff.rst: Add documentation for the new --ctf option. * tools/kmidiff.cc (options::use_ctf): Define new data member. (display_usage): Add a help string for the --ctf option. (main): Adjust call to pass build_corpus_group_from_kernel_dist_under with origin being corpus::CTF_ORIGIN when the user provides the --ctf option. Signed-off-by: Guillermo E. Martinez Signed-off-by: Dodji Seketeli --- doc/manuals/kmidiff.rst | 4 ++++ tools/kmidiff.cc | 25 +++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/doc/manuals/kmidiff.rst b/doc/manuals/kmidiff.rst index 011dbafd..ce8168ae 100644 --- a/doc/manuals/kmidiff.rst +++ b/doc/manuals/kmidiff.rst @@ -165,6 +165,10 @@ Options the :ref:`default suppression specification files ` are loaded . =20 + * ``--ctf`` + + Extract ABI information from CTF debug information, if present in + the Kernel and Modules. =20 * ``--impacted-interfaces | -i`` =20 diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc index d89026f9..8fd3fed9 100644 --- a/tools/kmidiff.cc +++ b/tools/kmidiff.cc @@ -9,6 +9,7 @@ /// /// The source code of the Kernel Module Interface Diff tool. =20 +#include "config.h" #include #include #include @@ -59,6 +60,9 @@ struct options bool show_hexadecimal_values; bool show_offsets_sizes_in_bits; bool show_impacted_interfaces; +#ifdef WITH_CTF + bool use_ctf; +#endif string wrong_option; string kernel_dist_root1; string kernel_dist_root2; @@ -80,6 +84,10 @@ struct options show_hexadecimal_values(true), show_offsets_sizes_in_bits(false), show_impacted_interfaces(false) +#ifdef WITH_CTF + , + use_ctf(false) +#endif {} }; // end struct options. =20 @@ -106,6 +114,9 @@ display_usage(const string& prog_name, ostream& out) << " --suppressions|--suppr specify a suppression file\n" << " --kmi-whitelist|-w path to a kernel module interface " "whitelist\n" +#ifdef WITH_CTF + << " --ctf use CTF instead of DWARF in ELF files\n" +#endif << " --impacted-interfaces|-i show interfaces impacted by ABI changes= \n" << " --full-impact|-f show the full impact of changes on top-most " "interfaces\n" @@ -241,6 +252,10 @@ parse_command_line(int argc, char* argv[], options& op= ts) opts.suppression_paths.push_back(argv[j]); ++i; } +#ifdef WITH_CTF + else if (!strcmp(argv[i], "--ctf")) + opts.use_ctf =3D true; +#endif else if (!strcmp(argv[i], "--impacted-interfaces") || !strcmp(argv[i], "-i")) opts.show_impacted_interfaces =3D true; @@ -395,6 +410,12 @@ main(int argc, char* argv[]) =20 corpus_group_sptr group1, group2; string debug_info_root_dir; + corpus::origin origin =3D +#ifdef WITH_CTF + opts.use_ctf ? corpus::CTF_ORIGIN : +#endif + corpus::DWARF_ORIGIN; + if (!opts.kernel_dist_root1.empty()) { file_type ftype =3D guess_file_type(opts.kernel_dist_root1); @@ -412,7 +433,7 @@ main(int argc, char* argv[]) opts.kabi_whitelist_paths, opts.read_time_supprs, opts.verbose, - env); + env, origin); print_kernel_dist_binary_paths_under(opts.kernel_dist_root1, opts); } else if (ftype =3D=3D FILE_TYPE_XML_CORPUS_GROUP) @@ -438,7 +459,7 @@ main(int argc, char* argv[]) opts.kabi_whitelist_paths, opts.read_time_supprs, opts.verbose, - env); + env, origin); print_kernel_dist_binary_paths_under(opts.kernel_dist_root2, opts); } else if (ftype =3D=3D FILE_TYPE_XML_CORPUS_GROUP) --=20 2.36.1 --=20 Dodji