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 8A0CD43864; Mon, 8 Jan 2024 12:02:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9E4B40263; Mon, 8 Jan 2024 12:02:03 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mails.dpdk.org (Postfix) with ESMTP id A012D40261 for ; Mon, 8 Jan 2024 12:02:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704711722; x=1736247722; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=O8DEIgPTuPe0eMWHm4Q4Sti7KKwdVG2G4QohYTsIIsc=; b=HEoo04EC+y1TVavrKihRLkeGkNQQoGhbAHFKqXO6DrGtAy8NDQ96MO72 dP1kTgzrO57wkjN9cZ5xU40Yh23V6VLu14GjHPnAckYYUwK/tZnomDtIl Ksxa/FyMtZ+YlsE86+5QE5Kx5dWIjPGkvrEIM5nVZYPrfZqlKGSnMBIYF zTNjl7qXZifaXv2dpBco3grYhsaPYrtWdjgxxhyV9CSC8BV7Kg8MogtPE PdHGJZQnwkQ8cvrRFYtiAGBPUfg7LorwcPMKkREjE24LiltGYq0fBetzp wwMkQ2iBVbXuU9jOdzsU+RNjD6Hp36yvVbmVLCg/CL7MwbSqcGdGX03xo A==; X-IronPort-AV: E=McAfee;i="6600,9927,10946"; a="4606294" X-IronPort-AV: E=Sophos;i="6.04,340,1695711600"; d="scan'208";a="4606294" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2024 03:02:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10946"; a="784816841" X-IronPort-AV: E=Sophos;i="6.04,340,1695711600"; d="scan'208";a="784816841" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Jan 2024 03:02:00 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) 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.2507.35; Mon, 8 Jan 2024 03:01:59 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 8 Jan 2024 03:01:59 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 8 Jan 2024 03:01:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=df2dqbjnrqkAAJyYV6BNVgrZ/LITUTJDF01QJBnJM+SfwjrnWdvOTb1KXpcrwh4LqFPr5+apMjYPJkJfs9ovyT8SR1Cx00upXz0MCfQPT65ekEnzUOQIlD5ii+sk0HBeMMRFZIeJ/M1Prl4EJvkyjP2CmBoAOWJpkiNPiqVokzGvacx3/BUPTLZGX+/7ZbjWakwnrZOhpuIGcIMTBG+s8jD06bfrdPQwiD4o6+UK7bM86E9DRn4KxjNha9D5X+lxRIL5mGau8/iw9aaDRKdcbq+ds/uW9nHoX3Ygpu7wZUcCxJ1CemNQt0a4s1ryMh49eeaxGRauzbVPGT3lyjcdNQ== 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=2Rb+g2/gxTVMmQE8Sg3pLGmnKttxH/jmu29cFpLVRUU=; b=SrN8gQXjFGJrG97iklzjY864UCheW/7FTObopQFASHIRo80XoP14FBrwQfhkc2ChtjXjQO5o3U/h3drnxiekiXmrnz/NuqbMqh4+6M8lxnzZJIczrPfSYT4A2IAxiZLNbtJWNVig/KBwvIvdXbrEzvi89o+GeLx9AYJlisZSDArXU1xCxBdAWEd0C24JcAzUz21I/zJcZp5YErIAfBPGD7vse4b/YAJAVYbwHrH6Oh089EkVPLdZLT9EeLbCiV1MpJziDluWL7EN7giph9ybAMp8E9JWDzhjIkSYK4FLpREBicCsQB+xCvPExlAV4up9UFvSKj/fClIQAxM0lH2sIw== 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 SJ1PR11MB6156.namprd11.prod.outlook.com (2603:10b6:a03:45d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 11:01:52 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49%7]) with mapi id 15.20.7159.020; Mon, 8 Jan 2024 11:01:52 +0000 Date: Mon, 8 Jan 2024 11:01:42 +0000 From: Bruce Richardson To: Jonathan Erb CC: , Subject: Re: [PATCH v2 1/2] telemetry: correct json empty dictionaries Message-ID: References: <20231224220201.762377-1-jonathan.erb@threater.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231224220201.762377-1-jonathan.erb@threater.com> X-ClientProxiedBy: DXXP273CA0008.AREP273.PROD.OUTLOOK.COM (2603:1086:300:2::20) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ1PR11MB6156:EE_ X-MS-Office365-Filtering-Correlation-Id: c0058de4-bd0b-42e8-8273-08dc103937f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 88MAjBlzTpPf2t8KwNLjp6uqnGbH6ewBPGKmnEYRxN8/KIzkunVWfxO+9cNrXeYWdMRw82JzRe/MTjH++FUgG2s6FG1nhWHYvdF5i+WfT4jqjw5/rQa8H8mT8UQqt76R76/wuY05P9dAthDQu1ek6Q7RlrYl4nxP3+74G5uTPxZ0bHbFeue8NqbX8YyLVLmXP/XFA4jyoIfevxLtgcFUsVhahKEq1DXpOhTarCLb4rUCaXBv1ij1QPX9wj30TZkEgCGCfkfyS+gzc/E3DLKeRquSNwCMPQ7hFuEIIfdto/zd4a+h3ELMHFHEqkAYfOrwuJf816HudYQIiLHiubPpu/AXWlRnMkvxvpui6yM/jBDsyZCxzUDRFjLhsGDdyV3oW3PGApQ1NtCxF4jap+0dp2UHfCnjwPpPFqosmT6TqywzKneRL/JxPX7j+l6yD7cEtLmmGSUrskvKjtWmfnNKo06jVwzGeG8yiNZ27d2hkcwTW1yBxDZYBH7iI7MtYRjEuyj3kpN1hJHJSv3BPm+2wLbmzDmDhi9nla0Qrmhnv/93B7LDsNBlf66huctrg0yE 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:(13230031)(346002)(366004)(396003)(39850400004)(376002)(136003)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(26005)(6666004)(6512007)(6506007)(6486002)(478600001)(38100700002)(86362001)(82960400001)(2906002)(41300700001)(5660300002)(83380400001)(66946007)(6916009)(8676002)(66556008)(66476007)(316002)(4326008)(44832011)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZaaBsAloqBUb1X11mP5WZBoPe+3/FdSJIaLS71F4KHp4cd9ARe3voYV2i34n?= =?us-ascii?Q?ahoTut4x1tgozJer1xQIszLq0E1lWO0JTrOnQ7qlRKclKRkjv5lxswoUdKqS?= =?us-ascii?Q?RIE0lLcC3LHmUSegx+R5w4cPBNx+7LaTL/zhRRCWdkwaLMUgEG7oE1ST3g3p?= =?us-ascii?Q?EePAWmArjzBl18+ItpMLEEcLuSKcw4sUg2oaF5if22Zxo3WU1fjtKugb0AAX?= =?us-ascii?Q?HjruLbzPpyhuvQ9pPT6R9nbm19OUBlQ85Zw+F9cNOlRoz1Uvxc/LhFuFELQe?= =?us-ascii?Q?1wwZvI1x75qm2lTGwlFUaYXhNPuDn/eecE0/GKuZfPSbB8nWiVSFxZ4iBrQk?= =?us-ascii?Q?2k1cR4xsoVy7FcVHS5A3AYNA74Z8jJq5Bsg1s5nOqCFRPBMe2EVW/nXXi2Ff?= =?us-ascii?Q?X534jrfIdLHp2gDUwQh0cTVcCns4U500cEj2FHmjOmh9bKzhaQ0y7ugKo8z3?= =?us-ascii?Q?0fmWevvXo7+9aZToyfDbQaDorJnNubqCuwNg01hvQgugIvirOp5b6mam+72z?= =?us-ascii?Q?pND5oQrAcu/9Wl4zb1qXHIOjVfrRI8fZCwLe71GP7PkOh0AKD86RBQ9iv3Eu?= =?us-ascii?Q?diLWWNjid5vDmrxlf7bvtRgHTm9VAvA/1NnADZUfwdkDndj0xzfdn/kVhefE?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W3Wi2JjKc09a6JQak/h6ipGpNly516WNOu?= =?us-ascii?Q?vWR1Vmme82I8IUFcSRp+DPTsrCCxipn0I42zrTFGXFb+BdArNd5rLUJcZiAP?= =?us-ascii?Q?ew=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c0058de4-bd0b-42e8-8273-08dc103937f3 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 11:01:52.1450 (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: 5pci6OunYWop67O+nJNtf9fbTRPXOBYQmct3TLz5aTslexsHHaVqGsUXsYPLx3V0FGAE+WymgKDwSEMWKUM1oYZBoYkO7LI1M7HHdJ9v8UY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR11MB6156 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 Sun, Dec 24, 2023 at 05:02:00PM -0500, Jonathan Erb wrote: > Fix to allow telemetry to handle empty dictionaries correctly. > > This patch resolves an issue where empty dictionaries are reported > by telemetry as '[]' rather than '{}'. Initializing the output > buffer based on the container type resolves the issue. > > Signed-off-by: Jonathan Erb One minor comment below. Acked-by: Bruce Richardson > --- > .mailmap | 2 +- > lib/telemetry/telemetry.c | 6 +++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/.mailmap b/.mailmap > index ab0742a382..a3302ba7a1 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -675,7 +675,7 @@ John Ousterhout > John Romein > John W. Linville > Jonas Pfefferle > -Jonathan Erb > +Jonathan Erb FYI, it's advisable to keep old email addresses in this file, since it is then used to map the older email addresses to the new one. Just add your new correct email address as the first one on the line. > Jonathan Tsai > Jon DeVree > Jon Loeliger > diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c > index 92982842a8..0788a32210 100644 > --- a/lib/telemetry/telemetry.c > +++ b/lib/telemetry/telemetry.c > @@ -169,7 +169,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len) > d->type != TEL_ARRAY_INT && d->type != TEL_ARRAY_STRING) > return snprintf(out_buf, buf_len, "null"); > > - used = rte_tel_json_empty_array(out_buf, buf_len, 0); > + if (d->type == RTE_TEL_DICT) > + used = rte_tel_json_empty_obj(out_buf, buf_len, 0); > + else > + used = rte_tel_json_empty_array(out_buf, buf_len, 0); > + > if (d->type == TEL_ARRAY_UINT) > for (i = 0; i < d->data_len; i++) > used = rte_tel_json_add_array_uint(out_buf, > -- > 2.34.1 >