[PATCH] telemetry: correct json empty dictionaries

Jonathan Erb jonathan.erb at threater.com
Fri Feb 2 15:04:08 CET 2024


David,

It was just a minor oversight in following commit:

commit c933bb5177cac5fbf4533e357d466cff1f3e6c97
Author: Ciara Power <ciara.power at 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 at intel.com>
     Acked-by: Bruce Richardson <bruce.richardson at intel.com>

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


More information about the dev mailing list