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 4A982438FC; Fri, 19 Jan 2024 10:56:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1A8A4029F; Fri, 19 Jan 2024 10:56:30 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 0C75340279 for ; Fri, 19 Jan 2024 10:56:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705658189; x=1737194189; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=LlRY5+IgTWWuVYLAqoREcBNfVqQbz1pipSWxuKlTkXc=; b=SGG3SNExas5OSCvqZ5gdquKKxNhJrvf7ZTiuoWRrDwCyoK1SQN+6/hJV RBiaTVIR67GOro0jCKd4iXloPyqNlCDI197pqhTkKQG30i7sfsEWc/Abi eZTMq86waiPhpUFJ8DaaH441CcPWfS/SkGAoYGSlvM/LBNICtEtJmXhP5 pGa4vpNbruRZJ5vhKnARWfRu+FlxgkRJAMfsXepBIsgTi0uMjwAG6w53f UCGSQFbvDGE2nr0+sK0/cmc2OEtx6Eew4Q1L9ASUY/Fd0mRC9MQyBLPMt iVq4NyT9RIuVUrbi90/NML6FPV95Yb3ZwgjX0BYpY8DwZu+lnv8BO90Ca g==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="467082401" X-IronPort-AV: E=Sophos;i="6.05,204,1701158400"; d="scan'208";a="467082401" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2024 01:56:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="777957638" X-IronPort-AV: E=Sophos;i="6.05,204,1701158400"; d="scan'208";a="777957638" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Jan 2024 01:56:27 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 19 Jan 2024 01:56:26 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 19 Jan 2024 01:56:26 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 19 Jan 2024 01:56:26 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 19 Jan 2024 01:56:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jpsibo4fwIjCp6y06ZAP8BpR+Zvz2uQ5Z8TKrlmkjthR3zd3mltgr9CdQQfzar9nI/H66O0yzh25t11swRgpC8FLufM9ad+UacYhRJh9h06yW23+36ruzhKFPpj2Lqbw4j1hxTK6sAjoGckrM+Gw7BsEuPV3XrWiE2mDz3PJqDfAlPkbETRh0wGtyMDFNZNwpYYg88+g8xUvSZkD7v7wY24OPDSltJeSDcQsjMPxB8Cy40tuFOQravoLDrecGh9rwTxM6diTSEorlyIUiUMT+lYB27mWMgHkS5w2GZICxTdwdxYWJgxF0okYAkaf/6glrPF8YfvVJ+3rySpaMW8Z8g== 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=3Tw/Dn1+Izd44xBA4wIQ6Pxao1g2RdhWEaO75jdfB5A=; b=kv+bE9WtXVxBpTLOdvXdAGCKu8I4T0TigiECw2XE+/KVIhVaGr6gZEZOtwAvGYCtUJbKr+QGMdXG1XfiI5FcFTzt/6bwwPQZZe+QF4BqjjhotIYdp3hArCTDkqIDAT6696x+vPHPGyspTAlz5UaDgP5HXg8+6OMUwIYNAnGcuR9ywwX2WYGaaHJRdMfQ13gevU/YYGg/JEkNh9teTV7e8aFGlzaRalef5hqKmYQXtg7zLkEoKpIhTmZ8YuZLkSBCfmwW/TraEJF4yzg4+EYrHbha4iwhFyj/PKm1dXKRbL2WF8oMW6RDPP3B/oIoxEHHpeKOQ4TpaIbteLP9VpraXA== 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 Received: from SN7PR11MB7639.namprd11.prod.outlook.com (2603:10b6:806:32a::14) by PH0PR11MB7472.namprd11.prod.outlook.com (2603:10b6:510:28c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Fri, 19 Jan 2024 09:56:23 +0000 Received: from SN7PR11MB7639.namprd11.prod.outlook.com ([fe80::8a06:eadf:e98b:23ad]) by SN7PR11MB7639.namprd11.prod.outlook.com ([fe80::8a06:eadf:e98b:23ad%2]) with mapi id 15.20.7202.020; Fri, 19 Jan 2024 09:56:23 +0000 From: "Power, Ciara" To: Jonathan Erb CC: "dev@dpdk.org" , "Richardson, Bruce" Subject: RE: [PATCH] telemetry: correct json empty dictionaries Thread-Topic: [PATCH] telemetry: correct json empty dictionaries Thread-Index: AQHaSjN0tIm4rke3Vka+x5vuEAdQWrDg5wAw Date: Fri, 19 Jan 2024 09:56:23 +0000 Message-ID: References: <20231224220201.762377-1-jonathan.erb@threater.com> <20240118172602.898004-1-jonathan.erb@threater.com> In-Reply-To: <20240118172602.898004-1-jonathan.erb@threater.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN7PR11MB7639:EE_|PH0PR11MB7472:EE_ x-ms-office365-filtering-correlation-id: 6a6c31cb-03bc-4f04-cbe3-08dc18d4e53f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: z6Qt/c5/V1D0jsJ6g9nEe0gG48xpth2y+RLn43AewkEwuE/uzBvf1kk1mv92cq11+NCk+j5mDo9gwCxNwW+HGrlx3+npS7kCj+s5BqTTwJSx/4NuTTs9Oe/g6NCgD/MapaQl7GGFM5flh4f6poNmtkojBPsDQmiXMgWxU/+HZ7nj5k+ckH3WqkpgAzV5BNp9qzR/GfGQTyHJktqmZ9bEErsGk6RfVkIDfYttbZnlmWs/MRkYPYJPgJf9eu+B52JC+Dph7/6Wrf5Ik8sztn9D3AN7XnBJiU1DYF0Xgwn+sg1grIVnkWFgDWkYD5/9p8XSzdGJXVmDbbD6ZtWZv4PRzY0j0IgpEo9ZsOd1hChwVLfm5ZeOVXcU+KaIXYRZ/SeRCkLY1YE4yUGO/9Wr7R47VQ2pNKpWsCUAahZfHSa2g+++WOMP2rr1RBR6jyC84Sl18SHkCBdfPApjDERjWyW9PVgTAhSrD+4ddcLA8CQWsPJ7dPaJ6H5dYxwnAjqR00rWGft8UCwCybqh+ebIRZ1rAk2/O14HjTgVVqb9QU+nc6UP3QUWzLdwE3v6pdheS+Hx30T+UGeuQ64SiYWdPDHo4wncHZhZlxJX2VLqvoJz04Vcj1ZTZuq2tU4pG3yUwp+m x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7639.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(39860400002)(396003)(136003)(346002)(376002)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(38070700009)(2906002)(86362001)(41300700001)(83380400001)(6506007)(82960400001)(71200400001)(26005)(66446008)(9686003)(53546011)(7696005)(38100700002)(54906003)(55016003)(122000001)(107886003)(33656002)(66946007)(66476007)(66556008)(6916009)(64756008)(76116006)(8676002)(8936002)(4326008)(52536014)(316002)(5660300002)(478600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NXVj53HKUWxhi5DcFGpMu6uQR82VKi0z2x6hc2UgtHkHMJpU3CaGbG5YOvIi?= =?us-ascii?Q?1cmbo4y9apKY8MPS5sJvCF8H/xhjGVqDg+XZtYIbH1uonpoiNNLHi+wC7b2h?= =?us-ascii?Q?8kFeT6+Ag8QnSBuveFk7xprk9VnDPC3NbWQPYuP/aA1qZzFXhBSeH0Jb1dpw?= =?us-ascii?Q?pQuV7rd2ZB3489Yp1Io5mvI8Oh6PRXFpiAwe3sAE+KTUUo8M31oyZ9yDwA96?= =?us-ascii?Q?u44Q8LLDh4E0bSZkD9CEdYSbYPCTVxBIVor2upz1MWYZWAw7L5DOWnKZbTHy?= =?us-ascii?Q?4Ke+lB68VMNPCmjuhZHCUIU7gW7V5lu0xGL/dpWnJeU8qak1Owqz/KBiW32v?= =?us-ascii?Q?0PKrWmpDVUcIT+paYhT8fX2sZp8Vu8JUW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ascii?Q?snoGrwmfE0YUiu020+95lL96s17QDIjE0GI2ELBsrkeCCP/UljlXTJ5do0L+?= =?us-ascii?Q?ChGxHOCrAnDcrV5fb5yQIg9faAF6rmoCQWg5T8b3wzxgtqE+NEah37LWMPMy?= =?us-ascii?Q?bnVAu6sx0QwT5z9IdV2Yb/cs4RwVh660fayK4ldJEWAivJBjr0dBupFiycWE?= =?us-ascii?Q?UXazxS72wRbbiqdL0W92PDVYptqkztouwc6NF/q1Dab5F9TyqbQyzIxJJMX1?= =?us-ascii?Q?leLUHETONvOsq53oeFJIhYRki6RxUO6YEzirQUjL0YuMspYPwLXkuN3WtuXN?= =?us-ascii?Q?EJHoqn/eZekZ48phaYvIVJn/qmVPubReABgWPyDa?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7639.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a6c31cb-03bc-4f04-cbe3-08dc18d4e53f X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2024 09:56:23.7682 (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: cy2GndOJZXc2EpehtyfegL7XzoLRJ0Hop6nP6p7HVZqavIh+0Y++LhMf3pYjmC5e4tTC3pdeUQG2dIOPC3EFcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB7472 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 > -----Original Message----- > From: Jonathan Erb > Sent: Thursday, January 18, 2024 5:26 PM > To: Power, Ciara > Cc: dev@dpdk.org; Richardson, Bruce ; > Jonathan Erb > Subject: [PATCH] telemetry: correct json empty dictionaries >=20 > Fix to allow telemetry to handle empty dictionaries correctly. >=20 > 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. >=20 > Signed-off-by: Jonathan Erb > --- > .mailmap | 2 +- > lib/telemetry/telemetry.c | 6 +++++- > 2 files changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/.mailmap b/.mailmap > index ab0742a382..a6b66ab3ad 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -675,7 +675,7 @@ John Ousterhout John > Romein John W. Linville Jon= as > Pfefferle -Jonathan Erb > > +Jonathan Erb > + > Jonathan Tsai Jon DeVree > Jon Loeliger diff --git a/lib/telemetry/telemetry.c > b/lib/telemetry/telemetry.c index 92982842a8..eef4ac7bb7 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 !=3D TEL_ARRAY_INT && d->type !=3D > TEL_ARRAY_STRING) > return snprintf(out_buf, buf_len, "null"); >=20 > - used =3D rte_tel_json_empty_array(out_buf, buf_len, 0); > + if (d->type =3D=3D TEL_DICT) > + used =3D rte_tel_json_empty_obj(out_buf, buf_len, 0); > + else > + used =3D rte_tel_json_empty_array(out_buf, buf_len, 0); > + > if (d->type =3D=3D TEL_ARRAY_UINT) > for (i =3D 0; i < d->data_len; i++) > used =3D rte_tel_json_add_array_uint(out_buf, > -- > 2.34.1 Acked-by: Ciara Power