From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3356FA04E7; Wed, 4 Nov 2020 10:41:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A790C8C8; Wed, 4 Nov 2020 10:40:49 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 01FB4C8C4 for ; Wed, 4 Nov 2020 10:40:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604482844; 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=+hfYFIXWWAOTfGX0b218H4D7PaMXbXBsGouTKh7gOJ4=; b=i2Cgwuvt7LxQnIBOWh9h6yeQuzJCr1YRQXUKdi7MJ2mgAhFyim2ac3ChcB+PV61j4syhNu zGvpp+juZUW1kyR17WZpdTG7YgMkTphwFnJfw4xPsDSQZkQA2TVhwm+UcueMSDNVFKDKzC qDXpY60dnjc+EyhHa8N2WiqFQZtMi4g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-450-MKPv0AQeOoaNqgcQCHus3w-1; Wed, 04 Nov 2020 04:40:43 -0500 X-MC-Unique: MKPv0AQeOoaNqgcQCHus3w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 54FB6108E1B2; Wed, 4 Nov 2020 09:40:41 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB6155B4C7; Wed, 4 Nov 2020 09:40:37 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, robin.jarry@6wind.com, stephen@networkplumber.org, olivier.matz@6wind.com, Neil Horman , Rosen Xu , Andrew Rybchenko , Luca Boccassi Date: Wed, 4 Nov 2020 10:40:33 +0100 Message-Id: <20201104094033.29674-1-david.marchand@redhat.com> In-Reply-To: <20201103183906.8088-1-david.marchand@redhat.com> References: <20201103183906.8088-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH v2] usertools: fix pmdinfo parsing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This script inspects an ELF file (binary or shared library) and its linked dependencies by following DT_NEEDED tags. So far a simple librte_pmd prefix was used as a filter. Now that we changed the driver library names, update this heuristic with an explicit list of all driver classes. Fixes: a20b2c01a7a1 ("build: standardize component names and defines") Signed-off-by: David Marchand Acked-by: Robin Jarry --- Changelog since v1: - moved driver classes list as a class variable and did some cosmetic change for readibility, - used dpdk_driver_classes variable name in the hope that someone changing meson will catch this script too, - added bus, common, mempool and raw driver classes as some of them do carry some pmdinfo stuff and were skipped so far but I found no indication this skipping was intended, --- usertools/dpdk-pmdinfo.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index 1661982791..55a55affde 100755 --- a/usertools/dpdk-pmdinfo.py +++ b/usertools/dpdk-pmdinfo.py @@ -430,6 +430,20 @@ def get_dt_runpath(self, dynsec): return force_unicode(tag.runpath) return "" + dpdk_driver_classes = ( + 'baseband', + 'bus', + 'common', + 'compress', + 'crypto', + 'event', + 'mempool', + 'net', + 'raw', + 'regex', + 'vdpa', + ) + def process_dt_needed_entries(self): """ Look to see if there are any DT_NEEDED entries in the binary And process those if there are @@ -450,7 +464,11 @@ def process_dt_needed_entries(self): for tag in dynsec.iter_tags(): # pyelftools may return byte-strings, force decode them if force_unicode(tag.entry.d_tag) == 'DT_NEEDED': - if 'librte_pmd' in force_unicode(tag.needed): + words = force_unicode(tag.needed).split('_') + if len(words) < 3: + continue + prefix, drv_class = words[:2] + if prefix == 'librte' and drv_class in self.dpdk_driver_classes: library = search_file(force_unicode(tag.needed), runpath + ":" + ldlibpath + ":/usr/lib64:/lib64:/usr/lib:/lib") -- 2.23.0