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 42D4F4237C; Mon, 9 Jan 2023 10:14:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D844540687; Mon, 9 Jan 2023 10:14:57 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 38C1F4067C for ; Mon, 9 Jan 2023 10:14:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673255696; x=1704791696; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=A+yviezTghgLLC7lR4M7viWCDqm21tNdKK/K4EhA2BU=; b=E55xswhWFAOXUtWzSiE8uuNTcWwXCqlZN6mdAAq/hTqS+Xn+k7OSjgiL TnsZI5zLgASK+0BFRX9wPTyPf/RnuYhuk7f1btIOjM8u1L3v15G0Qv6vl +OdQtxbGk0dpfHG28x41PkqTlgv2XmaG/RBk0zOEwMsT23Q3sPCgcEF/j Yd6U5ZV5UJfVpBS55fL8hba89H3AxBfvgiKj+5i2lQ1f8RTEhj2X5yFaE aiACRC1hCIl5tqlRvJkW7biqGknzJ01XaApoYeRNqP+2gH01e9pSLDLTM 66MbypLYrYBU13IqwGtPUtabnKLYfnFY/gqr6NC/gjUJ/eA7UuiboqfBo Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="320531509" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="320531509" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 01:14:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="901939407" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="901939407" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 09 Jan 2023 01:14:55 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 9 Jan 2023 01:14:54 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 9 Jan 2023 01:14:54 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 9 Jan 2023 01:14:54 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 9 Jan 2023 01:14:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MWZT+5KOlRJ4aUZkcMORmI8EF+dpI5UpHavPQ8NkwoMlNK0mRGHx/Zi5t/4pq8xblA3R4GU3+tPKCtqDAyty7sBtCPaYFWiKQ9+mWu0Bn5k3vw5UTbXokKrHBnlDKCLrjFTUemCyXSWKfICHYTqgefKxzMhWyRLuvytvoQMynC+SRwLD4aOVSQVta/3fPdDztc0vfwLuZ6Rctnng+Zq3/+VNxDcXLVYi5quuNoJnFv7cT8P/aQy6SlhrR6YM1fbeObLaXF87p9ni/BRtIiKZbvm/D8xcCA++c3lVk32Xhufg6JOQBPUiFfDe8VoIv0Ka62wEh9BZnHRvZoig2uGM5Q== 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=3fUpJyRGg5CbF1epgya+3Lo0EbiW/1QXqVrj5mR+EJU=; b=Jb0lFFgJCQAtSuTfHfKamE30rQKSn98ns1EyGkK9Y9n5uMhYUf+NOkridKMAEk0WwJeRn2QraXsCDV8rdOLyc0ylxSNhMwmmKC/4IuUFRH52dj03tFzXOjJP0OpWTJTIFBVeLLeQm7U8foWURWZbLUAdSNKRUdXfX6yNq4Y6SY9YL5vVcqiw4eGCvM/Dw8HVr7UPOAOe1xJtKjSurbLWXWIF7DhJj4rh5TN6ekdDRHNBIordlOCTDQSWqlF0JBYB53iciv5SSXv4FRDfCUibXXwwF/k/sq2ODugYoXLjP2QbhuxbZKKRjOpQ7JWVp4kQOxlxellvpdjItGY39JlUNw== 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 DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DM6PR11MB4564.namprd11.prod.outlook.com (2603:10b6:5:2a0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Mon, 9 Jan 2023 09:14:52 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%8]) with mapi id 15.20.5986.018; Mon, 9 Jan 2023 09:14:52 +0000 Date: Mon, 9 Jan 2023 09:14:46 +0000 From: Bruce Richardson To: Huisong Li CC: , , , , , Subject: Re: [PATCH 1/2] usertools: use argparse module to get input parameter Message-ID: References: <20230109065547.8819-1-lihuisong@huawei.com> <20230109065547.8819-2-lihuisong@huawei.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230109065547.8819-2-lihuisong@huawei.com> X-ClientProxiedBy: LO4P265CA0239.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:350::13) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM6PR11MB4564:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ce61c16-3603-426e-a7e9-08daf221f736 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U3Nf2SWl1cUTNfQZEa+2NNGlLvmnppMhemuG44F2SXFoZ9oVptGNFoLgCWrv0ylTKNDYwYc3BNCf4QGcVsKjFornfJajfCPwtBx2kPn79KDoV/ER4x/uNlh3UstTzKhlENV3vxJjF+1caPHxp3ZtUlonGwsskHHdI7qB9tFn3KXj6vinXSQuWJxNj3bwRYKzQkcNcO55lrsNFcPqwwVWF8pXHqdImehgoiSa3yEICbl9ZboHEX6astT5eW0JfdUITKYefjh47En7LAZp8NOQ8YT3TPt2MGR+A1rQyaU6zvzhU7JP8hm7yyUKg72ANCu6X4Ts6Mhodqi9gnOfdAi6oUwwAWW9sd3mwEiWbpisVqLtOmzBr2/3f1jzrt3GEzTeBtiXgc+qgff1Yvoeo2V+BUoy6kaAUOJ+5cDnsrUy1+kjW6fSDmTXak/OppGG1xd0qKdwUIBJtqFUwe5JtUqore5+mwkkEPIwLEGi+gcK4E4eWb3iqk+dt8i7RBFPWyN3O4c4D2512fVT68cyqF0ImsztAKy5LZVNUrLRjEwb8i3eiuj+0kd17J8PFUg+CgpgjMbwLkz9ScG4nvA/c4CcFOCaYf9Mxjo/iRc352MOJM/Ji6IHDxj8RT7DOtyLRKTSqbwqAeMFEwvWzMQ9V1h1WQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(396003)(376002)(346002)(366004)(39860400002)(451199015)(38100700002)(82960400001)(66476007)(66556008)(66946007)(8676002)(4326008)(86362001)(41300700001)(6916009)(316002)(5660300002)(44832011)(2906002)(8936002)(6512007)(83380400001)(6486002)(478600001)(186003)(6506007)(26005)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?doGfpliZYPbujCXvaoULk40mDcmlk2aj96H63zLZOHuRhgveRorKbY2UrGwS?= =?us-ascii?Q?GuIE8S8drLFYud6f/c2ZG9Ya6rRr864n6ReZcIRKr3zJ/BC/ZC/t+UJOY7LX?= =?us-ascii?Q?Wqc7WFHSO0lOwid1fN+XhlKniPyLgZuDwDUnxVynZMagDF9/3oejrXktWks+?= =?us-ascii?Q?r3lnR3TxjvHPOHzm4/xFNzHkrriATze+4dlbJKEEKyrt0mXmug3xMMpm2FyZ?= =?us-ascii?Q?Qx34cOf2TJRrhj6DSRIK0aM0V2l0nDkN6LZ+DHEOZa2pHzXsJvY0ioOwryEN?= =?us-ascii?Q?/nuqpKhYwnQudQy4pkEOCV2nSAbDu4PjAURKOHRtC4QumoZwvfoXmXTlyHfk?= =?us-ascii?Q?OrJwumgovDFDW7B6y5ozv59WnPXA9zqUdkwJGsaiPz1EIZUXtvpUiExFfaZD?= =?us-ascii?Q?yw6/CbtFe0ea8ntL3Wt2StLJpluPYdhXNpHsUnIQ3p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VARK2B4riQFN4duIFd/zolxVt9Tul3OglYDC0J?= =?us-ascii?Q?WoA9DUccieYBSPEZSpEVMd76eDcrHUlGyoneQ9SI18eL0JM2U5AqC0qYLBcp?= =?us-ascii?Q?q06BbPHyd+jvT+cKGVsea3Q2yKFEkwt7D8N1HmrnZC3WWxaDzd3gr1qTHmed?= =?us-ascii?Q?FFzUaPd1nhhb0TRihfWV1zLPqhXfrd5MQ+4lOo5aZ19bj01SZJXteYhZ/o72?= =?us-ascii?Q?6GhTC8J6vaLohIfE0VIXj8JUcFPqqnOp5geS+o9veij57arT8aYY4NCsTXPV?= =?us-ascii?Q?oQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5ce61c16-3603-426e-a7e9-08daf221f736 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2023 09:14:52.3774 (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: B8YUwSOxQIk22FF/Ga1ejVYXIhuUJGJE1DvOf3lIpYTa6PkB9KnD/pxLLvRxjC2HOFOVa9OMuA7Vu0d1DAeP+ChmcTjXIKqnTikRDzLVocI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4564 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, Jan 09, 2023 at 02:55:46PM +0800, Huisong Li wrote: > The telemetry client script uses argparse module to get input parameter. > > Signed-off-by: Huisong Li > --- > usertools/dpdk-telemetry-client.py | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > This is an old script using the older telemetry V1 interface, so I'd generally recommend users switch to using scripts for the v2 interface. That said, no reason not to improve the script while we have it. > diff --git a/usertools/dpdk-telemetry-client.py b/usertools/dpdk-telemetry-client.py > index df41d04fbe..fd69955b32 100755 > --- a/usertools/dpdk-telemetry-client.py > +++ b/usertools/dpdk-telemetry-client.py > @@ -6,6 +6,7 @@ > import os > import sys > import time > +import argparse > > BUFFER_SIZE = 200000 > > @@ -115,13 +116,12 @@ def interactiveMenu(self, sleep_time): # Creates Interactive menu within the scr > if __name__ == "__main__": > > sleep_time = 1 > - file_path = "" > - if len(sys.argv) == 2: > - file_path = sys.argv[1] > - else: > - print("Warning - No filepath passed, using default (" + DEFAULT_FP + ").") > - file_path = DEFAULT_FP > + parser = argparse.ArgumentParser() > + parser.add_argument('-s', '--sock_path', default=DEFAULT_FP, > + help='Provide socket file path connected by legacy client') > + args = parser.parse_args() > + While I like using argparse rather than handling args directly, this breaks compatibility. For anyone already using this script via automation, this would break things, as the path needs to be provided via a "-s" parameter, rather than just tacked on as argv[1]. > client = Client() > - client.getFilepath(file_path) > + client.getFilepath(args.sock_path) > client.register() > client.interactiveMenu(sleep_time) > -- > 2.22.0 >