[PATCH v8] mem: telemetry support for memseg and element information

David Marchand david.marchand at redhat.com
Wed Jun 7 22:40:10 CEST 2023


On Wed, May 17, 2023 at 11:22 AM Amit Prakash Shukla
<amitprakashs at marvell.com> wrote:
>
> Changes adds telemetry support to display memory occupancy
> in memseg and the information of the elements allocated from
> a memseg based on arguments provided by user. This patch
> adds following endpoints:
>
> 1. /eal/memseg_lists
> The command displays the memseg list from which the memory
> has been allocated.
> Example:
> --> /eal/memseg_lists
> {
>   "/eal/memseg_lists": [
>     0
>   ]
> }
>
> 2. /eal/memseg_list_info,<memseg-list-id>
> The command outputs the memsegs, from which the memory is
> allocated, for the memseg_list given as input.
> Example:
> --> /eal/memseg_list_info,0
> {
>   "/eal/memseg_list_info": [
>     0,
>     1,
>     2,
>     3,
>     4,
>     5
>   ]
> }
>
> 3. /eal/memseg_info,<memseg-list-id>,<memseg-id>
> The command outputs the memseg information based on the
> memseg-list and the memseg-id given as input.
> Example:
> --> /eal/memseg_info,0,5
> {
>   "/eal/memseg_info": {
>     "Memseg_list_index": 0,
>     "Memseg_index": 5,
>     "IOVA_addr": "0x1c0000000",
>     "Start_addr": "0x1c0000000",
>     "End_addr": "0x1e0000000",
>     "Size": 536870912,
>     "Hugepage_size": 536870912,
>     "Socket_id": 0,
>     "flags": 0
>   }
> }
>
> --> /eal/memseg_info,0,1
> {
>   "/eal/memseg_info": {
>     "Memseg_list_index": 0,
>     "Memseg_index": 1,
>     "IOVA_addr": "0x140000000",
>     "Start_addr": "0x140000000",
>     "End_addr": "0x160000000",
>     "Size": 536870912,
>     "Hugepage_size": 536870912,
>     "Socket_id": 0,
>     "flags": 0
>   }
> }
>
> 4. /eal/mem_element_list,<heap-id>,<memseg-list-id>,<memseg-id>
> The command outputs number of elements in a memseg based
> on the heap-id, memseg-list-id and memseg-id given as input.
> Example:
> --> /eal/mem_element_list,0,0,5
> {
>   "/eal/mem_element_list": {
>     "Element_count": 2
>   }
> }
>
> --> /eal/mem_element_list,0,0,1
> {
>   "/eal/mem_element_list": {
>     "Element_count": 52
>   }
> }
>
> 5. /eal/mem_element_info,<heap-id>,<memseg-list-id>,<memseg-id>,  \
>    <elem-start-id>,<elem-end-id>
> The command outputs element information like element start
> address, end address, to which memseg it belongs, element
> state, element size. User can give a range of elements to be
> printed.
> Example:
> --> /eal/mem_element_info,0,0,4,1,2
> {
>   "/eal/mem_element_info": {
>     "element_1": {
>       "msl_id": 0,
>       "ms_id": 4,
>       "memseg_start_addr": "0x1a0000000",
>       "memseg_end_addr": "0x1c0000000",
>       "element_start_addr": "0x1a01fe680",
>       "element_end_addr": "0x1a0bfe700",
>       "element_size": 10485888,
>       "element_state": "Busy"
>     },
>     "element_2": {
>       "msl_id": 0,
>       "ms_id": 4,
>       "memseg_start_addr": "0x1a0000000",
>       "memseg_end_addr": "0x1c0000000",
>       "element_start_addr": "0x1a0bfe700",
>       "element_end_addr": "0x1a15fe780",
>       "element_size": 10485888,
>       "element_state": "Busy"
>     },
>     "Element_count": 2
>   }
> }
>
> Signed-off-by: Amit Prakash Shukla <amitprakashs at marvell.com>
> Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

Applied, thanks.


-- 
David Marchand



More information about the dev mailing list