From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91175A0032; Tue, 13 Sep 2022 16:17:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82F3E41133; Tue, 13 Sep 2022 16:17:33 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 6581D40151 for ; Tue, 13 Sep 2022 16:17:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663078651; x=1694614651; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=nWXVZg8yk3i6DLbpYzE/2JCK8KPsl1xt5SxouccXTzg=; b=Y7QzICrjnYvTOqfX5c6shDW4v+p6YCTpoWNZ/pRhmMs5m0sPi/T5GhVs VKDJxpUKlXil1ECvv9CaDq5hBppsOJ4UlegrQDKgnOJ/uyWFwKqfeyzOc zb6Lq5270SkjKgHMuWaRpNMQiNbrAVasXDKRe2c4DgHKDEv/VEBk4o8YM I+TUyw73tor+zjGius23PjW50Jr47EGdQ1fS7s1Ojw+8qcEpUTfXy8fFt luMn3GblX6GLXv7d2y7fziXmJZlGUf1aLpjdgwL8oEWjNTF0laFejaIS+ JQu5R2/D8AU0oFH2f+7DTCtZnY9rZv7A13XHInu0xgyzBqfNV1FkwIPxQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10469"; a="281164155" X-IronPort-AV: E=Sophos;i="5.93,313,1654585200"; d="scan'208";a="281164155" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2022 07:17:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,313,1654585200"; d="scan'208";a="649669467" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 13 Sep 2022 07:17:26 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 13 Sep 2022 07:17:25 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 13 Sep 2022 07:17:25 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 13 Sep 2022 07:17:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1E7gsRc6UJaKEYT8OB5SRXRM4+bG2JREwL2eYUFwPvg87FLJby1CFTiPmByD9DpaZkGyjS/Abc92UFX69xOVevQGXSwcVSvUGlRC4GHDyZFk4k6ettGBuXu24nVvFOB4lXHu++2C7uG6nhJKPZa327JXIDMlvmUoHKsPgDvQdSd4mPXbK8a1lqkLmUoDfz27Ri0unEVGKJ7JErq1bne3sEkJm0BmGGtXiL37regTTDAWHkhFly5CZuai0OiKJSYzIhkUWEfV01G6fy78/Yq5sgCM/Ei+XCZhzCBPP2ozQ7oIMLtitwsWogqxs+TN2mbzsSzFInEx/QeaA+iBx3jBQ== 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=mH6F9jKdV8FNTDJ8sZXPe2nCcCPBPrQIZYhypAoYnec=; b=LxYkwWfnmNc57VEbxUART9g32BM+2XgK8UoR6kL9MKxef23fcGs4mBLxpqZHPWnpTEHx6YFLO9mjrzkFrwCzR3BvW/Rbfxp19GAx+v2z0jDNuws9GCGE5WrkBFTHNqva5OU3NyOJCrg2JWkKBsozL+YgTyLmT5kWJRaTzhQ5EUN5wCr7nNNe+PUKXc1rHtymCr6TZNt2ZvJrHvLD4sAHoVYcfD/R6Tz7GFgAjb2v/hIYNZm1WZq88r/njF7Ru0OzpiA8F+MjBjNm1QTl+Sly5QVHAIIsxoVCQhdDUfS5YEc4v4jkIPUMAYJU2xf97sxgrB3zFRyfr5JSga1NGqX8eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by DS7PR11MB6080.namprd11.prod.outlook.com (2603:10b6:8:84::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.19; Tue, 13 Sep 2022 14:17:22 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2%6]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 14:17:21 +0000 Date: Tue, 13 Sep 2022 15:17:15 +0100 From: Bruce Richardson To: Robin Jarry CC: , Olivier Matz Subject: Re: [PATCH] usertools: rewrite pmdinfo Message-ID: References: <20220913105811.84384-1-robin@jarry.cc> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220913105811.84384-1-robin@jarry.cc> X-ClientProxiedBy: DB8PR09CA0020.eurprd09.prod.outlook.com (2603:10a6:10:a0::33) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|DS7PR11MB6080:EE_ X-MS-Office365-Filtering-Correlation-Id: 59f37717-3896-4020-3e01-08da9592ac3f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /0tysmjUP2anrvau/2yzQkz7Q4ReKQ+yNHxEmS+V6SP09d3kjyA9Qf038YkOzN+wuZXRRBLJ8j+EHX9TCRP+GxU629iaDfn28pATZmDjVGNJM1Zy2QqAG+NX5HmU5k+rbjE3BmPrnF1Q6uIN3H6wV1sgFafw7ErG3rKKjCBp16HlsMrgcCe7A7auIHiSWH/vQQHL41Ap9ucR0gfoykjotqviYyvabFqjdRo97Nf4C4c9K/PhpI0BmGHIGhdvcGRbHM8IhAP2SwiO16VWGC6zObDvd5thUl/dhP0ENGO3XTNz+TrBfkKahuA4nOD2Z04GZp16bYPJxUjIBRG13AOUm0eYlMsQpnKp1aNjDoRSm4/vxPYr+pFtQHvqZPB+eg5pNhvCzon3epWoNJUzXyj7LE0yeJxX1s+XbcqLOeqcqSUHxCXgcqaxFNv5Hnuk8QqoXBZQMDJw2VtL9AqQ4TlLzwuO3D4Bw3qLSZ6fxpAt2ritqjT5NqZUcOUwsLqNsyRp4CPurGfdkH1VGDZ1psuUI4d78ENzYUsgjr9s/Li9WxSL8HUL9/eflYJCSJiDRZbEaEm5azN8HxMDAe59GakZsDSQLLu3/kigp6PlmWk8mBj3h5dvsp0vE5LJVKuBdghDUIBx2mAkRikKG0BjuAOaTnm96q2NZlWFg6W4OcWtTda8IZmW+YDaxytFJkLbQyAHTBLSzA+ZlTgEVVZ8ZwRG7g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(396003)(366004)(376002)(346002)(451199015)(8936002)(82960400001)(41300700001)(86362001)(4326008)(66556008)(66476007)(66946007)(6506007)(8676002)(6486002)(6512007)(26005)(6666004)(44832011)(38100700002)(186003)(478600001)(2906002)(6916009)(316002)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2ww69a6zE1GMSYyghkb+/RLtJOH4UIdS418pSF33QG8D/bwPE6MdshMMDV4c?= =?us-ascii?Q?gOa27/51QfoQgUxVXx3DfuG9ay+bA8cSLv0GnpmfYyu8+q4iri9EZ+YJD1M1?= =?us-ascii?Q?P3D5Vp58GIQPtZZboWTMmoUfHbJvtX1eQhrdd4SgYi36By3mWoI1BS5ovrcB?= =?us-ascii?Q?/uH/+EuU8VpB1LmHnoDDyabjsaX+SUMP+Il9mR5vkpruwyZMNwpsYa511rJN?= =?us-ascii?Q?c2DKSOgSnLGCI91bCxCawsxQYTUvjLnvvYgtPGfkIvLK779p2AbY9mgeMSz/?= =?us-ascii?Q?YreSU63DgJGpjqZYsvM0zLQlnuAJhj1No2DtI5FKry7J38g0Tnxq3eWKr6pQ?= =?us-ascii?Q?LadlGH8AlO8RoMdhvqoVSAFfp6r9OJM+KSuzJWJsPjsWNKWv6OKyq2RS/77c?= =?us-ascii?Q?2HmHYrhCuDzWJ7TTdLDMgHV0UKBH3f7S/qNW+WS+7QUeEvmAMCVKebYE31WI?= =?us-ascii?Q?nOUsTQnU5zlpHGiOS+5n9TZyFOtWe26ME+G9DmLtyzXRHcUxz2fhrQTir248?= =?us-ascii?Q?IPCw8zg+XTZJhl+GXE0SYoeRM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jz2Jz951WNIsmr01Pt9Pyhma0Kbpas0ZKB6BNE4tgyxvrj21xNmN/z?= =?us-ascii?Q?DUNj6+COAakprV2ze5ITDTLT+R97A631s1pkEANrC/3T7eUEnylNpts72gvP?= =?us-ascii?Q?sJo33oCqJEhC6vsRoJNL7Wag7iZ5pIUnwCWC3RBy8vFLq0/trMJciXA5ZTY1?= =?us-ascii?Q?7A=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 59f37717-3896-4020-3e01-08da9592ac3f X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 14:17:21.7373 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YckbTzqVA+v9RIIXWF5Q7nKZ4sK+XmjqA+hzbvXedPeYx9a0fqCP6dloOUwKhFrD0Vhxzr3C+o1auzewHSFf5CvfDAg2IZawcwKo1gyY0r8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB6080 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Sep 13, 2022 at 12:58:11PM +0200, Robin Jarry wrote: > dpdk-pmdinfo.py does not produce any parseable output. The -r/--raw flag > merely prints multiple independent JSON lines which cannot be fed > directly to any JSON parser. Moreover, the script complexity is rather > high for such a simple task: extracting PMD_INFO_STRING from .rodata ELF > sections. Rewrite it so that it can produce valid JSON. > > Remove the PCI database parsing for PCI-ID to Vendor-Device names > conversion. This should be done by external scripts (if really needed). > Thanks for the rework. Comment inline below. /Bruce > + :raises FileNotFoundError: > + """ > + folders = [] > + if "LD_LIBRARY_PATH" in os.environ: > + folders += os.environ["LD_LIBRARY_PATH"].split(":") > + folders += ["/usr/lib64", "/lib64", "/usr/lib", "/lib"] This is a standard set of folders for Redhat and similar based distributions, but not for Ubuntu and Debian ones - which use e.g. "/lib/x86_64-linux-gnu". It's also missing path options from /usr/local, which is a likely location for a compiled and installed DPDK. Ideally, the script would parse the entries from /etc/ld.so.conf, or /etc/ld.so.conf.d/* files to get a full list of directories to search on the system. Frankly, though, that seems like too much work. :-) Two ideas I'd suggest, though both involve shelling out to other commands: * Call "ldd" to get the paths to the relevant libraries for the current object, rather than parsing the DT_NEEDED entries from the elf file in the script * Use "ldconfig -p" to get the list of libs and paths for the script and use that for matching the DT_NEEDED entries.