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 454F0A0556; Mon, 17 Oct 2022 11:15:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C3724021D; Mon, 17 Oct 2022 11:15:41 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 9365E40143 for ; Mon, 17 Oct 2022 11:15:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665998139; x=1697534139; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=Gp5F6BOMpE1FpXdFhzZC0P7Lg2YVm0a0WKOqHW8MhwI=; b=Kvt2InFS0LMDxr1fPHcVkPv7hIkz6vf9ip3LDjkIX965gY1LN0Q0QVSv XRNpkpLHEkyUqHpMm6AdGktJVb5g/S6sCYx+Y3/+d7tKUpdmjkHgtyPgN PmwfXR4ib5HoJmcOtAdMpHwe8vTF49uxMVuvSCjrivZP1bDef8SfvIl+s oAoWSSyRHRyO4iYeypSPkAqqwSHZkEnwv//CTko6Ntif8JGAWRp9+Wzt4 z19XbpFMIqZA0UZXxaWOH+ErtVyChbwGfIXob2DaAckvstJ/Mok2cbJP4 RDH55p5bQUno4Wlsmxqv7j0ggqS+BE0peeO29En4tJUyx1smK4Vj6rsDq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10502"; a="307406532" X-IronPort-AV: E=Sophos;i="5.95,191,1661842800"; d="scan'208";a="307406532" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 02:15:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10502"; a="579306471" X-IronPort-AV: E=Sophos;i="5.95,191,1661842800"; d="scan'208";a="579306471" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 17 Oct 2022 02:15:38 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Mon, 17 Oct 2022 02:15:38 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 02:15:37 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2375.31 via Frontend Transport; Mon, 17 Oct 2022 02:15:37 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 17 Oct 2022 02:15:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xa9wGKkS6f2bCxktDjXvhowZZTwsrIJ0KaZiYL1r/gdL+s99vcwqxwnosRR/MdFFxULT0a8l5ra7kKW8AkoxoCuDZcr5dj3+lNouOcu3Q37/OKeWWm29Im6JZEm9w56+wfTpnONrrYkVKippOgwgq1NIWrwz2orHLDmtVzGoRNjYegmsZzD0NAGYXj1Rl0+EPBudHvT9XV3kbdzA1TLRAxDZ9vuj/20HYYOqmS+k77+grhMsnn4YFp6ZPoQGbqj98S6BDekBvbquvj8A4ma/U0NK1xV8mYaTQ5iXfEhuySnHl55iLj2I/N6ycHEK3ryIjy85r3sTUlIUaGAU2dL5Fg== 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=C5xYCUxf76nyPearUifdK6uSDYwp6+CPAUfGMHaOrMM=; b=feO+OrLTR2y4lHz7m+Lxnvv2tTGpG3f1OVOPIGyE2gzgpy+4RMPidtXMTUXduqG3GJWozCKGxaVwI6Y+9+pJ3WeW8wWyuhT9B3qFjMQkD3shxw1dkhBQX6HbLaOEV6oXKG/TN+0P6AaowCaEN5qdMCzn+DMVl/strwQBNuctIIjkw/4LCpA4Jb/70fx0yWWNZlxKV5EbalKQBo053//19W+aid7/gAaI6ldo1fM5oOPXw+1Fi873hVagzedQGdk9KVLqx7TP/+1SZ0ipWFKEuUdCZBrzoIiE7ptt3v6mtGS33G9R2aJTBcmE1NvbK+xnhF7tCQcFlx3XhP6J0coTRQ== 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 CY8PR11MB6939.namprd11.prod.outlook.com (2603:10b6:930:59::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Mon, 17 Oct 2022 09:15:36 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::5582:9796:3aaa:aa1]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::5582:9796:3aaa:aa1%12]) with mapi id 15.20.5723.033; Mon, 17 Oct 2022 09:15:35 +0000 Date: Mon, 17 Oct 2022 10:15:29 +0100 From: Bruce Richardson To: Chengwen Feng CC: , , , , , Subject: Re: [PATCH v3] usertools: telemetry pretty print in interactive mode Message-ID: References: <20221014023338.51464-1-fengchengwen@huawei.com> <20221017074102.55509-1-fengchengwen@huawei.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221017074102.55509-1-fengchengwen@huawei.com> X-ClientProxiedBy: LO2P265CA0380.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::32) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|CY8PR11MB6939:EE_ X-MS-Office365-Filtering-Correlation-Id: 488311a3-45ec-444d-939f-08dab0202640 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vGIMdoR7hlZc9hEqVDd2ZkuVFN69KSGQJLRpGX3OYYDeoRjBfB5i/nmeHN7ztzDGRDU1UMgFkp7ENWzDqoRT54BeYHdlCsWHf6WC2QhsFGJu4Ap9hUrxIjIVcrFFWmao/QrBfTqvKNnatESW79P702UF+tCx4muclEK1U0TscYGsKoqTpbtcH522k7n+IsgMRnGYFHRStLzOznz04MXrpl30Waz3lsY9nNSo0zkMYlWn4bzI47Ei3T16cdaYmuaZ8kKm2H1JMsLX/QDUO/pJOkdQJGJo6KG3d2lIqUPm2r8HkWqHjFB/yj2VkuwxOamRsjKPEoLtzljv3iCFFY/DoqEV/4yVaiXDYFHvR7qMFn/1VWMIkqw6qxu4Z9tV7oBPV3nm7E59eZbHvZPAqYI2PSsO5fXPJjGQj5deU1I1rlyJ5xtu2ovL3wGvC0EXV1ktEXFvmVn/FVMvI6Fc4nxy/ZuexamHEa7PHhGTxaufgvVig2p5SEFWuSycsblfWn1WMXi2QvaJMJ+jufTX236oZ7UYT6YgGUYTwDjE3ynhSanqJGTVLNzr94iEhAP4Js+0NNmVd3sb5pea+yzJM9HW2ehulvW9tL7Om/ijJMhdz8z78DSv/NUd+KHw3uBpHfr2H7AxYHSc/o3hOTCp7Bwt/WQDe62Jd26Mo485icudntfjutnqmyZyzlpYmsnpKSxZznu8dSQ8IQHxU09X8YMmQw== 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)(346002)(366004)(136003)(376002)(396003)(39860400002)(451199015)(86362001)(5660300002)(44832011)(2906002)(82960400001)(38100700002)(186003)(6486002)(26005)(6506007)(316002)(478600001)(6512007)(6916009)(66946007)(66556008)(66476007)(8936002)(41300700001)(4326008)(6666004)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Bnfc1YUPgpXADfMdOevIMhgh7+wbrRyw4pEkjcVQVoeDT+Wu9cgGpDVStXAx?= =?us-ascii?Q?q4FYo3M1RrHW9z799CqVYpQMa1t2kFhvyW8NO4S9CjHE/yWHIl0UUtUJC7Cm?= =?us-ascii?Q?q0Ro16M54iC9aogYx6lo7J2SQniiWS5TL4ESkDEfcQFYwFLFZvOclAEqxUFM?= =?us-ascii?Q?J5vgRLaCeLB+kuIOtj1kdDghTODQhCPzlWgqfidPrJaADQmZd93tlw/Yehm0?= =?us-ascii?Q?NPBD/TsOkMxre7TDix6oPtNsbYzKR1lemvCLSuSIfkgd3artbcKqBBvv3u6v?= =?us-ascii?Q?1lR4snDLr4d5we09m6mkHOBwunogSZTkFyqQXjI8s+TosPzUVIpmT0SHwP+/?= =?us-ascii?Q?O02GHMSJFICvzys2fFiHcQhcYRVxwMeyoBnVKNMwoBkpT4xEZcP8RD0fvAmx?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fBnti48L48g79Orw2lDlB9X4743EkZ2eG?= =?us-ascii?Q?089XBboTeR0f2KRy3fU4gFrP7Uy7/zqqzZkTzdZcIY3huc7UwpN+yZtCw+NX?= =?us-ascii?Q?KDu5gyXpboUEtr701BHOrJVgKDCnHx1p/OFUHB1KNCZDzp4XNKj5brbgVBFb?= =?us-ascii?Q?dXb6po8/8y8p38DUTwYIyNRzctEck/SGMvzZs4RIlLQqtuoUFGAVzu1UomRg?= =?us-ascii?Q?MeqqT6T2FVLx4Vqra2E2DWcLIR4VwMgWmHQKw3f6SHT+04hk+GuRc2Psr50/?= =?us-ascii?Q?ykVbzt+sZExpUQbl1VqBF+PPMhRiZTYgzGB0zGlqaG3D6umE45ow29GXGsQr?= =?us-ascii?Q?EA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 488311a3-45ec-444d-939f-08dab0202640 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2022 09:15:35.5742 (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: f8srO1khc2ufUg2OV3fsStYSgwYPWXd7IgyyulnStJvWAR2Izz1BSRH7P3YYnt0Dhc6tBz2FT6Ak6gmfgUltQL/T7VMzDbV52bHFrek4+Q0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6939 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, Oct 17, 2022 at 07:41:02AM +0000, Chengwen Feng wrote: > Currently, the dpdk-telemetry.py show json in raw format under > interactive mode, which is not good for human reading. > > E.g. The command '/ethdev/xstats,0' will output: > {"/ethdev/xstats": {"rx_good_packets": 0, "tx_good_packets": 0, > "rx_good_bytes": 0, "tx_good_bytes": 0, "rx_missed_errors": 0, > "rx_errors": 0, "tx_errors": 0, "rx_mbuf_allocation_errors": 0, > "rx_q0_packets": 0,...}} > > This patch supports json pretty print by adding extra indent=2 > parameter under interactive mode, so the same command will output: > { > "/ethdev/xstats": { > "rx_good_packets": 0, > "tx_good_packets": 0, > "rx_good_bytes": 0, > "tx_good_bytes": 0, > "rx_missed_errors": 0, > "rx_errors": 0, > "rx_mbuf_allocation_errors": 0, > "rx_q0_packets": 0, > ... > } > } > > Note: the non-interactive mode is made machine-readable and remains the > original way (it means don't use indent to pretty print). > > Signed-off-by: Chengwen Feng > Acked-by: David Marchand > Acked-by: Ciara Power > Tested-by: Bruce Richardson