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 23F23A00C2; Mon, 26 Sep 2022 17:17:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0856C41133; Mon, 26 Sep 2022 17:17:41 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id A80594069B for ; Mon, 26 Sep 2022 17:17:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664205458; x=1695741458; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=wGH7LdLOGXxXpoT/SpkJtBv/t3bWeuQ4D0HKnYOY5gs=; b=eOyhf/sOIai4d5y1WGT8jusWP15ZwjDgLyZRLKz66W9WjETt2GaxRGez 9QPzcI7FQkkzoXaT/JAvPgro2ZhklMFHyHkHI5vlxGUlaxoxH3DfAhad8 Z29qoCTeSSRLJoddadLD1b0M3gipynxyAHo3foKQQv2iqg+G7pU3vqHCU Lmz5wz2fSN0bF9pkg0k/dGqpnAz+J1xsSWp0XpiVJoErY9B8gQAGdRl5p R3a0tMF+UZk8NG0Ha1Ataizv5ReGnfK8DXd1gc4/bZKH93u27OgthcFwt mOH+yMlLCVpm2Zmm6iwnSPpeS2NiJvoOfX26En8nSUkY978+35/goac+a Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="298655392" X-IronPort-AV: E=Sophos;i="5.93,346,1654585200"; d="scan'208";a="298655392" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 08:17:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="616440533" X-IronPort-AV: E=Sophos;i="5.93,346,1654585200"; d="scan'208";a="616440533" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP; 26 Sep 2022 08:17:33 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 26 Sep 2022 08:17:33 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 26 Sep 2022 08:17:33 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 26 Sep 2022 08:17:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uzy9Z9YrKfGXjn0epdBxNvFBtjRtDpvtYRVPUU90aO3EGtrUta6GeiuYJCLNQnKxlG7UYExfmxcGezKB1icRxVgj5qa9FJma46d2z/JtWN/I0qVvZgAZzhbT0LVTtdT2xg23acW28k02oKVu+gTBUd/7JWRp9GD8ZHAtzZ5BzWByd+uUXnuZLRaJD5bJE645YZtRM9lJ7VHB0OAwu6szbjCCHRijttAusQGsBdquIrWogzpLWqYF33jkuXoJ4QkqRWM/i8LNRizhR2D2J/J/DU8vxqFoEOtwaLBbISowE2tv9oe/EV3tZ8T/vx+IyTvIuWkfnbBVhNatN2iwl4F7pg== 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=vnyXRvqx9xywnd0BvBz7hu77JyKShaqAcNFrYda6Pmw=; b=PmM4vJ18kNGkCV8Iox9+KGds00JrT43APwrEtyAr6Q3MWw9ltzXi9wYAUIFr4tmCc8hUpqP97knreGchEU8oKBZMnWwBmZBcTJBLMsAI3Gcgosk8PZ01EwcEfVIkF0WP/hDNQOTkY93TGtSyBCWHYz5fUejStQhpjgobKVhwSzTczpgZy9TZh6M9hCefK6nGI87aFtyKul0hZtv0E6kcKx8cFn4GKrzQLuZo9gqWjF5NjhBTAkqlelKGjMMfetqGz0bsDBg1cgQypYaA04QzBO1y7RjC23I+pOi1quKPbEQDeaKHpyw9Rf/bv9MFgrztwnqZleoNs7GjMBwRjTTCvA== 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 BN6PR11MB1618.namprd11.prod.outlook.com (2603:10b6:405:d::13) by DM6PR11MB4531.namprd11.prod.outlook.com (2603:10b6:5:2a5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Mon, 26 Sep 2022 15:17:30 +0000 Received: from BN6PR11MB1618.namprd11.prod.outlook.com ([fe80::3566:db5a:1e16:8d30]) by BN6PR11MB1618.namprd11.prod.outlook.com ([fe80::3566:db5a:1e16:8d30%11]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 15:17:30 +0000 Date: Mon, 26 Sep 2022 16:17:24 +0100 From: Bruce Richardson To: Robin Jarry CC: , Olivier Matz , Ferruh Yigit Subject: Re: [PATCH v6] usertools: rewrite pmdinfo Message-ID: References: <20220913105811.84384-1-robin@jarry.cc> <20220926134438.10906-1-rjarry@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220926134438.10906-1-rjarry@redhat.com> X-ClientProxiedBy: LO4P265CA0074.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bd::13) To BN6PR11MB1618.namprd11.prod.outlook.com (2603:10b6:405:d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR11MB1618:EE_|DM6PR11MB4531:EE_ X-MS-Office365-Filtering-Correlation-Id: 0843dd15-3670-49a4-28d0-08da9fd23a5c 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: O4Bh604HtcweDQSOrDEIKi5AaMZbzG2AnMTodvewS3HISY3J2XUyDVh6MXpvDv4KdFY2XzwYM0VL3ycqxWoxbQcAyOjZsj5Y3bSO/4TNO96JBJdT70ZSnAmddNSZpLr6ga7ytVVDJdECFyJq+Npfh3isZoBV9hW+88dlzwaIjGCEedmiWK9LDyuc6rcBabbWEMNC1C41zncw50DkohPrXoC0z3QJZaftpGs2TQIqLv5DC2nkYsla3ihF+bCBVc/iW8/2ufnvyXJGQrdff9Yal7wIgNAWFOaloR6VkqxGabY/4oh2KRxxQTSK39las7RdfAu5X3Pg0Hl6SAeZOZRTC9CLUJR5mE7oLEa47WEhsmcvnMhYqdlikXmavqksyRgT1gsn/giHWhg/C2DTf+cMJPpWrHTSC//xMmbztqdTMGlqR8eTM7RBvZsJNGRlbvTOdfTrCK4HagS/B+lU2/HF5lxnZzoKsPCUoeZyiu2g7hZilVCalAuW6TbmeU19YxZiapzG796P4oSVPzSP25TiFJ/PQAURiJSPBfC3HdYaOIaoeguos9Cwsve/vYbGo+zWXwpTpbq7wQnHIvKMcaATv1qMrKK3QNdareIt+oFUz9AZEw14Cg6sJJyWv9+ZOKLE5+/dheh8k6mX+0jnMbbQLHxYzVo1jX8NzN8hR2YU9al9DbkrqkErNKrwJagUznGbA3m0PULc+fVh5o1FK0UNMg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB1618.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(136003)(366004)(376002)(39860400002)(396003)(451199015)(6512007)(26005)(6506007)(82960400001)(38100700002)(86362001)(478600001)(6486002)(5660300002)(44832011)(2906002)(186003)(83380400001)(41300700001)(6666004)(8676002)(4326008)(66556008)(66946007)(66476007)(8936002)(6916009)(316002)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+KQg8Q8SM9fbou6CuuKzD16EP9YDlsLIeEeIfW2bUvEf0AUBnRixIA25R7/a?= =?us-ascii?Q?khQzIYmJIKwS/AVfZ43isrISknl/QZwErMeEnN/jMUlZauGVHqMPaxrz0TIz?= =?us-ascii?Q?ATyCNo4M8sZbmU6wteQm7MPSla0hm1kHWG89NAM8S02q2BZc2AuWUa/mY7K4?= =?us-ascii?Q?h/r5j2xGCPXp18qiktA4G3gdsP5xvv4F0kovzuiGra7DxHBmFa3yhtperOp6?= =?us-ascii?Q?GUZDm3hiDTCdGCG/0oEwytjYM9zPmtqDQDB9J3B9oUjeiRG4+26KFKRsP5xw?= =?us-ascii?Q?35lLRpxoMlM0LT2d2dbq85H8m3Qthw7EfTyQH75YoYHLruzo21at0gM1vfCM?= =?us-ascii?Q?qQdHtu9f/OmbBhBpG8KTAV09rz5TCl6+d6BaOsFiU0p3zRvhIAfMElXEF8MA?= =?us-ascii?Q?oOBLf5wNlIyrodubIk9QZG+h8oaUzZLGlZ2FR+c4L+Stj6KCnekYKPgIdGbN?= =?us-ascii?Q?fysdjJDol+vDbWowAmjlND8yy5kM+3JebhCCBBIGtMf0D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ELxBQXrKfRppIxCUANay1Q9zdpqhODcXHuK0/PUvZLaW5jVnFAal?= =?us-ascii?Q?74HOexgOnxj31RXZeIOGl9+QdSCA5Ck1Yleg89yRoXkLo0odAEd5K6wISi+H?= =?us-ascii?Q?2Oj6lEkNcRkbCB4rGQSkX02uUJ4KKMTHiULztvYxTWl14o3nflzMqhUb5s44?= =?us-ascii?Q?2Ipbdpvhn0WB5fnjGk+T4C0WyYj/S3xAUo2TdqcuQn5Aoc6969WPR1HiYqko?= =?us-ascii?Q?sg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0843dd15-3670-49a4-28d0-08da9fd23a5c X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1618.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 15:17:29.9288 (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: NxtoQwxK3JSrb+vJjJ2Rqqg/0to9Qv/pHA4T6GUgpZKzCJ6GFODlmXrHu2wELsntNkdwgPdiP/swECDr4J8tjy/qWzkowClVy77vhTomcvE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4531 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 Mon, Sep 26, 2022 at 03:44:38PM +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). > > The script passes flake8, black, isort and pylint checks. > > I have tested this with a matrix of python/pyelftools versions: > > pyelftools > 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 > 3.6 ok ok ok ok ok ok ok ok > 3.7 ok ok ok ok ok ok ok ok > Python 3.8 ok ok ok ok ok ok ok ok > 3.9 ok ok ok ok ok ok ok ok > 3.10 fail fail fail fail ok ok ok ok > > All failures with python 3.10 are related to the same issue: > > File "elftools/construct/lib/container.py", line 5, in > from collections import MutableMapping > ImportError: cannot import name 'MutableMapping' from 'collections' > > Python 3.10 support is only available since pyelftools 0.26. The script > will only work with Python 3.6 and later. Update the minimal system > requirements, docs and release notes. > > Cc: Olivier Matz > Cc: Ferruh Yigit > Cc: Bruce Richardson > Signed-off-by: Robin Jarry > --- > v5 -> v6: > > * fixed typo: /etc/ld.so.conf/*.conf -> /etc/ld.so.conf.d/*.conf I am a little uncertain about doing this parsing, and worried it may be a bit fragile. The main file for ld.so still is ld.so.conf, which, on my system anyway, does indeed just have an include for *.conf in the .d directory. However, is it possible that there are systems out there that still have entries in ld.so.conf and possibly elsewhere? I think my preference would still be to shell out to ldconfig and query its database, or to shell out to ldd to get the dependencies of a .so from there. I just think it may be more robust, but at the cost of running some shell commands. However, I don't feel strongly about this, so if others prefer the pure-python ld.so.conf parsing approach better, I'm ok with that. /Bruce