From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E5C0EA0577; Mon, 13 Apr 2020 17:07:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57ED61C01B; Mon, 13 Apr 2020 17:03:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id DC2DE1C0BF for ; Mon, 13 Apr 2020 17:02:56 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03DExulr014657; Mon, 13 Apr 2020 08:02:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=vt/1LDEDt3e4s2eE4FFlhsVpUaYidcnLVmgb2WTaAoc=; b=KsikJzs2uXMBthzDfn8iaXi3x3o/Iq0ygwfdw19WwY6Hq4AaKzplcRYsccsu2P4KRZzr 7vcsWbn4MtWtTo/PpeeRhbKrVU19mksZsvkb0BVKQWXutxSNQOpAv2JdipBjcl/r9n9W ALhcNX4qq5ht8N6h1zuD6rfB7SvTAHL10Ue0PTUcRPIAmEibMf+IJALu3GnnWTdRc82t SpGuco1OkWt8DS9q1UyekK0sHev8NPchNgkYNoghTcyS3K7WTnN1/b+FTQ4uUsOxCqGG 0+mowy951eog4PQop0gSM3XuafMvbxWEgy95Md6f2WljzHyzEc8ksXmRRpofJBCUOnxz 1Q== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 30bb8qey0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 13 Apr 2020 08:02:56 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 13 Apr 2020 08:02:54 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 13 Apr 2020 08:02:54 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 13 Apr 2020 08:02:54 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 04FD23F7040; Mon, 13 Apr 2020 08:02:50 -0700 (PDT) From: To: Anatoly Burakov , Jerin Jacob , Sunil Kumar Kori CC: , , , , Date: Mon, 13 Apr 2020 20:31:03 +0530 Message-ID: <20200413150116.734047-21-jerinj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200413150116.734047-1-jerinj@marvell.com> References: <20200403153709.3703448-1-jerinj@marvell.com> <20200413150116.734047-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-13_07:2020-04-13, 2020-04-13 signatures=0 Subject: [dpdk-dev] [PATCH v5 20/33] eal/trace: add memzone tracepoints 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" From: Jerin Jacob Add the following memzone related tracepoints. rte_trace_lib_eal_memzone_reserve rte_trace_lib_eal_memzone_lookup rte_trace_lib_eal_memzone_free Signed-off-by: Jerin Jacob --- lib/librte_eal/common/eal_common_memzone.c | 9 +++++++ .../common/eal_common_trace_points.c | 10 +++++++ lib/librte_eal/include/rte_trace_eal.h | 26 +++++++++++++++++++ lib/librte_eal/rte_eal_version.map | 3 +++ 4 files changed, 48 insertions(+) diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c index 86f61369b..0f6556714 100644 --- a/lib/librte_eal/common/eal_common_memzone.c +++ b/lib/librte_eal/common/eal_common_memzone.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "malloc_heap.h" #include "malloc_elem.h" @@ -201,6 +202,9 @@ rte_memzone_reserve_thread_safe(const char *name, size_t len, int socket_id, mz = memzone_reserve_aligned_thread_unsafe( name, len, socket_id, flags, align, bound); + rte_trace_lib_eal_memzone_reserve(name, len, socket_id, flags, align, + bound, mz); + rte_rwlock_write_unlock(&mcfg->mlock); return mz; @@ -246,6 +250,7 @@ rte_memzone_reserve(const char *name, size_t len, int socket_id, int rte_memzone_free(const struct rte_memzone *mz) { + char name[RTE_MEMZONE_NAMESIZE]; struct rte_mem_config *mcfg; struct rte_fbarray *arr; struct rte_memzone *found_mz; @@ -256,6 +261,7 @@ rte_memzone_free(const struct rte_memzone *mz) if (mz == NULL) return -EINVAL; + rte_strlcpy(name, mz->name, RTE_MEMZONE_NAMESIZE); mcfg = rte_eal_get_configuration()->mem_config; arr = &mcfg->memzones; @@ -280,6 +286,8 @@ rte_memzone_free(const struct rte_memzone *mz) if (addr != NULL) rte_free(addr); + rte_trace_lib_eal_memzone_free(name, addr, ret); + return ret; } @@ -300,6 +308,7 @@ rte_memzone_lookup(const char *name) rte_rwlock_read_unlock(&mcfg->mlock); + rte_trace_lib_eal_memzone_lookup(name, memzone); return memzone; } diff --git a/lib/librte_eal/common/eal_common_trace_points.c b/lib/librte_eal/common/eal_common_trace_points.c index 5a8444f07..a3c9bc01b 100644 --- a/lib/librte_eal/common/eal_common_trace_points.c +++ b/lib/librte_eal/common/eal_common_trace_points.c @@ -31,6 +31,10 @@ RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_mem_malloc); RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_mem_realloc); RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_mem_free); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_memzone_reserve); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_memzone_lookup); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_eal_memzone_free); + RTE_INIT(eal_trace_init) { RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_generic_void, @@ -80,4 +84,10 @@ RTE_INIT(eal_trace_init) RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_mem_free, lib.eal.mem.free); + RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_memzone_reserve, + lib.eal.memzone.reserve); + RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_memzone_lookup, + lib.eal.memzone.lookup); + RTE_TRACE_POINT_REGISTER(rte_trace_lib_eal_memzone_free, + lib.eal.memzone.free); } diff --git a/lib/librte_eal/include/rte_trace_eal.h b/lib/librte_eal/include/rte_trace_eal.h index 597cf9ca3..abbaea5e0 100644 --- a/lib/librte_eal/include/rte_trace_eal.h +++ b/lib/librte_eal/include/rte_trace_eal.h @@ -166,6 +166,32 @@ RTE_TRACE_POINT( rte_trace_ctf_ptr(ptr); ) +/* Memzone */ +RTE_TRACE_POINT( + rte_trace_lib_eal_memzone_reserve, + RTE_TRACE_POINT_ARGS(const char *name, size_t len, int socket_id, + unsigned int flags, unsigned int align, + unsigned int bound, const void *mz), + rte_trace_ctf_string(name); rte_trace_ctf_long(len); + rte_trace_ctf_int(socket_id); rte_trace_ctf_u32(flags); + rte_trace_ctf_u32(align); rte_trace_ctf_u32(bound); + rte_trace_ctf_ptr(mz); +) + +RTE_TRACE_POINT( + rte_trace_lib_eal_memzone_lookup, + RTE_TRACE_POINT_ARGS(const char *name, const void *memzone), + rte_trace_ctf_string(name); rte_trace_ctf_ptr(memzone); +) + +RTE_TRACE_POINT( + rte_trace_lib_eal_memzone_free, + RTE_TRACE_POINT_ARGS(const char *name, void *addr, int rc), + rte_trace_ctf_string(name); rte_trace_ctf_ptr(addr); + rte_trace_ctf_int(rc); +) + + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index d1a7541f5..c3b7172ba 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -382,4 +382,7 @@ EXPERIMENTAL { __rte_trace_lib_eal_mem_malloc; __rte_trace_lib_eal_mem_realloc; __rte_trace_lib_eal_mem_free; + __rte_trace_lib_eal_memzone_reserve; + __rte_trace_lib_eal_memzone_lookup; + __rte_trace_lib_eal_memzone_free; }; -- 2.25.1