[1/2] app/proc-info: add memory heap dump

Message ID 20240702131436.2873832-1-g.singh@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] app/proc-info: add memory heap dump |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Gagandeep Singh July 2, 2024, 1:14 p.m. UTC
This patch add the heap dump support in proc-info
memory dump option.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 app/proc-info/main.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Hemant Agrawal July 3, 2024, 8:33 a.m. UTC | #1
On 02-07-2024 18:44, Gagandeep Singh wrote:
> This patch add the heap dump support in proc-info
> memory dump option.
>
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>   app/proc-info/main.c | 5 +++++
>   1 file changed, 5 insertions(+)

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  
Thomas Monjalon July 29, 2024, 5:18 p.m. UTC | #2
02/07/2024 15:14, Gagandeep Singh:
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -637,6 +638,10 @@ meminfo_display(void)
>  	rte_memzone_dump(stdout);
>  	printf("---------- END_MEMORY_ZONES -----------\n");
>  
> +	printf("------------ HEAP DUMP -------------\n");

Should we add "MALLOC"?
With underscores for consistency?

> +	rte_malloc_dump_heaps(stdout);
> +	printf("---------- END_HEAP_DUMP -----------\n");
> +
>  	printf("------------- TAIL_QUEUES -------------\n");
>  	rte_dump_tailq(stdout);
>  	printf("---------- END_TAIL_QUEUES ------------\n");
>
  
Gagandeep Singh July 30, 2024, 11:10 a.m. UTC | #3
Hi,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, July 29, 2024 10:48 PM
> To: Gagandeep Singh <G.Singh@nxp.com>
> Cc: dev@dpdk.org; Reshma Pattan <reshma.pattan@intel.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>
> Subject: Re: [PATCH 1/2] app/proc-info: add memory heap dump
> 
> 02/07/2024 15:14, Gagandeep Singh:
> > --- a/app/proc-info/main.c
> > +++ b/app/proc-info/main.c
> > @@ -637,6 +638,10 @@ meminfo_display(void)
> >  	rte_memzone_dump(stdout);
> >  	printf("---------- END_MEMORY_ZONES -----------\n");
> >
> > +	printf("------------ HEAP DUMP -------------\n");
> 
> Should we add "MALLOC"?
> With underscores for consistency?
Ok, submitted the V2.

> 
> > +	rte_malloc_dump_heaps(stdout);
> > +	printf("---------- END_HEAP_DUMP -----------\n");
> > +
> >  	printf("------------- TAIL_QUEUES -------------\n");
> >  	rte_dump_tailq(stdout);
> >  	printf("---------- END_TAIL_QUEUES ------------\n");
> >
> 
> 
> 
>
  
David Marchand Oct. 11, 2024, 1:15 p.m. UTC | #4
On Tue, Jul 30, 2024 at 2:04 PM Gagandeep Singh <g.singh@nxp.com> wrote:
>
> v2 change:
> * Handled a comment to add "MALLOC" while dumping
>   malloc heaps.
>
> Gagandeep Singh (2):
>   app/proc-info: add memory heap dump
>   eal: add total memory size in memory dump APIs

Series applied, thanks.
  

Patch

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index b672aaefbe..7137891c14 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -20,6 +20,7 @@ 
 #include <rte_debug.h>
 #include <rte_ethdev.h>
 #include <rte_memory.h>
+#include <rte_malloc.h>
 #include <rte_memzone.h>
 #include <rte_launch.h>
 #include <rte_tailq.h>
@@ -637,6 +638,10 @@  meminfo_display(void)
 	rte_memzone_dump(stdout);
 	printf("---------- END_MEMORY_ZONES -----------\n");
 
+	printf("------------ HEAP DUMP -------------\n");
+	rte_malloc_dump_heaps(stdout);
+	printf("---------- END_HEAP_DUMP -----------\n");
+
 	printf("------------- TAIL_QUEUES -------------\n");
 	rte_dump_tailq(stdout);
 	printf("---------- END_TAIL_QUEUES ------------\n");