[v4,32/33] mempool: add tracepoints
diff mbox series

Message ID 20200403153709.3703448-33-jerinj@marvell.com
State Superseded
Delegated to: David Marchand
Headers show
Series
  • DPDK Trace support
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Jerin Jacob Kollanukkaran April 3, 2020, 3:37 p.m. UTC
From: Sunil Kumar Kori <skori@marvell.com>

Add tracepoints at important and mandatory APIs for tracing support.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 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

Patch
diff mbox series

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 <rte_tailq.h>
 
 #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 <rte_memcpy.h>
 #include <rte_common.h>
 
+#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 <rte_errno.h>
 #include <rte_dev.h>
 
+#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 <rte_trace.h>
+#include <rte_memzone.h>
+
+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.h>
+
+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_ */