在 2022/12/10 2:24, Morten Brørup 写道:
From: Huisong Li [mailto:lihuis...@huawei.com]
Sent: Friday, 9 December 2022 12.05
Some lib telemetry interfaces add the 'u32' and 'u64' data by the
rte_tel_data_add_dict/array_int API. This may cause data conversion
error or data truncation.
The 'u32' data can not be assigned to signed 32-bit integer. However,
assigning to u64 is very wasteful, after all, the buffer capacity of
each transfer is limited. So it is necessary for 'u32' data to add
usigned 32-bit integer type and a series of 'u32' operation APIs.
This patchset uses the new 'u32' API to resolve the problem of data
conversion error, and use the 'u64' API to add 'u64' data.
In addition, this patchset introduces two APIs to store u32 and u64
values as hexadecimal encoded strings in telemetry library.
---
-v2:
- fix ABI break warning.
- introduce two APIs to store u32 and u64 values as hexadecimal
encoded strings.
Looks good.
Personally, I would prefer rte_tel_data_add_{dict|array}_u32_hex() over
_hex_u32_str(), and similar for u64; but it is a matter of taste, so feel free
to change or keep your own suggested names.
I think this name can represent the type of value stored in dict or
array.😁
In the eal_common_memory.c patch, in rte_tel_data_add_dict_u32(d, "Head id", heap_id);, consider
fixing the old typo too, it should be "Heap_id", not "Head id". On the other hand, it
will change the JSON output, so perhaps it will be considered an API breakage?
Yes, you are right. I'll try fix it in another patch.
Series-acked-by: Morten Brørup <m...@smartsharesystems.com>
.