[dpdk-dev] [EXT] Re: [v1, 1/3] telemetry: enable storing pointer value

Gowrishankar Muthukrishnan gmuthukrishn at marvell.com
Fri Jul 30 14:08:06 CEST 2021


Hi Bruce,

> I'm a little curious as to the usefulness of having a pointer value in telemetry
> output? How would a telemetry user be expected to use pointer information
> returned? Printing pointers seems something more useful for a debugging or
> tracing interface than a telemetry one.
> 

Thanks for the quick review. I enabled _ptr API keeping few things in mind:

1. User need to explicitly type cast pointer value (ie address) to uint64_t
    which otherwise can cause compiler warning (Wint-conversion). Although
    u64 is large enough for holding address as value, type casting is problematic
    for non-64 bit machines (eg 32 bit). One other option is to use uintptr_t
    as a holder.

2. With this API, code walk could be easier as user can interpret the accessed
     data better (ie ptr is address value). _ptr API is meant for pointer variables,
     though it is up to user to choose.

3. Also while debugging telemetry date using script like usertools/dpdk-telemetry.py,
    perceiving address as hex is quicker than same as u64.

Answering on returned data, user needs to convert stringified hex to pointer value.

Regards,
Gowrishankar


More information about the dev mailing list