From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF094C2BB1D for ; Fri, 17 Apr 2020 08:03:56 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id A5B09214AF for ; Fri, 17 Apr 2020 08:03:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5B09214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 061491DE40; Fri, 17 Apr 2020 10:03:56 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 0EEC21DAA6 for ; Fri, 17 Apr 2020 10:03:55 +0200 (CEST) From: Xueming Li To: Anatoly Burakov , Ferruh Yigit , Stephen Hemminger Cc: dev@dpdk.org, Asaf Penso Date: Fri, 17 Apr 2020 08:03:41 +0000 Message-Id: <1587110623-405-1-git-send-email-xuemingl@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1586318694-31358-1-git-send-email-xuemingl@mellanox.com> References: <1586318694-31358-1-git-send-email-xuemingl@mellanox.com> Subject: [dpdk-dev] [RFC v2 0/2] malloc: support malloc and free tracking log X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPDK uses second level memory allocation management, this makes regular memory profiler tool not applicant. This patch trys to provide a lightweight malloc and free logging, then show leaked memory entries based on logs. This tool only target to malloc and free tracking, for memzone used by ring and mempool, "dump_memzone" in testpmd list them. There will be another example that enable and dump tracking as secondary process. This tool came from Mellanox internal Hackathon, thanks Shahaf Shuler who provided the idea. V0: initial version V1: log rte_realloc function rename log size to req_size, real_size to size(total) log padding and include padding in total size rename log "free" field to "type", alloc_free to "paired" rename malloc_log_index to malloc_log_count split testpmd part into separate patch add rte_malloc_log_stop() function add log entry number check change log dump detail level from (-1,0,1) to (0,1,2) V2: fix map file indent change type of counter variables to unsigned fix CI error Xueming Li (2): malloc: support malloc and free tracking log app/testpmd: support malloc and free tracking log app/test-pmd/cmdline.c | 60 ++++++- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 15 ++ lib/librte_eal/common/eal_memcfg.h | 26 +++ lib/librte_eal/common/malloc_elem.h | 6 +- lib/librte_eal/common/rte_malloc.c | 261 +++++++++++++++++++++++++++- lib/librte_eal/include/rte_malloc.h | 39 ++++- lib/librte_eal/rte_eal_version.map | 3 + 7 files changed, 401 insertions(+), 9 deletions(-) -- 1.8.3.1