From patchwork Tue Jul 30 11:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 142755 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2967B456F4; Tue, 30 Jul 2024 14:04:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A04240611; Tue, 30 Jul 2024 14:04:10 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013012.outbound.protection.outlook.com [52.101.67.12]) by mails.dpdk.org (Postfix) with ESMTP id 3E1C3400D7 for ; Tue, 30 Jul 2024 13:03:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iZRa3n1y7cnJUj49zMjH6CIXQSAxw3VI2KgoGvke/1AxUVnW+Up4FrcJbhtwXP556CV5eI2KFbvdkEhRHTzflRdrsBTmBSB+u54PQFtQTJTSMiu2reZ+D0SdHhA97sldxzzWRky3dUjDJ9/Y5U/5UacD+LgJ0gcQayYspijez1HVnnSI09FzkEjzt62c+pv0Wtvs+9I1CZXLqGiX8OeWCglNbrZvYWqS9TbhaRDKNiPd14ff+h1/Usbbw7r03cqo6lRZ3XUi3H1n/17DJ9Rk8+j3SKMBz/OFw7+UeGubkBe3qegGmVCD9rkHj4ohPAaHJXqTGUrE2hr5xw2eZId62A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Hy3qx9R/H5I4WcuVbqtxaxZyELYO5+/M/L20Yb/114w=; b=lqXEaKonBzQRwSVae940MYLUxgHcFuUqV65OjxsEq2doRungFdjgOCOWrUtf5crxi9cpmGkK16laAZ3+SVjWB6BdXuObED5JrwfRl1DTu6bQWmCtuDwrsSlMXi/J1J7PD17SjeC+Noy5tgFBoFpMPg1Op2NoCdw2kmLrTIY4G6Tuvdpk0rna/NVglP49QCm7Y/yZJTTbNToB5wt7Ij3xAO0ULvLgolDyGQKjZQ8whCHjnk05r2ZVYBIPO5hTT29wr1UcCshiamkENFfGN3Tly/0zDHBXWdC+fIYsX4e5KGgdyGBZsNnrQQ7/c48yboOIUXbt75jXMGBe6Cp3W+kvqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hy3qx9R/H5I4WcuVbqtxaxZyELYO5+/M/L20Yb/114w=; b=PntW3sE36mwBUT5zGpuQUuKqfHM8KhsppdjxLLzGEURRF7Cw6LD16slcUvmk8bm6++tlhBIZFod5mf7C/wob32wpW1J7wFbUJTTuZi/BfNNrwUOfx3VNPBZfVXxmfWiYFC7lI7hD9zxGldWcjqd0bd+hWlAe0imYDSU4HgOmiNCttaVwdcp1kvS1XCNJ0un2weWzpfGr0leoZ1MnMcEhGVDiYpKqGKOZogFwLdqMXatw9SPktyHwoPWq6ipAxGfrUSebXOs6H0ZTNesAjqHOxbyDqnG70EpdVlFsezrFdJ6LZYnMCSBsEohIUTV0IW64E8isIkdNB2iEfUDqo26vlw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) by AS5PR04MB10018.eurprd04.prod.outlook.com (2603:10a6:20b:67e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.26; Tue, 30 Jul 2024 11:03:29 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%7]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 11:03:29 +0000 From: Gagandeep Singh To: dev@dpdk.org, Reshma Pattan Cc: Hemant Agrawal Subject: [v2 1/2] app/proc-info: add memory heap dump Date: Tue, 30 Jul 2024 16:33:12 +0530 Message-Id: <20240730110313.2555473-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240730110313.2555473-1-g.singh@nxp.com> References: <20240702131436.2873832-1-g.singh@nxp.com> <20240730110313.2555473-1-g.singh@nxp.com> X-ClientProxiedBy: SI2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:195::10) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|AS5PR04MB10018:EE_ X-MS-Office365-Filtering-Correlation-Id: b01bb08e-2492-4fb3-5937-08dcb0873e5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: w5dP9LfZi41cFtIKgjsmPlXoahQdMuFNjU95iPuOo+DdJaHimFF6oAd751S/FOJE2/xvEy4BxgoqHLaOZFacotBnbBHh6M7LBL55udsLCr/GcMZQTZolu9BZzSKe6aD2xamYYDX7jIiLEXWwCZ7ZjeA5eLaBOkegxr53DOTgJqzumQ95EpYdYYlV7JjfiJucl1B84FVV7eFwbBDt6tj7Ltm6FmDyL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ojJzr7jkuzki87dxBVqiSMWP2YSnPWZDndJfKnJ+0yq3WvAWw6LwIGp5Iq4Sj+l1q0jGlkMS/fw8lzWRsb3XODUBwAKgYv3W+VopVohDrmiVW9m2zq0bAwZdnQ4K8KdoiPzmvrk8knaE47iU5g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8205.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DKkGHpKRHHKpsJgQuBqtvd8T/XLt/7coVFMCtBmfTQx+2uP8mbCiUUcrn8ZmfxiW88raopFCNC5OwL1N0/VyRw7go4NHKzfccuoRS4qDSe2kHPSzQG0EtFcacby0BD1bpmYrzsodIU3qxzUnANiUrpdeT/ZxpG/ekC5QPZc1P7z9959PNuSA/V/per8GCmAQwaMQQymDlus/hlOTCGTIPGYmz93W5EaM5GYzmBUd387P1BfkojfWchYBz4mdbIcloz+VU6UnHmF3GKZCidHztgNgh7H8jl281ADv4waimWLy8ETGMPpFKbdlx61rQJEXX64zO3ht1SvxVnCDs16inKrmY9x2TzS7TqT8OnDgkFQFAhli4VxXDT/Wo4k5Ijt1dtyDzQksydZVJhWawU3tOuWbhauLWf1N0+GwYvdRS7mK9YQPKaBF8RBJsW/fYY4v7exJW/b5kackPCUnmRJouOU1VwSPxxsoaArdyZCq1X797MHB56qR7rDH/L2JyPu1klwIwuKMR2Mx7O1G5gW87SyPSL/T1pOn2Bs4mlzC5YzuR3cGfvnlW1WopT4QqaBUv/clObuIZ+DQUPXDc31U83iJBbWDJHZhyH/pENCTosL6yW/7RNsl97XC0rAk4zaWGQLIifWM/QSA3taX1lSny5ztnwR0g2L5Wig/Nn0AOOcvyIeYXDTGkkxPydJYUMETfDNv8/CUAUwi/jxObIGfYbjMU1dsIgjqKx9/G6nGR2QDivWAOKukrLFQKzddp2dfO3bPrevAs6LSjn47KQ6xY9R/aae90sChPg9BviiBOohMM0OshTgfx3COhYOqnOZPy5YGTkp0d68mxkggd6Gd9p/y4pksbhCAubjbADZKgpITtXgsvRUQ/jsXo7KfN2adCYvaBOt31+Mm21aocQaVBVvufTJOaAGU/zxp0dX5CI8ORvVkaBKRY4uCQJ58gRgDR8cS8uLvhU081a+Lh3Pg33l2N4d6kZzgvLsX0ErWD2iOcf1l25/mfST+Y83g50+e2fFWI5mO9Xhz1Ek4uMd+2ajm9m+QWxjY2zncpBM93B51uTpqbNyMfAg+gwM8o39K0gXaXHWJ+Ws6VIff2aV1sFonxrV/XZb2boxlCo5HQlEIc7lfTXBKNSUnOE/wnEzb7pMpTKOQuj2HmeD9CWdWq/XnpmeP27dajd0WkAOzFaePF07TrRu1pCVquDHgi0cv0TtgfcuZ3rdVAejLk92x+H/QSIW+8N5gpTy667rAi5IiXmJntx//yHCabYE2OWO5f1MvEdeDtcDYljJOlsY02jzutU0JfSoXxgtgxJ0ilZJHiqIdsiXGyeW29sxzPBvB9sk2ifWM8AEVTtjaM56QX4kPB2CEvPWqjBzG2d6wpLOaZ3e9tLCpiim2MEHcsupigG7YIU6WH9oilraCUvtT1t0eh8nvaLPDBm7JE4aJUGOXN1q2Rm3cf0vGbHzcpmBVSgQPD/4uavLBUd3nDP249UcyP7ZHZNLvTub8OCXQqQ+4XgS4Zkei8oVfDgCB15myTOptRFCPX1JpsrpUdo5TSyKNfSMOOczUVivFnld2yXA= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b01bb08e-2492-4fb3-5937-08dcb0873e5d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 11:03:29.6112 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TiMlPwVk9zpjIANPJpQKt/kGv7Gx+KVAF/QqQkA5TWpdVO7Jg86/NeOE4szWBVJh X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10018 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch add the malloc heap dump support in proc-info memory dump option. Signed-off-by: Gagandeep Singh Acked-by: Hemant Agrawal --- app/proc-info/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index b672aaefbe..9e26b5cf3b 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -637,6 +638,10 @@ meminfo_display(void) rte_memzone_dump(stdout); printf("---------- END_MEMORY_ZONES -----------\n"); + printf("---------- MALLOC_HEAP_DUMP -----------\n"); + rte_malloc_dump_heaps(stdout); + printf("-------- END_MALLOC_HEAP_DUMP ---------\n"); + printf("------------- TAIL_QUEUES -------------\n"); rte_dump_tailq(stdout); printf("---------- END_TAIL_QUEUES ------------\n"); From patchwork Tue Jul 30 11:03:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 142756 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 810CF456F4; Tue, 30 Jul 2024 14:04:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B24DB40616; Tue, 30 Jul 2024 14:04:11 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013002.outbound.protection.outlook.com [52.101.67.2]) by mails.dpdk.org (Postfix) with ESMTP id 9E02F400D7 for ; Tue, 30 Jul 2024 13:03:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nPbPpE3319b1Ul75ZxnKOQ8SMfEjYqIigFTWwoGdNq0VUhYqe05rKorgGDkSGvRhxQZQ/Dj5BmGYvvKh8VXTOlVkvgNU1F12u+pmr5jQOMNZJbOoeScbJRKzHRwqOs6jiuc57jfDkNZpre7YBME6BloXjYi3cFcDR/+XSEjln3qSU4isQqmaLUZKanMUcmOiklpcanP0zHeD/D6VrG6igzELM9fMcOGauTC0cneoWlFJcGxflPdMRcxBKOdGQmxVyM7PP9r6F0VwpKTmcVD1XdI0tiqkF70Ubd+9vB0q2zgRTgyV71V2HV5Kni1HujBp/eCXLTYN3ZKqFA+12NnRbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pqsTftf2gOlJmeNdGmTfdgJvS1Kw2R4Ab+YlOfJsTm8=; b=qI/TO8RB2FwMu6B7jae9fS2NmUcvLd4iQezgUzK79N4enpX3GuM0H96NLh/nqUewl/sYzQwm5UGXlxzdtTg9rn180vdytcaBDQnz1YXzpWa+NLx1aBOrodHQzw8rhLMPGtPSh9vtdnhjhK8lD9B2OSLhz73Q1S9GEsJjiJhBTs0Fcr0ddNqpBYr4qgNzSMAiQoSlmLZ96/CjcBnAiUCsAsfj/Rh8SI/R2SPaXawr21+ZxKJmmEAdfSN2GXMC5ox0FtWU8w9HjZcrdq7B+sphL+b0v7bu2/kVUiYwF+y0saWNOk+FFQmwb+mKWiJGt7Mmzy+PTRB7F67fe/TPjoXCWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pqsTftf2gOlJmeNdGmTfdgJvS1Kw2R4Ab+YlOfJsTm8=; b=lRyZTH4FL7X09czC79q+DuCiJdMHhiZLC2jU1ojWQqYJEGmGbq22JvOeHNHCQRWQBzaGAdCx8ZdIu7EnqFqUJzOezj3oaxQUmJ1FKuOtxUhfTloQhUjdpfI8JsBAxOB5NtLdY/DCJR7qz4xT+Z5FvHbBnb2+rxJlXmDGuQ9OJGFlgLl4qTZnCrpExx8d4QHvgPVTK+BPLfTH/eYDnER6ArLYfBEeqb9Vn3cf3TRnReCFWB6ru6wBcYHpqtBIb9j38gE3e3lzohpXm2jdRBAIZfksR1kA/rGvf7DAfLrQgrwRuufSq5/KrWH5vJU2wiBDSQHxOn0b3x86Aez4CBLXjQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) by AS5PR04MB10018.eurprd04.prod.outlook.com (2603:10a6:20b:67e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.26; Tue, 30 Jul 2024 11:03:31 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%7]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 11:03:31 +0000 From: Gagandeep Singh To: dev@dpdk.org, Anatoly Burakov , Tyler Retzlaff Subject: [v2 2/2] eal: add total memory size in memory dump APIs Date: Tue, 30 Jul 2024 16:33:13 +0530 Message-Id: <20240730110313.2555473-3-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240730110313.2555473-1-g.singh@nxp.com> References: <20240702131436.2873832-1-g.singh@nxp.com> <20240730110313.2555473-1-g.singh@nxp.com> X-ClientProxiedBy: SI2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:195::10) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|AS5PR04MB10018:EE_ X-MS-Office365-Filtering-Correlation-Id: 57c4abd4-81e7-470d-4cb7-08dcb0873f74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: +5p+N8HRCUo5W0dE+nCf9sqTsjSy0Ca7vhvMvuiJshpTHyATN34vDt0WcuMeeE3/xQxoB+oir32fGwAB13cZQZqqjwxaRb+zF0bLKR9O8ebvzDXo7Qtl+fhIOccACAnnUNwPC9k8pLKEqkV5J9sSoDa0vvnwsSWhh0IbQlIqeuBy6DPLv37XwnbWP0dX3zGwqEbwUbZNhTgf91/2jEkazF8qKGUIiuvNyijyvWb8/P8YW58KlNVJIQA+ImCrQt1VAQBudcy49/LJv82YfrLqMll4IoSivqiSBkWAlvL8+UGY/85gsBtDfGsYPTpecGBOyvpeBi3UDxNotbpmjin3pzsDppcD3OMg2P9944wqt25JOwnuOQ/yqOHhQLh8bxKzGoLQjqqVsDji7GSCeTd8ldHwh+I6XN7/Qu+5cgQJku0ELgycCL2tY8W4lq+AayOKcEMnQSsT6Sz57xv67wHlxsjU4yI6tf7JUxESbgbZLW1ud2cKoB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)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AT52oN68YDrrsBiWLGKqV7DhlVju+CMnG4x4XsOxEYX4aroIHvlYQ5rrYPo/wnVxP+nO4eBYB/lXqKCZqqJuSAbOWFQL4VmAvzVjuQki2xizjk3QAZlHNFTHmqVPOqcleenbxogtUjtjIZVafoXga3LVuTfjotVXdt9kg4aTBtr0AJEAYSP1pAoOw2jKJoczCtLKb+RGSt1X1omp6cQei4xmy4wUr/K5f1L+xtpYOM0F77YiXXQe/um0/BE3vwtHopICWHFy/MBJqKazYMlAXLNoRgo6gc9o/goPq01AEuvbWdXoO7P3+Lmm1xEAnycw1lsdyubcSfbxqrmMayQMxlsNNBLARIkEeZyzGDb3wNKFLLwLJHtQnSZgNUEwp5U+48ULRZNnk9VOxLeeXyGs2LAQXjHIPneLVgVu45wGtlk+cxpSpeyMOqiCG3pFG2YxJ4ivEFGE10aMT/1RUYfilc87jwfjJSfPXt7GVYC0O3cZWvl1RkeotrH2JF+BFulpaEtpTHWp4O5Yukdm0b2iJPigEdQBggfP10otHMbY5dVB/ZDWwAbcGXFqopQl/BYR1oWp/H4aqvvNE5zFpxGiZGSHZttJ20SPVXrLjeA9/dshYe6z982kMHkZ2BzjkzYLyiTrgTua7S8dLfWPaO6o1xYbdXvZsySBK5U8YNm/TLRtJCO3BbQ/j/nJJBBlTN8Lf0L/ZC2rJZF0JHNdOH/TILLvgLCbBaE22TjPSP1mANX5P2HTp9yF7wX8UWgF8UVR6WDVNHxKbMubijWRhh22G9LIxRLXZzayJOVVDagtX6fdc1id+J8ZDb3FnA012Cng435NlqwIgI4Ve1UqfPSyDBUkV5xppHppcE2f3J78wydV7uaNSZtEo+8flH3UrMt4bizx398c/gWz0qB/ULtvueUg+ELI4LHlFws9tlCvDkSbAXoq+8tvdSEfUJdT4USHAkSqxStDtqcHvB7IpLBodfvNG/WWB2OUQ4Va78A3bdwRzVdxdZPbkMLIfXRmEUSVQ5B49TwKRVawjjmYWcnmj6biF/29LuV1NvQGwe6AhwMVGiCcp5MTgdk5SfzRdXm/DTqrTEhwq0DukSC2PhwVOJm9Omb+Jl5TF8JGCAU/C9Wi0m20W2ymcbkuY/7FSGawQ7jm0jznXoxfEnW95yqXPy/iK2JOvmG3iQ4UhLV6Tx+AWGypoQ/DlOboM9NxUPdgmSHkOCnAkVMwx46X+MGJCJ8zuwii9BYTfD5+qhot/Zo654h4XCVJfFTWt8Q1jOxDmirZ27xs+N1WI/Y59wKonmcmJUm5ei4qxgwV9+gbbZr7vT5IhOe4SEeq7YunDOmMnncfY9d+00UvpoooZoqHITuqD9/DFo1bmv7UQ0GTBmrZCYSf0HHPJv4fSPVNds2DbDUGrY3zBFsMHjKmH5vzDU9pMQJqsxYCNUgt0yAjY0nNZTVnzxh+9Q48nauAbPEaUl6dqG2o8NS1dupsB5puTPfH07xw2MM7h+Fu0PETF2Vc+GHwCwdyTF0Ux2QY25dycxn5SkvL5UOJ5/ru+kOWbwlROmCnMFCKG/CP+3r3oLth3Za7Qp7rETbuBwz2qr1x X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57c4abd4-81e7-470d-4cb7-08dcb0873f74 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 11:03:31.2985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wg+BDJJUljj6lLS3Q8ArjjdOZKvMjLBEQBxEqggbvwWb+0WSuEhYEUk1lB3PRBOY X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10018 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch add total memory size dump in memzone and memsegments dump APIs. Signed-off-by: Gagandeep Singh --- lib/eal/common/eal_common_memory.c | 2 ++ lib/eal/common/eal_common_memzone.c | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c index 60ddc30580..c6b9c16617 100644 --- a/lib/eal/common/eal_common_memory.c +++ b/lib/eal/common/eal_common_memory.c @@ -531,6 +531,8 @@ void rte_dump_physmem_layout(FILE *f) { rte_memseg_walk(dump_memseg, f); + fprintf(f, "Total Memory Segments size = %uM\n", + (unsigned int) rte_eal_get_physmem_size() / (1024 * 1024)); } static int diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c index 2d9b6aa3e3..4cd077d8d8 100644 --- a/lib/eal/common/eal_common_memzone.c +++ b/lib/eal/common/eal_common_memzone.c @@ -58,6 +58,11 @@ rte_memzone_max_get(void) return mcfg->max_memzone; } +struct memzone_info { + FILE *f; + uint64_t t_size; +}; + static inline const struct rte_memzone * memzone_lookup_thread_unsafe(const char *name) { @@ -367,7 +372,8 @@ dump_memzone(const struct rte_memzone *mz, void *arg) struct rte_memseg *ms; int mz_idx, ms_idx; size_t page_sz; - FILE *f = arg; + struct memzone_info *info = arg; + FILE *f = info->f; mz_idx = rte_fbarray_find_idx(&mcfg->memzones, mz); @@ -380,6 +386,7 @@ dump_memzone(const struct rte_memzone *mz, void *arg) mz->socket_id, mz->flags); + info->t_size += mz->len; /* go through each page occupied by this memzone */ msl = rte_mem_virt2memseg_list(mz->addr); if (!msl) { @@ -412,7 +419,14 @@ dump_memzone(const struct rte_memzone *mz, void *arg) void rte_memzone_dump(FILE *f) { - rte_memzone_walk(dump_memzone, f); + struct memzone_info info; + + memset(&info, 0, sizeof(info)); + info.f = f; + + rte_memzone_walk(dump_memzone, &info); + fprintf(f, "Total Memory Zones size = %uM\n", (unsigned int)info.t_size + / (1024 * 1024)); } /*