Add the following memzone related tracepoints.
- rte_eal_trace_memzone_reserve()
- rte_eal_trace_memzone_lookup()
- rte_eal_trace_memzone_free()
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
#include <rte_errno.h>
#include <rte_string_fns.h>
#include <rte_common.h>
+#include <rte_eal_trace.h>
#include "malloc_heap.h"
#include "malloc_elem.h"
mz = memzone_reserve_aligned_thread_unsafe(
name, len, socket_id, flags, align, bound);
+ rte_eal_trace_memzone_reserve(name, len, socket_id, flags, align,
+ bound, mz);
+
rte_rwlock_write_unlock(&mcfg->mlock);
return mz;
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;
if (mz == NULL)
return -EINVAL;
+ rte_strlcpy(name, mz->name, RTE_MEMZONE_NAMESIZE);
mcfg = rte_eal_get_configuration()->mem_config;
arr = &mcfg->memzones;
if (addr != NULL)
rte_free(addr);
+ rte_eal_trace_memzone_free(name, addr, ret);
return ret;
}
rte_rwlock_read_unlock(&mcfg->mlock);
+ rte_eal_trace_memzone_lookup(name, memzone);
return memzone;
}
RTE_TRACE_POINT_DEFINE(rte_eal_trace_mem_realloc);
RTE_TRACE_POINT_DEFINE(rte_eal_trace_mem_free);
+RTE_TRACE_POINT_DEFINE(rte_eal_trace_memzone_reserve);
+RTE_TRACE_POINT_DEFINE(rte_eal_trace_memzone_lookup);
+RTE_TRACE_POINT_DEFINE(rte_eal_trace_memzone_free);
+
RTE_INIT(eal_trace_init)
{
RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_void,
lib.eal.mem.realloc);
RTE_TRACE_POINT_REGISTER(rte_eal_trace_mem_free,
lib.eal.mem.free);
+
+ RTE_TRACE_POINT_REGISTER(rte_eal_trace_memzone_reserve,
+ lib.eal.memzone.reserve);
+ RTE_TRACE_POINT_REGISTER(rte_eal_trace_memzone_lookup,
+ lib.eal.memzone.lookup);
+ RTE_TRACE_POINT_REGISTER(rte_eal_trace_memzone_free,
+ lib.eal.memzone.free);
}
rte_trace_point_emit_ptr(ptr);
)
+/* Memzone */
+RTE_TRACE_POINT(
+ rte_eal_trace_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_point_emit_string(name);
+ rte_trace_point_emit_long(len);
+ rte_trace_point_emit_int(socket_id);
+ rte_trace_point_emit_u32(flags);
+ rte_trace_point_emit_u32(align);
+ rte_trace_point_emit_u32(bound);
+ rte_trace_point_emit_ptr(mz);
+)
+
+RTE_TRACE_POINT(
+ rte_eal_trace_memzone_lookup,
+ RTE_TRACE_POINT_ARGS(const char *name, const void *memzone),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_ptr(memzone);
+)
+
+RTE_TRACE_POINT(
+ rte_eal_trace_memzone_free,
+ RTE_TRACE_POINT_ARGS(const char *name, void *addr, int rc),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_ptr(addr);
+ rte_trace_point_emit_int(rc);
+)
+
#ifdef __cplusplus
}
#endif
__rte_eal_trace_mem_malloc;
__rte_eal_trace_mem_realloc;
__rte_eal_trace_mem_zmalloc;
+ __rte_eal_trace_memzone_free;
+ __rte_eal_trace_memzone_lookup;
+ __rte_eal_trace_memzone_reserve;
__rte_trace_mem_per_thread_alloc;
__rte_trace_point_emit_field;
__rte_trace_point_register;