Message ID | 20230306155038.3316079-1-guillermo.e.martinez@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <libabigail-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 041B73858438 for <patchwork@sourceware.org>; Mon, 6 Mar 2023 15:51:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 041B73858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678117862; bh=qQu92xEKhv/t1UIjaKQt9mWr58qoDSwyFhiLTolfy0Q=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Help:List-Subscribe:From:Reply-To:From; b=VAJ9PxJllr9jfailzVEbIpAbgYsRJ22UkDq0WPGStAfGH8c/Q715Uecj4EF175cZG OiNzWAtebUBNwe1TZFrdbrlyj4uwfHwZy1BJPgcB+Ba/gxi5QuGe18QG5iXxzYx6s4 gooCeZzwRY/An4jcGFavmgR3FSeO0mtcqIIHvYzE= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 528E23858D39 for <libabigail@sourceware.org>; Mon, 6 Mar 2023 15:50:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 528E23858D39 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 326CxEHt017783 for <libabigail@sourceware.org>; Mon, 6 Mar 2023 15:50:54 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p415636ue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <libabigail@sourceware.org>; Mon, 06 Mar 2023 15:50:53 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 326ELpH1019137 for <libabigail@sourceware.org>; Mon, 6 Mar 2023 15:50:52 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p4tupxa7j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <libabigail@sourceware.org>; Mon, 06 Mar 2023 15:50:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PANvQqumNdq2TANxBIcOkT57ZtmPGPUTqV3WmKCCbRMcDfHzoJKaQt4F0nw9rYin6KqYcC+dplD9vi9u7rfM1hlL5cPoScLvVUnOaVESsYdRG6bwnsXlPV/bH1FHUDtEGH/zCd7ftzGiW7R1AG/2sO0hpeQ7Zal+H+eG+zSdFSq/ONjRVs81xCgNuX2OaUgEXXQ6nPgCA3qyyqySOGPAkKwXeR+p5W31cz4HJJxR1CpQr0fks2ASo6Op+itvlaVeT+/TyWSEYAWvjo6BiQvTNQYQ7KYjUCN3taxLec6oVSI6hCG4jHvtE4h0tdMmU3PNvlPaJiCzdAKJ4192NLkv+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qQu92xEKhv/t1UIjaKQt9mWr58qoDSwyFhiLTolfy0Q=; b=IuEEwa8CDvvM0j2raM2namEpCvueNjd6AGST96ILCGSSkvZnbrzEta5w+lsm1UcdFg4AlOi+y1epEm9N4IZl7tyID6N5WvOpEv3epPgVzts+HE10xtQP6l2ViQSD3C0W7Qi5ZNDa/N+ZP5SXZiWNh0AbjY8bQUl0ElF7MICwqeVhgZDWTt85r2KZlGJ7FRnncrJtoLNyKkgHxM8DxZtCR/0ak8ODba26R1F19qki/P3fqyt1qEBiwRLSb5UnjHqeOT7w9RpfA/YkTE2WGzKwIGmxOOjvWLEFvJFQSeD4rRbqLZhHSsCnjqbFB9zYZRhHZy0XrxmSJ1oNDokiCjKNyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) by DS0PR10MB6726.namprd10.prod.outlook.com (2603:10b6:8:139::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 15:50:50 +0000 Received: from MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::480f:b0b1:2e28:546e]) by MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::480f:b0b1:2e28:546e%7]) with mapi id 15.20.6156.028; Mon, 6 Mar 2023 15:50:50 +0000 To: libabigail@sourceware.org Cc: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> Subject: [PATCH] tools-utils: Looks for vmlinux binary in RPM debug package Date: Mon, 6 Mar 2023 09:50:38 -0600 Message-Id: <20230306155038.3316079-1-guillermo.e.martinez@oracle.com> X-Mailer: git-send-email 2.39.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN6PR16CA0054.namprd16.prod.outlook.com (2603:10b6:805:ca::31) To MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR10MB1407:EE_|DS0PR10MB6726:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bf2b12a-02a5-4b71-28cf-08db1e5a8f09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YCxvDLTYhoSqTRvpltTjEqKp5RNsfKpUYrGad6cFRcxC991/PID3qTwAFUIlkJTyMq+mYcZ5njkUicChLw8YUW+EEd2YRjMIWqG8TObGwbYOU5INeOIocZVuMTNCStQelqxc07VJ3kGuJL64dDh3JZrhUhTcESW/KRMqmY0oi0iR8RBCNtORYCanDOjQn+0yQhvxprMZUpMWiH1Rt5ihii+cZXryYUeCCZqSw+NrpujzFLFueW204F4/A55ElNWTRP66LyYSWdUjdwbW1Z51n/VAa85LroQuyqFCHbkNXXfg7Om33na+2IKm59vC/MvPfq120XajFnJ9L3lbtO0pC5OOFvKDyvJvVE5L7VdovxpJkzoUJ6l/PgAPl8haxaOlTdqiaDmvktTy4a/8bllYUiYyW+WC0PBqGKwGUEiqVDWxlkHzG1rbcXG5i3qx7HD9WZbDhkoPQAoa1d2j0armZN5sQNsF36E3clyD4m4FpsVO7EY+O7EIVlTsFDDk9Y/B33+PBS+IYX58kef0WcTR5tVBSwVLP41/HyRH/4sJBZZMU93uN3IEQOnWuC5WFjmZ4otNx6R4MCBUKX/ioaPHZltyDXsJY/EzT5cXCqSprId15kTsdo2lNTSCS8SjumPQM0+JujN82ZQxk/1/XAST/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR10MB1407.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(39860400002)(136003)(366004)(376002)(396003)(451199018)(1076003)(6512007)(6506007)(6486002)(107886003)(6666004)(36756003)(83380400001)(86362001)(38100700002)(186003)(2616005)(66946007)(66476007)(41300700001)(4326008)(8676002)(6916009)(2906002)(66556008)(8936002)(5660300002)(478600001)(316002)(103116003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: agJxdzb/ibgmEL4TxuAiUxia6agcKsTpFTy9JA6WOheb2MB9idMqn0jP1mM1Ss2AJzucO7dO/hArf4Oh3A5LzHJe/vgIPEGP4yPkq5hRofOPlFkvdldLGlbtv5Ojv/K2vfCfkq4zoLWaJmjPSLRNcz18iUVFfYw2AgetBpAuD0qX5PX2LZOb/a1Khv+IgRrgDKyjiA4ziSlWvk+CM+tCuOZMS//sQYZnh5F+Ytf7rAr4OIzWhABs92TGV/Zg+tOoZfJbNZxaFQe5AHI+2bZ/QwWxjIn7mARJVJmDP0uZ+KgtWUVMxc4/tb4s8+T7lgUMSZcSAxDIydWUOej52pzh/Ggrm4J6JTI1xAgCqNDBSWTKKdcw190q6IOCkMowqYemBTORavDaTcDEy5m27I/NJYkEdgHiSZbXoQcnPbqEEqqU47gRI11q3iI6ArAAaKSLhcsXVDku8aOkCUBBt5kc/U5rYLGj1D7S5jBkI/l1CTv1YhaoF+pzJCpwhZMRx7dOnFzy52wRvoAdxFATCaVFxMsUbNfKG9vZl/sloZNhWgH050lNrwRIzmSmrJyGR5/Dx3kupfaCABBftmEzBY1Z1izxSgbjLweyfPYKMpB2kPPoUoO2lVELOosFsQQfEFeBtXYm5FN2yQxn/b/xWwiYddVcA0P2xsR7pEhR1FqH1Iupf1E2wk7wBIbd6w0JaVTl27vgB31uqIGjfdz6FRpvN7RBbS8v97uSDYVK7UurDRrpMsyXMq9OI4g/DAPugvZ9vrjfAZt5phY8Skk1esw1zyOJ8VzEcBVsBxayOE6KlnmRwBIbwabV5BO5V0DmhuDy5rundbonGYU5S1xkJso3FsNpPRxm6pGd/U+aqwnPQpiiBgloML4gYKRq2DQgTItOR06Mhp14xb1koGEJoX2dQAf6uZ/pN0sjiCx5DJxYCtAUKb/ySWKUgHUTp4xNHUgFJvwulD8q2XOizl7OiG8kNruUOAlfCOTt9uqI4uzQpREo3wB/VvalGJyFcS2lIfcUZhXJI54xoIlmYcc0/qik3Yp03/5Az6iVWzN1iOLbHgqVXjAxyVp9iCmRdomn6ACXkhlVoslDYyYtj5nfZwMrKrSdmrFIxjeT4UkI3+na5jv6o1JuSD/XSxzYlOM5nMYYqqIDhPHp2FpOCl1jtwVlJtIKElNGkcJza641QeZyhDTeqpSIgcmy61wlkm5hNkHACyChnvonWfzaUdsW5v17XIfQYJQ54uhSyWaE/BEDqbQFzQWTzCThGPiP8reDhyPtM/NREZzerrSZVAaMwSbLSCopkNbqG/Sg2nvSqvQSUzDX82D8NMDAofWvj+ovdVIP996Ziuio06AaJ1hhZZ1lm+5owhEZX6Wj+4Xo5cQrJeeAaUlCy/VRGuFIkfip+4qcepTaeWSRa6nTt5CS3lO/1gTc4oojdqTxLmneCvMGDnjaYAGk3Xmr104rLZwjZD/ElKreLvuBUGDZF5e6tFpOR1ssp32qpZ0j6OLsAQ1y6SKRhzvR3aUdZT8zEgPtI54k0IdxQsAV5Hz43jAKO7Hm6Jiuc+IQEzWn3Y+dZh0Nms69tlET028Ga+ssXBfPkSsnJP3bsQgWMzmIhVS68FEzf951HFkOsSDFfpQ9jExsPQvAIPriohUCGb4ItA3PMq1B7RdH/j476Wp8hizI+vIhbGj8MO2IyjdSGIbbh3XlIGY= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: d2l3H1NB32Okk5DCvtVk8dbTqHJAy/NQVQxSREPeQH7PGgc0ZuYqRc+NWlDqMGXM2Uy7rqO1icTuYb0wdtVErN+LqkqvEvbpnshaoHGCG2O2dzJ+4dHdo6nNBf+kX8DQ1wWwTCGuifhVU135UtkE+34s7/lwlOnRCcIZjn7jAZfhk5+nRr5BbEx7j+Q0Pjr4Xv5YWGir3gfPa3utWEh7s44dinuymamVAJRApgq4ylDJ+7jfQmoyv3VAT6QvaIsgShA4JpA3oAp+XPmx70YNtQTMrxONwmJcgd0VxgzN9RsmNHR6U2aGfJ9j4rwy2xyRD6HlsZ9DJl0ULIzRSQs6pUjkECasB79Ln1H8BB82ntXuAwsFmCcBVP2o+nIlnOb5Wdlh7EYSilfR8TVFiDWXVCXlqGPNcmMrG7rLLuYU4VyejTfRbPp32FxEEGv4AQrBC7ChQRA5a9Lr+nb7OYDhqBVJyxzMr4vNMlxI3Sytot7gFQjEJ3/G3hc7dIWxRXj8Mb9CpcZtQMMU+vPmXKBldM2cGuZRr++mvjPclduqLPi5NuSrS/AXgnWYl1RjXfwGgLBioNeTBchZvOOQY5tWq1X4LW08LJO6LpS+2QImswRXDB4Y1nMPe0x5WZq7h1kTyhPTgi2p8CoPh6Rns/o0vdQGXRJGMFzNkaUNq57ZGmnpDpfDFlYJg0Y/EEHEig7C3wg0BqQkxI7Clha3//6Yg7yJM1TZ53C8lQ2JfbptldzNpjA7gAgPMzSb1IR7yRxz X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bf2b12a-02a5-4b71-28cf-08db1e5a8f09 X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1407.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 15:50:50.0564 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m6++xKadzrEbxNli7/zTO/AknuXPS5gfHlhV8YMhznCd8rGMqjp9YYCnxihZ2DRby51F1oKKyFJXn1Qb31lShhJtAGi872veMvj5LUro8Wg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6726 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-06_08,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=976 bulkscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303060140 X-Proofpoint-GUID: yu7rYrXy732VkgjXJCLDwQ7hBdMsnDX_ X-Proofpoint-ORIG-GUID: yu7rYrXy732VkgjXJCLDwQ7hBdMsnDX_ X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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 <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> From: "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> Reply-To: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" <libabigail-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
tools-utils: Looks for vmlinux binary in RPM debug package
|
|
Commit Message
Guillermo E. Martinez
March 6, 2023, 3:50 p.m. UTC
When Libabigail tools work with a `kernel' package, it looks for
`vmlinux' file in release RPM uncompress directory, if it is not
found, then try find it in `debug_info_root' directory.
* src/abg-tools-utils.cc
(get_binary_paths_from_kernel_dist): Add `debug_info_root' if
`vmlinux' file is not found in `dist_root' directory.
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
src/abg-tools-utils.cc | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Comments
Hello, "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a écrit: I looked at the two patches you sent and I am proposing a third one which is kind of a merge of the two ;-) > In `abipkgdiff' working with a `kernel' package, the function > `get_vmlinux_path_from_kernel_dist' that looks for `vmlinux' file > in never reached, due to check an useless predicate. > > * tools/abipkgdiff.cc > (compare_prepared_linux_kernel_packages): Remove useless predicate. [...] > diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc > index c2fc09ca..46b920a1 100644 > --- a/tools/abipkgdiff.cc > +++ b/tools/abipkgdiff.cc > @@ -3106,8 +3106,7 @@ compare_prepared_linux_kernel_packages(package& first_package, > > string vmlinux_path1, vmlinux_path2; > > - if (!vmlinux_path1.empty() > - && !get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) > + if (!get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) Right, thanks for fixing the thinko there! > { > emit_prefix("abipkgdiff", cerr) > << "Could not find vmlinux in debuginfo package '" > @@ -3116,8 +3115,7 @@ compare_prepared_linux_kernel_packages(package& first_package, > return abigail::tools_utils::ABIDIFF_ERROR; > } > > - if (!vmlinux_path2.empty() > - && !get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) > + if (!get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) > { Likewise. > emit_prefix("abipkgdiff", cerr) > << "Could not find vmlinux in debuginfo package '" [...] > When Libabigail tools work with a `kernel' package, it looks for > `vmlinux' file in release RPM uncompress directory, if it is not > found, then try find it in `debug_info_root' directory. > > * src/abg-tools-utils.cc > (get_binary_paths_from_kernel_dist): Add `debug_info_root' if > `vmlinux' file is not found in `dist_root' directory. [...] > diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc > index 94dd8d05..8493ae90 100644 > --- a/src/abg-tools-utils.cc > +++ b/src/abg-tools-utils.cc > @@ -2572,20 +2572,16 @@ get_binary_paths_from_kernel_dist(const string& dist_root, > string kernel_modules_root; > string debug_info_root; > if (dir_exists(dist_root + "/lib/modules")) > - { > - dist_root + "/lib/modules"; > debug_info_root = debug_info_root_path.empty() > - ? dist_root > + ? dist_root + "/usr/lib/debug" > : debug_info_root_path; > - debug_info_root += "/usr/lib/debug"; > - } Here is how I am changing this finally: if (dir_exists(dist_root + "/lib/modules")) { kernel_modules_root = dist_root + "/lib/modules"; debug_info_root = debug_info_root_path.empty() ? dist_root + "/usr/lib/debug" : debug_info_root_path; } This is because kernel_modules_root is thus going to be used below ... [...] > bool found = false; > - string from = dist_root; > - if (find_vmlinux_and_module_paths(from, vmlinux_path, module_paths)) > + if (find_vmlinux_and_module_paths(dist_root, vmlinux_path, module_paths) || > + find_vmlinux_and_module_paths(debug_info_root, vmlinux_path, module_paths)) > found = true; ... Like this: // If vmlinux_path is empty, we want to look for it under // debug_info_root, because this is where Enterprise Linux packages // put it. Modules however are to be looked for under // kernel_modules_root. if (// So, Let's look for modules under kernel_modules_root ... find_vmlinux_and_module_paths(kernel_modules_root, vmlinux_path, module_paths) // ... and if vmlinux_path is empty, look for vmlinux under the // debug info root. || find_vmlinux_and_module_paths(debug_info_root, vmlinux_path, module_paths)) found = true; [...] So, below is the resulting patch. Could you please test it in your environment and tell me if it works for you, the way you expect it? Thanks. From dc375bd1b7f15f41665f002ec61f68ce1e7ff889 Mon Sep 17 00:00:00 2001 From: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> Date: Mon, 6 Mar 2023 09:50:38 -0600 Subject: [PATCH] tools-utils: Fix looking for vmlinux binary in debuginfo package When abipkgdiff is invoked on a `kernel' package, compare_prepared_linux_kernel_packages fails to look for the `vmlinux' file from the debuginfo package, because of a thinko. Then, build_corpus_group_from_kernel_dist_under, also fails to find `vmlinux' from the debuginfo package because of another thinko. This patch fixes the two thinkos. * src/abg-tools-utils.cc (get_binary_paths_from_kernel_dist): Fix a thinko and really use the kernel_modules_root variable. Look for modules under kernel_modules_root and look for vmlinux (if necessary) under debug_info_root. Add comments. (compare_prepared_linux_kernel_packages): Fix another thinko. Now we do have the path to vmlinux, from debuginfo packages before getting into get_binary_paths_from_kernel_dist. Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> --- src/abg-tools-utils.cc | 20 +++++++++++++++----- tools/abipkgdiff.cc | 6 ++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 94dd8d05..87af4445 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -2573,19 +2573,29 @@ get_binary_paths_from_kernel_dist(const string& dist_root, string debug_info_root; if (dir_exists(dist_root + "/lib/modules")) { - dist_root + "/lib/modules"; + kernel_modules_root = dist_root + "/lib/modules"; debug_info_root = debug_info_root_path.empty() - ? dist_root + ? dist_root + "/usr/lib/debug" : debug_info_root_path; - debug_info_root += "/usr/lib/debug"; } if (dir_is_empty(debug_info_root)) debug_info_root.clear(); bool found = false; - string from = dist_root; - if (find_vmlinux_and_module_paths(from, vmlinux_path, module_paths)) + // If vmlinux_path is empty, we want to look for it under + // debug_info_root, because this is where Enterprise Linux packages + // put it. Modules however are to be looked for under + // kernel_modules_root. + if (// So, Let's look for modules under kernel_modules_root ... + find_vmlinux_and_module_paths(kernel_modules_root, + vmlinux_path, + module_paths) + // ... and if vmlinux_path is empty, look for vmlinux under the + // debug info root. + || find_vmlinux_and_module_paths(debug_info_root, + vmlinux_path, + module_paths)) found = true; std::sort(module_paths.begin(), module_paths.end()); diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index c2fc09ca..46b920a1 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -3106,8 +3106,7 @@ compare_prepared_linux_kernel_packages(package& first_package, string vmlinux_path1, vmlinux_path2; - if (!vmlinux_path1.empty() - && !get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) + if (!get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) { emit_prefix("abipkgdiff", cerr) << "Could not find vmlinux in debuginfo package '" @@ -3116,8 +3115,7 @@ compare_prepared_linux_kernel_packages(package& first_package, return abigail::tools_utils::ABIDIFF_ERROR; } - if (!vmlinux_path2.empty() - && !get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) + if (!get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) { emit_prefix("abipkgdiff", cerr) << "Could not find vmlinux in debuginfo package '"
On Wed, Mar 08, 2023 at 03:34:24PM +0100, Dodji Seketeli wrote: > Hello, > Hello, > "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a > écrit: > > I looked at the two patches you sent and I am proposing a third one > which is kind of a merge of the two ;-) > > > In `abipkgdiff' working with a `kernel' package, the function > > `get_vmlinux_path_from_kernel_dist' that looks for `vmlinux' file > > in never reached, due to check an useless predicate. > > > > * tools/abipkgdiff.cc > > (compare_prepared_linux_kernel_packages): Remove useless predicate. > > [...] > > > diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc > > index c2fc09ca..46b920a1 100644 > > --- a/tools/abipkgdiff.cc > > +++ b/tools/abipkgdiff.cc > > @@ -3106,8 +3106,7 @@ compare_prepared_linux_kernel_packages(package& first_package, > > > > string vmlinux_path1, vmlinux_path2; > > > > - if (!vmlinux_path1.empty() > > - && !get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) > > + if (!get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) > > Right, thanks for fixing the thinko there! > Actually you point me about it. :-). > > { > > emit_prefix("abipkgdiff", cerr) > > << "Could not find vmlinux in debuginfo package '" > > @@ -3116,8 +3115,7 @@ compare_prepared_linux_kernel_packages(package& first_package, > > return abigail::tools_utils::ABIDIFF_ERROR; > > } > > > > - if (!vmlinux_path2.empty() > > - && !get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) > > + if (!get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) > > { > > Likewise. > > > emit_prefix("abipkgdiff", cerr) > > << "Could not find vmlinux in debuginfo package '" > > [...] > > > When Libabigail tools work with a `kernel' package, it looks for > > `vmlinux' file in release RPM uncompress directory, if it is not > > found, then try find it in `debug_info_root' directory. > > > > * src/abg-tools-utils.cc > > (get_binary_paths_from_kernel_dist): Add `debug_info_root' if > > `vmlinux' file is not found in `dist_root' directory. > > [...] > > > diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc > > index 94dd8d05..8493ae90 100644 > > --- a/src/abg-tools-utils.cc > > +++ b/src/abg-tools-utils.cc > > @@ -2572,20 +2572,16 @@ get_binary_paths_from_kernel_dist(const string& dist_root, > > string kernel_modules_root; > > string debug_info_root; > > if (dir_exists(dist_root + "/lib/modules")) > > - { > > - dist_root + "/lib/modules"; > > debug_info_root = debug_info_root_path.empty() > > - ? dist_root > > + ? dist_root + "/usr/lib/debug" > > : debug_info_root_path; > > - debug_info_root += "/usr/lib/debug"; > > - } > > Here is how I am changing this finally: > > if (dir_exists(dist_root + "/lib/modules")) > { > kernel_modules_root = dist_root + "/lib/modules"; > debug_info_root = debug_info_root_path.empty() > ? dist_root + "/usr/lib/debug" > : debug_info_root_path; > } > > This is because kernel_modules_root is thus going to be used below ... > > [...] > > > > bool found = false; > > - string from = dist_root; > > - if (find_vmlinux_and_module_paths(from, vmlinux_path, module_paths)) > > + if (find_vmlinux_and_module_paths(dist_root, vmlinux_path, module_paths) || > > + find_vmlinux_and_module_paths(debug_info_root, vmlinux_path, module_paths)) > > found = true; > > ... Like this: > > // If vmlinux_path is empty, we want to look for it under > // debug_info_root, because this is where Enterprise Linux packages > // put it. Modules however are to be looked for under > // kernel_modules_root. > if (// So, Let's look for modules under kernel_modules_root ... > find_vmlinux_and_module_paths(kernel_modules_root, > vmlinux_path, > module_paths) > // ... and if vmlinux_path is empty, look for vmlinux under the > // debug info root. > || find_vmlinux_and_module_paths(debug_info_root, > vmlinux_path, > module_paths)) > found = true; > > [...] > > So, below is the resulting patch. > > Could you please test it in your environment and tell me if it works for > you, the way you expect it? > Working as intended. > Thanks. > >[...] Thanks, guillermo
Hello, [...] > On Wed, Mar 08, 2023 at 03:34:24PM +0100, Dodji Seketeli wrote: >> So, below is the resulting patch. >> >> Could you please test it in your environment and tell me if it works for >> you, the way you expect it? "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> a écrit: > Working as intended. Dodji Seketeli <dodji@seketeli.org> a écrit: [...] > So, below is the resulting patch. [...] > From dc375bd1b7f15f41665f002ec61f68ce1e7ff889 Mon Sep 17 00:00:00 2001 > From: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> > Date: Mon, 6 Mar 2023 09:50:38 -0600 > Subject: [PATCH] tools-utils: Fix looking for vmlinux binary in debuginfo package > > When abipkgdiff is invoked on a `kernel' package, > compare_prepared_linux_kernel_packages fails to look for the `vmlinux' > file from the debuginfo package, because of a thinko. > > Then, build_corpus_group_from_kernel_dist_under, also fails to find > `vmlinux' from the debuginfo package because of another thinko. > > This patch fixes the two thinkos. > > * src/abg-tools-utils.cc > (get_binary_paths_from_kernel_dist): Fix a thinko and really use > the kernel_modules_root variable. Look for modules under > kernel_modules_root and look for vmlinux (if necessary) under > debug_info_root. Add comments. > (compare_prepared_linux_kernel_packages): Fix another thinko. Now > we do have the path to vmlinux, from debuginfo packages before > getting into get_binary_paths_from_kernel_dist. > > Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> > Signed-off-by: Dodji Seketeli <dodji@redhat.com> OK, I have just applied this patch to master. Thank you for time and effort. It's appreciated. [...] Cheers,
diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 94dd8d05..8493ae90 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -2572,20 +2572,16 @@ get_binary_paths_from_kernel_dist(const string& dist_root, string kernel_modules_root; string debug_info_root; if (dir_exists(dist_root + "/lib/modules")) - { - dist_root + "/lib/modules"; debug_info_root = debug_info_root_path.empty() - ? dist_root + ? dist_root + "/usr/lib/debug" : debug_info_root_path; - debug_info_root += "/usr/lib/debug"; - } if (dir_is_empty(debug_info_root)) debug_info_root.clear(); bool found = false; - string from = dist_root; - if (find_vmlinux_and_module_paths(from, vmlinux_path, module_paths)) + if (find_vmlinux_and_module_paths(dist_root, vmlinux_path, module_paths) || + find_vmlinux_and_module_paths(debug_info_root, vmlinux_path, module_paths)) found = true; std::sort(module_paths.begin(), module_paths.end());