From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0049.outbound.protection.outlook.com [104.47.32.49]) by dpdk.org (Postfix) with ESMTP id A5DD61B36E for ; Mon, 12 Feb 2018 17:14:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0+d3RloA4g84mpSkmWoYbK0gm8VY8a95dKAVFJSVm8Y=; b=NLVh/C+sZnImNsCo5Bv0WgXTZySbQgGM6jHgv6y7euMruPh4hucPkTDTdtff7KFtFkQklUKY1Pv1eHUYnWAaVgg90ykZt6ULbbvZrfH96ccrGzJQ+sB2YEkQWzaohJ3zyuW50gYi9a3UL5jlQUHDGmJxDb48GxAU+zvRc8qXVpM= Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3463.namprd07.prod.outlook.com (2603:10b6:910:75::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Mon, 12 Feb 2018 16:14:09 +0000 From: Pavan Nikhilesh To: thomas@monjalon.net Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 12 Feb 2018 21:43:12 +0530 Message-Id: <20180212161312.31795-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR0401CA0005.apcprd04.prod.outlook.com (2603:1096:3:1::15) To CY4PR07MB3463.namprd07.prod.outlook.com (2603:10b6:910:75::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 745f1075-bc67-447d-11cc-08d57233a6c2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:/GK58cGzZmiCbkG4pE9uGEzAFqZcP7Sdctr2mXNqBF0rlx9NfpdrOa6NrNAd2Ue+TMog7SuM8eRJS1OZDYef4yJ2Z61s2heSyl5K6OintYQoeTZhE7xZJUIwYvUELxwG4A4wSSc1gtsEBimdv/8ll/VRmX4vLblJjr64i8IseiEX2fe0AoygMB1enSnsVDvaJmgEYZSsUB8dnLgy3m+Qg/FwqFm6TZ3l90Y5ZZWWCf0pRuOGNlhDcnHricEBWmuJ; 25:Qhwhq6XlBD8enfG5Eux4wYyv7ys04ReGnCShoIWSWeWTfzDZz0Czsl3IuqonSikbuP25mjq2eIcApfsiI+AcLxynGGE6cl3ybphfZ6eRxrUnZqpyYeSGF9sMJQUdOc6KfAi2J2wjTPBcKpV20h945Jwcd2qsReN2lQDsmFSk3rUfhq2KppTs+Kbk8HFXJaRDuatJwPGpwsnZrcUnzSAvTtZxVWOJ/VYUCBnRNr0yo4Yn6v6UNFa6zwUFQCJCEpAYl3YTx7bjx8K45rqNdCTeBlvNrQR8vo2ogee4hhBKtWdCyiJ98YPP/Pwhs68MJCr2C6ilTm2VIdvZGYm4O6CyIQ==; 31:iq0MfxUE3zcqfxILiR2iVKiSi6F0NRm8VffTAFnLbCic69cXrIhrbo9ca18WtndigTj9uSRUaqesd/SAYa3mEphNiI6StQ07gN9cTDHNA0WyQTTkFq4mCMiuTQDPPvgnK8WXKlJ5ZlhT97fQtsTcvP273FHA60kw2LckByQN/6zNspCsTouNj/irqJDWb8UpSW17IdSzxEI/4hK9YzHPEwOqnqQsYQKalVavcF3eabA= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:ZbiN1884bDgrIY/Rv9QV5WLiFAsS5ybluB5DZQuUhqJTMMQCAB/l20sXEfcy9v5N6mCYXMx3uPqid/KQ8k6HkskhpM2nXpoyTDXCKg+CgMFFoKE2I2xBx0nFeUYl5KaO16D3WE1RleoZSLlCNGfx6xlEiMy/2JnQAKZWfmzR5QfrWWy/GNnCbRyL5UeIEAjBYkjpJ2Wem/vgVTxwzam6VwRr20kIzY1IqcLuFWABbuFDzWw5DUBCzhwsVc7lNQCzhLStI7GCGWXQ1q5a4QRG0gxjSF2liW31fBvNMDxqvhCLIBTrffkoLRDDzfMGLsNx/yeUEhKVd41Ynl3/t7a9pMAUSdczoI9amp//gCF+1SP+vjwDVpfFqLF0y/YAx+h8Elq5kd0pl3jJMwc/vdTjKNtgjg1UhChYDcLhEeE8Czedln9g6j5DP20ZL16xdUVq/aK3F359q3c95ogTbfC/23fPWDC1FDJmgxHdZziVZV/OtwNktvJTmQwJ/QOgAGk77whf2eawVK7EATa897EU0i9nKsrJ17UcaPJhRtQXvoV/5eOer9JecuKP6TRopJxOwRc8R12Q0l9nLSRp6HLUx+8baL2kNaCnwebZ57Rtoxo=; 4:47X9M3+Fx6NJjLpyelnywnjwi4KwxQVfArjMh29fOrOgQ0h2oYCw1GBREelXHKuJb+8EZgSPshR2sGLV+LHg25cWI7YOVX3G4FCgqAs3w1iY1xQSwuJA7JEnEttgBN8//XFf9JnSsyPt2Ogg+mYMZUrYvQ5GiFt8tDNruma+t/PIvY81uwy77hMEMQvf6H2Edb4C/rwb/HdaP9KJl4nZ7uwMr+1n3Kio7tC1NKcW/8CPoQ/AN05waVr3TFePQzhd4xFUBhkNp29NqYFcqqFg/UOrRTTLYfytKveRlKMpTG0IxawEGeEwAEiGNmenRF+H X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3231101)(2400082)(944501161)(3002001)(93006095)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3463; X-Forefront-PRVS: 0581B5AB35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(39380400002)(396003)(346002)(39850400004)(366004)(189003)(199004)(5660300001)(36756003)(6116002)(3846002)(1076002)(8676002)(105586002)(478600001)(7736002)(47776003)(81156014)(81166006)(6666003)(50466002)(68736007)(2361001)(6512007)(66066001)(97736004)(106356001)(107886003)(48376002)(8936002)(50226002)(2351001)(25786009)(6916009)(42882006)(316002)(4326008)(6486002)(2906002)(386003)(16586007)(6506007)(72206003)(53936002)(16526019)(186003)(5009440100003)(52116002)(1857600001)(51416003)(305945005)(6346003)(26005)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3463; 23:6J2tL9CS5NyGSROvOM1loMQACq1L6zOGYLvm3pzlB?= =?us-ascii?Q?nKqIIrVJ4wKddYfOa6u0P264NtGPdDesO82ROiflDxSvrSOpypl5sO6PTTWH?= =?us-ascii?Q?ML6TPfwZrbsSVFwYp4w5zceVj8ErO8CD/SOfX5O4v6NIQix0zrYH3f75hAJx?= =?us-ascii?Q?t9XI1COWVxDS7CaV3HXa9Br0/lisK5aSlBpbU/tWT5rEYiqIWwtOm1sZGkzo?= =?us-ascii?Q?/jM+qmOeWAvJEOrmr6z6b/MHQ5sHpxiaw3JUvhgScgxUhPL/QhBTZqMZjqOG?= =?us-ascii?Q?uIoQb6L/DeLkq0m4kb1eXBtSEZJjp7BbzesGAqskWCXfTAFkkRQX0jegijev?= =?us-ascii?Q?SDOUFd4SFyk5MR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?PXTn1pBTZskKTHekdfqmM7Ls7HDrL/aImD5Fsr5?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 6:ce13kNp6d/z0LOVDGjBScsZsXH7xEFbZzW9EaBuAg8OoDGreQLpbPjl3Z4mnLf+bC8657wzIyC4ztwo12bPZ4mS8zt7/ahe9wqktDp7nsfVZOsZJKdS6tOzFB7Mp11oXpOU+AIHcPIjHMYjnuANvYjGnz/HgZTU8d+UtH4eJO9gTFM3+hZgjuxY8OeiWDgDYkn4TFK8/fkvhfh/OUwPvFqs07UxwQ6EWy1s+og01ZPKV5ZlwImUS96YnpoPhsqiFOENQZXYgSkyM8ldMEcwd09TdLkd5i2a7OyjoTZAU4XPO9jsi0xK6YhhWptI2vCpNdm0mjeZRX1vzbttqZZoNc4jcKEQtRC2LVuSTGuYxJw4=; 5:+r94WHy2Icz7tvDFJNGI4D2AJjtw43z7ZRO+0px0uhD5MHnyELwWbIw8Yt85tV+MMVRTsM6DMOarTGA3G+dgVV94Bjfd1hJ1S4ShYGby6Gs/jTGXNafwv0pcqeP+/7CdF2qECOwsqwghLRpGzqVcRhzkcefB6NpLeAIDf7PT3lk=; 24:Rq2DEfbTHPNWbPH18Qze799dBVW2qx9/xDPCoTf2BM8iSAvLlofYKAXt+bgZQxGGlH6QPqmG09Esh9KytqC+dSmezt32kLkHirWhDF6L6bU=; 7:wQLURF02QJzl1p6OSe6m8OUBmcNw/uqI1RcibCpiKZ49G5K0XLUksBGQBEDrtkt5lTCxjgeQ92V+++Xk4f+qM6Qq/204Ccx6vP73xFpf8hXtC3XO9rgpXXRjg/TR+O9yDSK+YbGwYnzYHRXimhpSiFbfOwuL+kOaFB6TrbQMIM6MuNmyr5ro2daAugyHQpQ8iWX6/HdyfeVucZWAg+V99zCyGBDYywfchcnTMJriq5RZCj/MQkDC54D/LfkGzM10 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2018 16:14:09.5365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 745f1075-bc67-447d-11cc-08d57233a6c2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3463 Subject: [dpdk-dev] [PATCH] devtools: add script to verify map files 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: , X-List-Received-Date: Mon, 12 Feb 2018 16:14:13 -0000 This script checks for the symbols specified in the map files against the symbols present in the map file directory. Currently, the script checks for map files in drivers and lib directory. Example: ./devtools/check-map.py The following symbols are unused : Map file : /home/pavan/Work/clean/dpdk/drivers/mempool/dpaa/... ['rte_dpaa_pool_table'] Map file : /home/pavan/Work/clean/dpdk/drivers/bus/fslmc/... ['qbman_get_version', 'qbman_swp_send_multiple'] ... Signed-off-by: Pavan Nikhilesh --- devtools/check-map.py | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 devtools/check-map.py diff --git a/devtools/check-map.py b/devtools/check-map.py new file mode 100755 index 000000000..a508469d6 --- /dev/null +++ b/devtools/check-map.py @@ -0,0 +1,56 @@ +#! /usr/bin/env python +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Cavium, Inc +# + +import subprocess +import re +import os +from glob import glob + +paths = ['drivers', 'lib'] +map_files = [] + +for path in paths: + map_files = map_files + [y + for x in os.walk(os.environ['PWD'] + '/' + path) + for y in glob(os.path.join(x[0], + '*.map'))] + +print("\nThe following symbols are unused : \n") +for map_file in map_files: + path = os.path.dirname(os.path.abspath(map_file)) + with open(map_file) as f: + map_content = [line.strip() for line in f] + # Filter empty lines. + map_content = list(filter(None, map_content)) + regex = re.compile( + r""" + \bDPDK.*\b | + \bglobal.*\b | + \blocal.*\b | \}.* | + \bEXPERIMENTAL\b | + \bper_lcore.*\b""", + flags=re.I | re.X | re.VERBOSE) + filtered_map = filter(lambda i: not regex.search(i), map_content) + filtered_map = [i for i in map_content if not regex.search(i)] + filtered_map = [s.replace(';', '') for s in filtered_map] + # Filter out known lines. + if not filtered_map: + continue + not_found = [] + # Gerp in the map file directory for each symbol + for map_symbol in filtered_map: + try: + op = subprocess.check_output(['grep', '-nr', '--exclude', + os.path.basename(map_file), + map_symbol, + path]) + except subprocess.CalledProcessError as ex: + not_found.append(map_symbol) + rc = ex.returncode + if rc != 1: + raise + if not_found: + print("Map file : %s" % map_file) + print("%s\n" % not_found) -- 2.16.1