From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 53F5543A72;
	Mon,  5 Feb 2024 14:37:45 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 0163740DCD;
	Mon,  5 Feb 2024 14:37:45 +0100 (CET)
Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com
 [209.85.219.51]) by mails.dpdk.org (Postfix) with ESMTP id F234A40265
 for <dev@dpdk.org>; Fri,  2 Feb 2024 15:04:10 +0100 (CET)
Received: by mail-qv1-f51.google.com with SMTP id
 6a1803df08f44-68c7f482f8eso6658966d6.3
 for <dev@dpdk.org>; Fri, 02 Feb 2024 06:04:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=threater-com.20230601.gappssmtp.com; s=20230601; t=1706882650; x=1707487450;
 darn=dpdk.org; 
 h=content-transfer-encoding:in-reply-to:organization:from
 :content-language:references:cc:to:subject:user-agent:mime-version
 :date:message-id:from:to:cc:subject:date:message-id:reply-to;
 bh=8k5mslv97puOTa+k7bDy7PxnlvaqOj7euk6m0NL0E6g=;
 b=U9VxN38091L2m6GJlj5KnEqH43acAu+eUrmCtuA8WDCkxCpjIsU5PUQVTXbdbZIN77
 XUZ2BohqJwz0WtgdNDbCLxMQ+ILMIPql78TlCTluHNDNmAIjvV6+vpYeU3QYHwcgJt1F
 W4oQkeRx1750acd4IGL3ZKZ+Ew6mzxV1ucg2GzfT408vvkjamC8DeO7nH98WwSdiMSBz
 kqgQ96YCIWXpiU8P5RiITgHgR/d9EZmMb2IIMSX75c0L7+/UNHAKVcd2+4M4AG50p3C9
 eTHXjTmuNWVLCv3j9poKvSzrgnDBVmzUTAv4gvEvx8D4SuEqyI+67bOA+K+ItbvF0x7L
 JP3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706882650; x=1707487450;
 h=content-transfer-encoding:in-reply-to:organization:from
 :content-language:references:cc:to:subject:user-agent:mime-version
 :date:message-id:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=8k5mslv97puOTa+k7bDy7PxnlvaqOj7euk6m0NL0E6g=;
 b=LTuAq8SeYhQD4m9t6StgkYii7AC7pAzKU/2CpbJSPbUykgvyg3DYiJIPqciH0WTEln
 fiWUdhEwdLaYaSOyC9Ycyzt1lzI+sTLqk7mJq6zi0yQ3GQLnSWvr0Pdt4qQp19jb0bov
 gvt/PF7NJZu+5uaVykV113HhCX17xiELU/+uduSQfMFaUwP6s/OhggcwUQJImXjCNUts
 /+Up4oyjkWpJOxEwpei3YdSqehGh6HT8Hp8bFtfAVoXKc+G2/ivZD0RDuWaYmEZj4ASI
 NRHUdkEWksrkNd7yP8SGHMQxDUgFJhnCv7ehOW7QYICNWfKXHi+xVtdzCkOS2Gv6fBap
 HqqA==
X-Gm-Message-State: AOJu0YzsgCOwr65WH1ft3w4bruCuJVJV4eSfnKUoek6J5A7DaUyZx3jJ
 ee041ALv2qllAj1qjQ0AWsG9jYeCD8vKmxx2aUQ3pg5FZdRid0mH7oZkiUjl9js=
X-Google-Smtp-Source: AGHT+IEN3N6Ur+eRNFy07KM5tVQzyTbVxkAje6IQq+Gt57VvLbJOvKgFI9wnApQknAoJXf7H4p2iQw==
X-Received: by 2002:a05:6214:d87:b0:684:f558:ab6f with SMTP id
 e7-20020a0562140d8700b00684f558ab6fmr7653035qve.40.1706882650094; 
 Fri, 02 Feb 2024 06:04:10 -0800 (PST)
X-Forwarded-Encrypted: i=0;
 AJvYcCXs6AxtqQjSO47vLkSyCEgjuNgrMBrG/fOwlIxRTU6EcQT2nsyitI9rrdE+Oln+uRVaIhJU+3yvTuV2dL+EPkbOaLqStY159Hy09Km297dLnmmUbXqL+TPH
Received: from [192.168.0.11] (dyn-170-246-97.myactv.net. [24.170.246.97])
 by smtp.gmail.com with ESMTPSA id
 e19-20020ad44433000000b0068c6d56d4f7sm829058qvt.92.2024.02.02.06.04.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Feb 2024 06:04:09 -0800 (PST)
Message-ID: <550a8ada-6006-43f6-982f-a9353ad844ec@threater.com>
Date: Fri, 2 Feb 2024 09:04:08 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] telemetry: correct json empty dictionaries
To: David Marchand <david.marchand@redhat.com>
Cc: ciara.power@intel.com, dev@dpdk.org, bruce.richardson@intel.com
References: <20231224220201.762377-1-jonathan.erb@threater.com>
 <20240118172602.898004-1-jonathan.erb@threater.com>
 <CAJFAV8zMdV61_QewDGv3oZK2um9ST-3y8Y_vUULsaxyUHA0Tjg@mail.gmail.com>
Content-Language: en-US
From: Jonathan Erb <jonathan.erb@threater.com>
Organization: Threater
In-Reply-To: <CAJFAV8zMdV61_QewDGv3oZK2um9ST-3y8Y_vUULsaxyUHA0Tjg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Mailman-Approved-At: Mon, 05 Feb 2024 14:37:43 +0100
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

David,

It was just a minor oversight in following commit:

commit c933bb5177cac5fbf4533e357d466cff1f3e6c97
Author: Ciara Power <ciara.power@intel.com>
Date:   Wed Sep 23 12:12:26 2020 +0100

     telemetry: support array values in data object

     Arrays of type uint64_t/int/string can now be included within an array
     or dict. One level of embedded containers is supported. This is
     necessary to allow for instances such as the ethdev queue stats to be
     reported as a list of uint64_t values, rather than having multiple dict
     entries with one uint64_t value for each queue stat.

     The memory management APIs provided by telemetry simplify the memory
     allocation/free aspect of the embedded container. The 
rte_tel_data_alloc
     function is called in the library/app callback to return a pointer to a
     container that has been allocated memory. When adding this container
     to an array/dict, a parameter is passed to indicate if the memory
     should be freed by telemetry after use. This will allow reuse of the
     allocated memory if the library/app wishes to do so.

     Signed-off-by: Ciara Power <ciara.power@intel.com>
     Acked-by: Bruce Richardson <bruce.richardson@intel.com>

On 2/1/24 06:57, David Marchand wrote:
> On Fri, Jan 19, 2024 at 8:48 AM Jonathan Erb <jonathan.erb@threater.com> 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 <jonathan.erb@threater.com>
> Thanks for the fix.
> Could you point at the change that introduced this issue?
>
> I will add the Fixes: tag when applying.
>
>
--