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 2A882A0562; Fri, 3 Apr 2020 17:44:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F04F1C2AD; Fri, 3 Apr 2020 17:39:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 42DEA1C2B8 for ; Fri, 3 Apr 2020 17:39:09 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 033FZLeI001823; Fri, 3 Apr 2020 08:39:08 -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=oJUmtYlVlRalqQ3F07+C1Wg7PZf62OUrJqIF5G1+JNE=; b=XLeyoihQJNqmPeQ6vjg5wC/aNKFiFfFtPNeArOOOyXuFe8plAe6SU2Pv4ABlJHgdAER+ cFuWHU+ObsJV7JcHUIwn+G1si01lvhN4Qelf4wthycfu/UxLZ3xSQxfxU7bGJU3tgm/Q cV1AZ8SjJ6MOK+FLmEEHNo83G6XnYRql7gp/OmeHub6QMqF3NFT5N9zTflNtvDbSI+Li wwXFLUIuJe7gyO8FowJQIf/dXmTH4PDf0NLaxWCLQbCzbzN0cmvPs9vV/EXaeIdmsdEN yS83hi1gmhKrn+9utycu4Z8+662aaP675Vqqs/8OU+bB1zBJKx542rs/BF3Vqu2yIzz6 mg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 3046h67gqn-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 03 Apr 2020 08:39:07 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 3 Apr 2020 08:39:05 -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; Fri, 3 Apr 2020 08:39:05 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 9A7F93F7044; Fri, 3 Apr 2020 08:39:00 -0700 (PDT) From: To: Olivier Matz , Andrew Rybchenko CC: , , , , , Date: Fri, 3 Apr 2020 21:07:08 +0530 Message-ID: <20200403153709.3703448-33-jerinj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200403153709.3703448-1-jerinj@marvell.com> References: <20200329144342.1543749-1-jerinj@marvell.com> <20200403153709.3703448-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-03_11:2020-04-03, 2020-04-03 signatures=0 Subject: [dpdk-dev] [PATCH v4 32/33] mempool: add 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: Sunil Kumar Kori Add tracepoints at important and mandatory APIs for tracing support. Signed-off-by: Sunil Kumar Kori --- lib/librte_mempool/Makefile | 3 + lib/librte_mempool/mempool_trace_points.c | 108 +++++++++++++++ lib/librte_mempool/meson.build | 5 +- lib/librte_mempool/rte_mempool.c | 16 +++ lib/librte_mempool/rte_mempool.h | 13 ++ lib/librte_mempool/rte_mempool_ops.c | 7 + lib/librte_mempool/rte_mempool_version.map | 26 ++++ lib/librte_mempool/rte_trace_mempool.h | 148 +++++++++++++++++++++ lib/librte_mempool/rte_trace_mempool_fp.h | 102 ++++++++++++++ 9 files changed, 426 insertions(+), 2 deletions(-) create mode 100644 lib/librte_mempool/mempool_trace_points.c create mode 100644 lib/librte_mempool/rte_trace_mempool.h create mode 100644 lib/librte_mempool/rte_trace_mempool_fp.h diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile index 84aae6604..172e7bf50 100644 --- a/lib/librte_mempool/Makefile +++ b/lib/librte_mempool/Makefile @@ -15,7 +15,10 @@ EXPORT_MAP := rte_mempool_version.map SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool_ops.c SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool_ops_default.c +SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += mempool_trace_points.c # install includes SYMLINK-$(CONFIG_RTE_LIBRTE_MEMPOOL)-include := rte_mempool.h +SYMLINK-$(CONFIG_RTE_LIBRTE_MEMPOOL)-include += rte_trace_mempool.h +SYMLINK-$(CONFIG_RTE_LIBRTE_MEMPOOL)-include += rte_trace_mempool_fp.h include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_mempool/mempool_trace_points.c b/lib/librte_mempool/mempool_trace_points.c new file mode 100644 index 000000000..fbe23b93a --- /dev/null +++ b/lib/librte_mempool/mempool_trace_points.c @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#define RTE_TRACE_POINT_REGISTER_SELECT /* Select trace point register macros */ + +#include "rte_trace_mempool.h" + +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_ops_dequeue_bulk); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_ops_dequeue_contig_blocks); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_ops_enqueue_bulk); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_generic_put); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_put_bulk); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_generic_get); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_get_bulk); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_get_contig_blocks); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_create); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_create_empty); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_free); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_populate_iova); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_populate_virt); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_populate_default); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_populate_anon); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_cache_create); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_cache_free); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_default_cache); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_get_page_size); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_cache_flush); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_ops_populate); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_ops_alloc); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_ops_free); +RTE_TRACE_POINT_DEFINE(rte_trace_lib_mempool_set_ops_byname); + +RTE_INIT(mempool_trace_init) +{ + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_ops_dequeue_bulk, + lib.mempool.ops.deq.bulk, INFO); + + RTE_TRACE_POINT_REGISTER( + rte_trace_lib_mempool_ops_dequeue_contig_blocks, + lib.mempool.ops.deq.contig, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_ops_enqueue_bulk, + lib.mempool.ops.enq.bulk, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_generic_put, + lib.mempool.generic.put, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_put_bulk, + lib.mempool.put.bulk, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_generic_get, + lib.mempool.generic.get, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_get_bulk, + lib.mempool.get.bulk, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_get_contig_blocks, + lib.mempool.get.blocks, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_create, + lib.mempool.create, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_create_empty, + lib.mempool.create.empty, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_free, + lib.mempool.free, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_populate_iova, + lib.mempool.populate.iova, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_populate_virt, + lib.mempool.populate.virt, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_populate_default, + lib.mempool.populate.default, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_populate_anon, + lib.mempool.populate.anon, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_cache_create, + lib.mempool.cache_create, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_cache_free, + lib.mempool.cache.free, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_default_cache, + lib.mempool.default.cache, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_get_page_size, + lib.mempool.get.page.size, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_cache_flush, + lib.mempool.cache.flush, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_ops_populate, + lib.mempool.ops.populate, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_ops_alloc, + lib.mempool.ops.alloc, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_ops_free, + lib.mempool.ops.free, INFO); + + RTE_TRACE_POINT_REGISTER(rte_trace_lib_mempool_set_ops_byname, + lib.mempool.set.ops.byname, INFO); +} diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build index 45e0cb7ea..3e8d64c51 100644 --- a/lib/librte_mempool/meson.build +++ b/lib/librte_mempool/meson.build @@ -10,6 +10,7 @@ foreach flag: extra_flags endforeach sources = files('rte_mempool.c', 'rte_mempool_ops.c', - 'rte_mempool_ops_default.c') -headers = files('rte_mempool.h') + 'rte_mempool_ops_default.c', 'mempool_trace_points.c') +headers = files('rte_mempool.h', 'rte_trace_mempool.h', + 'rte_trace_mempool_fp.h') deps += ['ring'] diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 712c839a0..6cc0c7209 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -33,6 +33,7 @@ #include #include "rte_mempool.h" +#include "rte_trace_mempool.h" TAILQ_HEAD(rte_mempool_list, rte_tailq_entry); @@ -377,6 +378,8 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, if (ret == 0) ret = -EINVAL; + rte_trace_lib_mempool_populate_iova(mp, vaddr, iova, len, free_cb, + opaque); return ret; } @@ -444,6 +447,8 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr, if (cnt == 0) return -EINVAL; + rte_trace_lib_mempool_populate_virt(mp, addr, len, pg_sz, free_cb, + opaque); return cnt; fail: @@ -473,6 +478,7 @@ rte_mempool_get_page_size(struct rte_mempool *mp, size_t *pg_sz) else *pg_sz = getpagesize(); + rte_trace_lib_mempool_get_page_size(mp, *pg_sz); return 0; } @@ -611,6 +617,7 @@ rte_mempool_populate_default(struct rte_mempool *mp) } } + rte_trace_lib_mempool_populate_default(mp); return mp->size; fail: @@ -701,6 +708,7 @@ rte_mempool_populate_anon(struct rte_mempool *mp) goto fail; } + rte_trace_lib_mempool_populate_anon(mp); return mp->populated_size; fail: @@ -732,6 +740,7 @@ rte_mempool_free(struct rte_mempool *mp) } rte_mcfg_tailq_write_unlock(); + rte_trace_lib_mempool_free(mp); rte_mempool_free_memchunks(mp); rte_mempool_ops_free(mp); rte_memzone_free(mp->mz); @@ -770,6 +779,7 @@ rte_mempool_cache_create(uint32_t size, int socket_id) mempool_cache_init(cache, size); + rte_trace_lib_mempool_cache_create(size, socket_id, cache); return cache; } @@ -781,6 +791,7 @@ rte_mempool_cache_create(uint32_t size, int socket_id) void rte_mempool_cache_free(struct rte_mempool_cache *cache) { + rte_trace_lib_mempool_cache_free(cache); rte_free(cache); } @@ -911,6 +922,8 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, rte_mcfg_tailq_write_unlock(); rte_mcfg_mempool_write_unlock(); + rte_trace_lib_mempool_create_empty(name, n, elt_size, cache_size, + private_data_size, flags, mp); return mp; exit_unlock: @@ -963,6 +976,9 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, if (obj_init) rte_mempool_obj_iter(mp, obj_init, obj_init_arg); + rte_trace_lib_mempool_create(name, n, elt_size, cache_size, + private_data_size, mp_init, mp_init_arg, + obj_init, obj_init_arg, flags, mp); return mp; fail: diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index c90cf3146..2d0b5ad46 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -51,6 +51,8 @@ #include #include +#include "rte_trace_mempool_fp.h" + #ifdef __cplusplus extern "C" { #endif @@ -736,6 +738,7 @@ rte_mempool_ops_dequeue_bulk(struct rte_mempool *mp, { struct rte_mempool_ops *ops; + rte_trace_lib_mempool_ops_dequeue_bulk(mp, obj_table, n); ops = rte_mempool_get_ops(mp->ops_index); return ops->dequeue(mp, obj_table, n); } @@ -761,6 +764,7 @@ rte_mempool_ops_dequeue_contig_blocks(struct rte_mempool *mp, ops = rte_mempool_get_ops(mp->ops_index); RTE_ASSERT(ops->dequeue_contig_blocks != NULL); + rte_trace_lib_mempool_ops_dequeue_contig_blocks(mp, first_obj_table, n); return ops->dequeue_contig_blocks(mp, first_obj_table, n); } @@ -783,6 +787,7 @@ rte_mempool_ops_enqueue_bulk(struct rte_mempool *mp, void * const *obj_table, { struct rte_mempool_ops *ops; + rte_trace_lib_mempool_ops_enqueue_bulk(mp, obj_table, n); ops = rte_mempool_get_ops(mp->ops_index); return ops->enqueue(mp, obj_table, n); } @@ -1264,6 +1269,8 @@ rte_mempool_default_cache(struct rte_mempool *mp, unsigned lcore_id) if (lcore_id >= RTE_MAX_LCORE) return NULL; + rte_trace_lib_mempool_default_cache(mp, lcore_id, + &mp->local_cache[lcore_id]); return &mp->local_cache[lcore_id]; } @@ -1283,6 +1290,7 @@ rte_mempool_cache_flush(struct rte_mempool_cache *cache, cache = rte_mempool_default_cache(mp, rte_lcore_id()); if (cache == NULL || cache->len == 0) return; + rte_trace_lib_mempool_cache_flush(cache, mp); rte_mempool_ops_enqueue_bulk(mp, cache->objs, cache->len); cache->len = 0; } @@ -1362,6 +1370,7 @@ static __rte_always_inline void rte_mempool_generic_put(struct rte_mempool *mp, void * const *obj_table, unsigned int n, struct rte_mempool_cache *cache) { + rte_trace_lib_mempool_generic_put(mp, obj_table, n, cache); __mempool_check_cookies(mp, obj_table, n, 0); __mempool_generic_put(mp, obj_table, n, cache); } @@ -1386,6 +1395,7 @@ rte_mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table, { struct rte_mempool_cache *cache; cache = rte_mempool_default_cache(mp, rte_lcore_id()); + rte_trace_lib_mempool_put_bulk(mp, obj_table, n, cache); rte_mempool_generic_put(mp, obj_table, n, cache); } @@ -1507,6 +1517,7 @@ rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table, ret = __mempool_generic_get(mp, obj_table, n, cache); if (ret == 0) __mempool_check_cookies(mp, obj_table, n, 1); + rte_trace_lib_mempool_generic_get(mp, obj_table, n, cache); return ret; } @@ -1537,6 +1548,7 @@ rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n) { struct rte_mempool_cache *cache; cache = rte_mempool_default_cache(mp, rte_lcore_id()); + rte_trace_lib_mempool_get_bulk(mp, obj_table, n, cache); return rte_mempool_generic_get(mp, obj_table, n, cache); } @@ -1606,6 +1618,7 @@ rte_mempool_get_contig_blocks(struct rte_mempool *mp, __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_fail, n); } + rte_trace_lib_mempool_get_contig_blocks(mp, first_obj_table, n); return ret; } diff --git a/lib/librte_mempool/rte_mempool_ops.c b/lib/librte_mempool/rte_mempool_ops.c index 22c5251eb..c1b24a1f3 100644 --- a/lib/librte_mempool/rte_mempool_ops.c +++ b/lib/librte_mempool/rte_mempool_ops.c @@ -11,6 +11,8 @@ #include #include +#include "rte_trace_mempool.h" + /* indirect jump table to support external memory pools. */ struct rte_mempool_ops_table rte_mempool_ops_table = { .sl = RTE_SPINLOCK_INITIALIZER, @@ -74,6 +76,7 @@ rte_mempool_ops_alloc(struct rte_mempool *mp) { struct rte_mempool_ops *ops; + rte_trace_lib_mempool_ops_alloc(mp); ops = rte_mempool_get_ops(mp->ops_index); return ops->alloc(mp); } @@ -84,6 +87,7 @@ rte_mempool_ops_free(struct rte_mempool *mp) { struct rte_mempool_ops *ops; + rte_trace_lib_mempool_ops_free(mp); ops = rte_mempool_get_ops(mp->ops_index); if (ops->free == NULL) return; @@ -130,6 +134,8 @@ rte_mempool_ops_populate(struct rte_mempool *mp, unsigned int max_objs, ops = rte_mempool_get_ops(mp->ops_index); + rte_trace_lib_mempool_ops_populate(mp, max_objs, vaddr, iova, len, + obj_cb, obj_cb_arg); if (ops->populate == NULL) return rte_mempool_op_populate_default(mp, max_objs, vaddr, iova, len, obj_cb, @@ -178,5 +184,6 @@ rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name, mp->ops_index = i; mp->pool_config = pool_config; + rte_trace_lib_mempool_set_ops_byname(mp, name, pool_config); return 0; } diff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map index d002dfc46..2d2594635 100644 --- a/lib/librte_mempool/rte_mempool_version.map +++ b/lib/librte_mempool/rte_mempool_version.map @@ -45,4 +45,30 @@ EXPERIMENTAL { rte_mempool_get_page_size; rte_mempool_op_calc_mem_size_helper; rte_mempool_op_populate_helper; + + # added in 20.05 + __rte_trace_lib_mempool_ops_dequeue_bulk; + __rte_trace_lib_mempool_ops_dequeue_contig_blocks; + __rte_trace_lib_mempool_ops_enqueue_bulk; + __rte_trace_lib_mempool_generic_put; + __rte_trace_lib_mempool_put_bulk; + __rte_trace_lib_mempool_generic_get; + __rte_trace_lib_mempool_get_bulk; + __rte_trace_lib_mempool_get_contig_blocks; + __rte_trace_lib_mempool_create; + __rte_trace_lib_mempool_create_empty; + __rte_trace_lib_mempool_free; + __rte_trace_lib_mempool_populate_iova; + __rte_trace_lib_mempool_populate_virt; + __rte_trace_lib_mempool_populate_default; + __rte_trace_lib_mempool_populate_anon; + __rte_trace_lib_mempool_cache_create; + __rte_trace_lib_mempool_cache_free; + __rte_trace_lib_mempool_default_cache; + __rte_trace_lib_mempool_get_page_size; + __rte_trace_lib_mempool_cache_flush; + __rte_trace_lib_mempool_ops_populate; + __rte_trace_lib_mempool_ops_alloc; + __rte_trace_lib_mempool_ops_free; + __rte_trace_lib_mempool_set_ops_byname; }; diff --git a/lib/librte_mempool/rte_trace_mempool.h b/lib/librte_mempool/rte_trace_mempool.h new file mode 100644 index 000000000..12af2e301 --- /dev/null +++ b/lib/librte_mempool/rte_trace_mempool.h @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#ifndef _RTE_TRACE_MEMPOOL_H_ +#define _RTE_TRACE_MEMPOOL_H_ + +/** + * @file + * + * APIs for mempool trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "rte_mempool.h" + +#include +#include + +RTE_TRACE_POINT( + rte_trace_lib_mempool_create, + RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts, + uint32_t elt_size, uint32_t cache_size, + uint32_t private_data_size, void *mp_init, + void *mp_init_arg, void *obj_init, + void *obj_init_arg, uint32_t flags, + struct rte_mempool *mempool), + rte_trace_ctf_string(name); rte_trace_ctf_u32(nb_elts); + rte_trace_ctf_u32(elt_size); rte_trace_ctf_u32(cache_size); + rte_trace_ctf_u32(private_data_size); rte_trace_ctf_ptr(mp_init); + rte_trace_ctf_ptr(mp_init_arg); rte_trace_ctf_ptr(obj_init); + rte_trace_ctf_ptr(obj_init_arg); rte_trace_ctf_u32(flags); + rte_trace_ctf_ptr(mempool); rte_trace_ctf_i32(mempool->ops_index); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_create_empty, + RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts, + uint32_t elt_size, uint32_t cache_size, + uint32_t private_data_size, uint32_t flags, + struct rte_mempool *mempool), + rte_trace_ctf_string(name); rte_trace_ctf_u32(nb_elts); + rte_trace_ctf_u32(elt_size); rte_trace_ctf_u32(cache_size); + rte_trace_ctf_u32(private_data_size); rte_trace_ctf_u32(flags); + rte_trace_ctf_ptr(mempool); rte_trace_ctf_i32(mempool->ops_index); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_free, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_populate_iova, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool, void *vaddr, + rte_iova_t iova, size_t len, void *free_cb, + void *opaque), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); + rte_trace_ctf_ptr(vaddr); rte_trace_ctf_u64(iova); + rte_trace_ctf_long(len); rte_trace_ctf_ptr(free_cb); + rte_trace_ctf_ptr(opaque); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_populate_virt, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool, void *addr, + size_t len, size_t pg_sz, void *free_cb, + void *opaque), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); + rte_trace_ctf_ptr(addr); rte_trace_ctf_long(len); + rte_trace_ctf_long(pg_sz); rte_trace_ctf_ptr(free_cb); + rte_trace_ctf_ptr(opaque); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_populate_default, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_populate_anon, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_cache_create, + RTE_TRACE_POINT_ARGS(uint32_t size, int socket_id, + struct rte_mempool_cache *cache), + rte_trace_ctf_u32(size); rte_trace_ctf_i32(socket_id); + rte_trace_ctf_ptr(cache); rte_trace_ctf_u32(cache->len); + rte_trace_ctf_u32(cache->flushthresh); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_cache_free, + RTE_TRACE_POINT_ARGS(void *cache), + rte_trace_ctf_ptr(cache); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_get_page_size, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool, size_t pg_sz), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); + rte_trace_ctf_long(pg_sz); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_ops_populate, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool, uint32_t max_objs, + void *vaddr, uint64_t iova, size_t len, + void *obj_cb, void *obj_cb_arg), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); + rte_trace_ctf_u32(max_objs); rte_trace_ctf_ptr(vaddr); + rte_trace_ctf_u64(iova); rte_trace_ctf_long(len); + rte_trace_ctf_ptr(obj_cb); rte_trace_ctf_ptr(obj_cb_arg); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_ops_alloc, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_ops_free, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); +) + +RTE_TRACE_POINT( + rte_trace_lib_mempool_set_ops_byname, + RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool, const char *name, + void *pool_config), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_string(mempool->name); + rte_trace_ctf_string(name); rte_trace_ctf_ptr(pool_config); +) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_TRACE_MEMPOOL_H_ */ diff --git a/lib/librte_mempool/rte_trace_mempool_fp.h b/lib/librte_mempool/rte_trace_mempool_fp.h new file mode 100644 index 000000000..7aad5e3c2 --- /dev/null +++ b/lib/librte_mempool/rte_trace_mempool_fp.h @@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#ifndef _RTE_TRACE_MEMPOOL_FP_H_ +#define _RTE_TRACE_MEMPOOL_FP_H_ + +/** + * @file + * + * Mempool fast path API for trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_ops_dequeue_bulk, + RTE_TRACE_POINT_ARGS(void *mempool, void **obj_table, + uint32_t nb_objs), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(obj_table); + rte_trace_ctf_u32(nb_objs); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_ops_dequeue_contig_blocks, + RTE_TRACE_POINT_ARGS(void *mempool, void **first_obj_table, + uint32_t nb_objs), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(first_obj_table); + rte_trace_ctf_u32(nb_objs); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_ops_enqueue_bulk, + RTE_TRACE_POINT_ARGS(void *mempool, void * const *obj_table, + uint32_t nb_objs), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(obj_table); + rte_trace_ctf_u32(nb_objs); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_generic_put, + RTE_TRACE_POINT_ARGS(void *mempool, void * const *obj_table, + uint32_t nb_objs, void *cache), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(obj_table); + rte_trace_ctf_u32(nb_objs); rte_trace_ctf_ptr(cache); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_put_bulk, + RTE_TRACE_POINT_ARGS(void *mempool, void * const *obj_table, + uint32_t nb_objs, void *cache), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(obj_table); + rte_trace_ctf_u32(nb_objs); rte_trace_ctf_ptr(cache); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_generic_get, + RTE_TRACE_POINT_ARGS(void *mempool, void * const *obj_table, + uint32_t nb_objs, void *cache), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(obj_table); + rte_trace_ctf_u32(nb_objs); rte_trace_ctf_ptr(cache); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_get_bulk, + RTE_TRACE_POINT_ARGS(void *mempool, void **obj_table, + uint32_t nb_objs, void *cache), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(obj_table); + rte_trace_ctf_u32(nb_objs); rte_trace_ctf_ptr(cache); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_get_contig_blocks, + RTE_TRACE_POINT_ARGS(void *mempool, void **first_obj_table, + uint32_t nb_objs), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_ptr(first_obj_table); + rte_trace_ctf_u32(nb_objs); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_default_cache, + RTE_TRACE_POINT_ARGS(void *mempool, uint32_t lcore_id, + void *default_cache), + rte_trace_ctf_ptr(mempool); rte_trace_ctf_u32(lcore_id); + rte_trace_ctf_ptr(default_cache); +) + +RTE_TRACE_POINT_DP( + rte_trace_lib_mempool_cache_flush, + RTE_TRACE_POINT_ARGS(void *cache, void *mempool), + rte_trace_ctf_ptr(cache); rte_trace_ctf_ptr(mempool); +) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_TRACE_MEMPOOL_FP_H_ */ -- 2.25.1