mem: fix displaying heap ID failed for heap info command

Message ID 20230209030341.9697-1-lihuisong@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series mem: fix displaying heap ID failed for heap info command |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

lihuisong (C) Feb. 9, 2023, 3:03 a.m. UTC
  The telemetry lib has added a allowed characters set for dictionary names,
See commit
2537fb0c5f34 ("telemetry: limit characters allowed in dictionary names")

The space is not in this set, which cause the heap ID in /eal/heap_info
cannot be displayed. Additionally, 'heap' is also misspelling. So use
'Heap_id' to replace 'Head id'.

Fixes: e6732d0d6e26 ("mem: add telemetry infos")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 lib/eal/common/eal_common_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

fengchengwen Feb. 9, 2023, 3:23 a.m. UTC | #1
Acked-by: Chengwen Feng <fengchengwen@huawei.com>

And, how abort add error log in telemetry valid_name, so so that problems can
be identified as early as possible.

On 2023/2/9 11:03, Huisong Li wrote:
> The telemetry lib has added a allowed characters set for dictionary names,
> See commit
> 2537fb0c5f34 ("telemetry: limit characters allowed in dictionary names")
> 
> The space is not in this set, which cause the heap ID in /eal/heap_info
> cannot be displayed. Additionally, 'heap' is also misspelling. So use
> 'Heap_id' to replace 'Head id'.
> 
> Fixes: e6732d0d6e26 ("mem: add telemetry infos")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>  lib/eal/common/eal_common_memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
> index c917b981bc..c2a4c8f9e7 100644
> --- a/lib/eal/common/eal_common_memory.c
> +++ b/lib/eal/common/eal_common_memory.c
> @@ -1139,7 +1139,7 @@ handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params,
>  	malloc_heap_get_stats(heap, &sock_stats);
>  
>  	rte_tel_data_start_dict(d);
> -	rte_tel_data_add_dict_uint(d, "Head id", heap_id);
> +	rte_tel_data_add_dict_uint(d, "Heap_id", heap_id);
>  	rte_tel_data_add_dict_string(d, "Name", heap->name);
>  	rte_tel_data_add_dict_uint(d, "Heap_size",
>  				   sock_stats.heap_totalsz_bytes);
>
  
David Marchand Feb. 9, 2023, 8:48 a.m. UTC | #2
On Thu, Feb 9, 2023 at 4:24 AM fengchengwen <fengchengwen@huawei.com> wrote:
>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> And, how abort add error log in telemetry valid_name, so so that problems can
> be identified as early as possible.
>
> On 2023/2/9 11:03, Huisong Li wrote:
> > The telemetry lib has added a allowed characters set for dictionary names,
> > See commit
> > 2537fb0c5f34 ("telemetry: limit characters allowed in dictionary names")
> >
> > The space is not in this set, which cause the heap ID in /eal/heap_info
> > cannot be displayed. Additionally, 'heap' is also misspelling. So use

I agree this typo is ugly, but I wonder if some telemetry users
started relying on it...


> > 'Heap_id' to replace 'Head id'.
> >
> > Fixes: e6732d0d6e26 ("mem: add telemetry infos")

IIUC, the commit that broke displaying "Head id" is actually the one
that limited the set of chars.


> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Huisong Li <lihuisong@huawei.com>
  
lihuisong (C) Feb. 11, 2023, 2:58 a.m. UTC | #3
在 2023/2/9 16:48, David Marchand 写道:
> On Thu, Feb 9, 2023 at 4:24 AM fengchengwen <fengchengwen@huawei.com> wrote:
>> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>>
>> And, how abort add error log in telemetry valid_name, so so that problems can
>> be identified as early as possible.
>>
>> On 2023/2/9 11:03, Huisong Li wrote:
>>> The telemetry lib has added a allowed characters set for dictionary names,
>>> See commit
>>> 2537fb0c5f34 ("telemetry: limit characters allowed in dictionary names")
>>>
>>> The space is not in this set, which cause the heap ID in /eal/heap_info
>>> cannot be displayed. Additionally, 'heap' is also misspelling. So use
> I agree this typo is ugly, but I wonder if some telemetry users
> started relying on it...
we should have gotten feedback earlier if telemetry user relied on it.
Because this field has not been displayed since September last year.
Or do we add an announcement in rel_notes?
>
>
>>> 'Heap_id' to replace 'Head id'.
>>>
>>> Fixes: e6732d0d6e26 ("mem: add telemetry infos")
> IIUC, the commit that broke displaying "Head id" is actually the one
> that limited the set of chars.
Ack, I will add the following commit:
Fixes: 2537fb0c5f34 ("telemetry: limit characters allowed in dictionary 
names")
>
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>
  
lihuisong (C) Feb. 11, 2023, 3:04 a.m. UTC | #4
在 2023/2/9 11:23, fengchengwen 写道:
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> And, how abort add error log in telemetry valid_name, so so that problems can
> be identified as early as possible.
It might be better for adding an error log.
What do you think, Bruce?
>
> On 2023/2/9 11:03, Huisong Li wrote:
>> The telemetry lib has added a allowed characters set for dictionary names,
>> See commit
>> 2537fb0c5f34 ("telemetry: limit characters allowed in dictionary names")
>>
>> The space is not in this set, which cause the heap ID in /eal/heap_info
>> cannot be displayed. Additionally, 'heap' is also misspelling. So use
>> 'Heap_id' to replace 'Head id'.
>>
>> Fixes: e6732d0d6e26 ("mem: add telemetry infos")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> ---
>>   lib/eal/common/eal_common_memory.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
>> index c917b981bc..c2a4c8f9e7 100644
>> --- a/lib/eal/common/eal_common_memory.c
>> +++ b/lib/eal/common/eal_common_memory.c
>> @@ -1139,7 +1139,7 @@ handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params,
>>   	malloc_heap_get_stats(heap, &sock_stats);
>>   
>>   	rte_tel_data_start_dict(d);
>> -	rte_tel_data_add_dict_uint(d, "Head id", heap_id);
>> +	rte_tel_data_add_dict_uint(d, "Heap_id", heap_id);
>>   	rte_tel_data_add_dict_string(d, "Name", heap->name);
>>   	rte_tel_data_add_dict_uint(d, "Heap_size",
>>   				   sock_stats.heap_totalsz_bytes);
>>
> .
  

Patch

diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index c917b981bc..c2a4c8f9e7 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -1139,7 +1139,7 @@  handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params,
 	malloc_heap_get_stats(heap, &sock_stats);
 
 	rte_tel_data_start_dict(d);
-	rte_tel_data_add_dict_uint(d, "Head id", heap_id);
+	rte_tel_data_add_dict_uint(d, "Heap_id", heap_id);
 	rte_tel_data_add_dict_string(d, "Name", heap->name);
 	rte_tel_data_add_dict_uint(d, "Heap_size",
 				   sock_stats.heap_totalsz_bytes);