Add tracepoints at important and mandatory APIs for tracing support.
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
LDLIBS += -lrte_kvargs
# library source files
-SRCS-y += rte_cryptodev.c rte_cryptodev_pmd.c
+SRCS-y += rte_cryptodev.c rte_cryptodev_pmd.c cryptodev_trace_points.c
# export include files
SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_asym.h
SYMLINK-y-include += rte_crypto_sym.h
SYMLINK-y-include += rte_cryptodev.h
SYMLINK-y-include += rte_cryptodev_pmd.h
-SYMLINK-y-include += rte_crypto_asym.h
+SYMLINK-y-include += rte_cryptodev_trace.h
+SYMLINK-y-include += rte_cryptodev_trace_fp.h
# versioning export map
EXPORT_MAP := rte_cryptodev_version.map
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell International Ltd.
+ */
+
+#define RTE_TRACE_POINT_REGISTER_SELECT
+
+#include "rte_cryptodev_trace.h"
+
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_configure);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_start);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_stop);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_close);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_queue_pair_setup);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_sym_session_pool_create);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_sym_session_create);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_asym_session_create);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_sym_session_free);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_asym_session_free);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_sym_session_init);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_asym_session_init);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_sym_session_clear);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_asym_session_clear);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_enqueue_burst);
+RTE_TRACE_POINT_DEFINE(rte_cryptodev_trace_dequeue_burst);
+
+RTE_INIT(cryptodev_trace_init)
+{
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_configure,
+ lib.cryptodev.configure);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_start,
+ lib.cryptodev.start);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stop,
+ lib.cryptodev.stop);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_close,
+ lib.cryptodev.close);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_setup,
+ lib.cryptodev.queue.pair.setup);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_pool_create,
+ lib.cryptodev.sym.pool.create);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_create,
+ lib.cryptodev.sym.create);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_create,
+ lib.cryptodev.asym.create);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_free,
+ lib.cryptodev.sym.free);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_free,
+ lib.cryptodev.asym.free);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_init,
+ lib.cryptodev.sym.init);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_init,
+ lib.cryptodev.asym.init);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
+ lib.cryptodev.enq.burst);
+
+ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_dequeue_burst,
+ lib.cryptodev.deq.burst);
+}
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017-2019 Intel Corporation
-sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
+sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c', 'cryptodev_trace_points.c')
headers = files('rte_cryptodev.h',
'rte_cryptodev_pmd.h',
+ 'rte_cryptodev_trace.h',
+ 'rte_cryptodev_trace_fp.h',
'rte_crypto.h',
'rte_crypto_sym.h',
'rte_crypto_asym.h')
#include "rte_crypto.h"
#include "rte_cryptodev.h"
#include "rte_cryptodev_pmd.h"
+#include "rte_cryptodev_trace.h"
static uint8_t nb_drivers;
return diag;
}
+ rte_cryptodev_trace_configure(dev_id, config);
return (*dev->dev_ops->dev_configure)(dev, config);
}
}
diag = (*dev->dev_ops->dev_start)(dev);
+ rte_cryptodev_trace_start(dev_id, diag);
if (diag == 0)
dev->data->dev_started = 1;
else
}
(*dev->dev_ops->dev_stop)(dev);
+ rte_cryptodev_trace_stop(dev_id);
dev->data->dev_started = 0;
}
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_close, -ENOTSUP);
retval = (*dev->dev_ops->dev_close)(dev);
+ rte_cryptodev_trace_close(dev_id, retval);
if (retval < 0)
return retval;
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_pair_setup, -ENOTSUP);
+ rte_cryptodev_trace_queue_pair_setup(dev_id, queue_pair_id, qp_conf);
return (*dev->dev_ops->queue_pair_setup)(dev, queue_pair_id, qp_conf,
socket_id);
}
}
}
+ rte_cryptodev_trace_sym_session_init(dev_id, sess, xforms, mp);
sess->sess_data[index].refcnt++;
return 0;
}
}
}
+ rte_cryptodev_trace_asym_session_init(dev_id, sess, xforms, mp);
return 0;
}
pool_priv->nb_drivers = nb_drivers;
pool_priv->user_data_sz = user_data_size;
+ rte_cryptodev_trace_sym_session_pool_create(name, nb_elts,
+ elt_size, cache_size, user_data_size, mp);
return mp;
}
memset(sess->sess_data, 0,
rte_cryptodev_sym_session_data_size(sess));
+ rte_cryptodev_trace_sym_session_create(mp, sess);
return sess;
}
*/
memset(sess, 0, (sizeof(void *) * nb_drivers) + sizeof(uint8_t));
+ rte_cryptodev_trace_asym_session_create(mp, sess);
return sess;
}
dev->dev_ops->sym_session_clear(dev, sess);
+ rte_cryptodev_trace_sym_session_clear(dev_id, sess);
return 0;
}
dev->dev_ops->asym_session_clear(dev, sess);
+ rte_cryptodev_trace_sym_session_clear(dev_id, sess);
return 0;
}
sess_mp = rte_mempool_from_obj(sess);
rte_mempool_put(sess_mp, sess);
+ rte_cryptodev_trace_sym_session_free(sess);
return 0;
}
sess_mp = rte_mempool_from_obj(sess);
rte_mempool_put(sess_mp, sess);
+ rte_cryptodev_trace_asym_session_free(sess);
return 0;
}
#include <rte_common.h>
#include <rte_config.h>
+#include "rte_cryptodev_trace_fp.h"
+
extern const char **rte_cyptodev_names;
/* Logging Macros */
nb_ops = (*dev->dequeue_burst)
(dev->data->queue_pairs[qp_id], ops, nb_ops);
+ rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops);
return nb_ops;
}
{
struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
+ rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops);
return (*dev->enqueue_burst)(
dev->data->queue_pairs[qp_id], ops, nb_ops);
}
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _RTE_CRYPTODEV_TRACE_H_
+#define _RTE_CRYPTODEV_TRACE_H_
+
+/**
+ * @file
+ *
+ * API for cryptodev trace support
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+#include "rte_cryptodev.h"
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_configure,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ struct rte_cryptodev_config *conf),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(conf->nb_queue_pairs);
+ rte_trace_point_emit_i64(conf->ff_disable);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_start,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, int rc),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_stop,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_close,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, int rc),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_int(rc);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_queue_pair_setup,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id,
+ const struct rte_cryptodev_qp_conf *conf),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(queue_pair_id);
+ rte_trace_point_emit_u32(conf->nb_descriptors);
+ rte_trace_point_emit_ptr(conf->mp_session);
+ rte_trace_point_emit_ptr(conf->mp_session_private);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_pool_create,
+ RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
+ uint32_t elt_size, uint32_t cache_size,
+ uint16_t user_data_size, void *mempool),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_u32(nb_elts);
+ rte_trace_point_emit_u32(elt_size);
+ rte_trace_point_emit_u32(cache_size);
+ rte_trace_point_emit_u16(user_data_size);
+ rte_trace_point_emit_ptr(mempool);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_create,
+ RTE_TRACE_POINT_ARGS(void *mempool,
+ struct rte_cryptodev_sym_session *sess),
+ rte_trace_point_emit_ptr(mempool);
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_u64(sess->opaque_data);
+ rte_trace_point_emit_u16(sess->nb_drivers);
+ rte_trace_point_emit_u16(sess->user_data_sz);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_create,
+ RTE_TRACE_POINT_ARGS(void *mempool,
+ struct rte_cryptodev_asym_session *sess),
+ rte_trace_point_emit_ptr(mempool);
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_free,
+ RTE_TRACE_POINT_ARGS(struct rte_cryptodev_sym_session *sess),
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_free,
+ RTE_TRACE_POINT_ARGS(struct rte_cryptodev_asym_session *sess),
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_init,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ struct rte_cryptodev_sym_session *sess, void *xforms,
+ void *mempool),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_u64(sess->opaque_data);
+ rte_trace_point_emit_u16(sess->nb_drivers);
+ rte_trace_point_emit_u16(sess->user_data_sz);
+ rte_trace_point_emit_ptr(xforms);
+ rte_trace_point_emit_ptr(mempool);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_init,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ struct rte_cryptodev_asym_session *sess, void *xforms,
+ void *mempool),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(xforms);
+ rte_trace_point_emit_ptr(mempool);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_clear,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_clear,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *sess),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_CRYPTODEV_TRACE_H_ */
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _RTE_CRYPTODEV_TRACE_FP_H_
+#define _RTE_CRYPTODEV_TRACE_FP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+RTE_TRACE_POINT_FP(
+ rte_cryptodev_trace_enqueue_burst,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, void **ops,
+ uint16_t nb_ops),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(ops);
+ rte_trace_point_emit_u16(nb_ops);
+)
+
+RTE_TRACE_POINT_FP(
+ rte_cryptodev_trace_dequeue_burst,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, void **ops,
+ uint16_t nb_ops),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(ops);
+ rte_trace_point_emit_u16(nb_ops);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_CRYPTODEV_TRACE_FP_H_ */
rte_cryptodev_sym_session_set_user_data;
rte_crypto_asym_op_strings;
rte_crypto_asym_xform_strings;
+
+ # added in 20.05
+ __rte_cryptodev_trace_configure;
+ __rte_cryptodev_trace_start;
+ __rte_cryptodev_trace_stop;
+ __rte_cryptodev_trace_close;
+ __rte_cryptodev_trace_queue_pair_setup;
+ __rte_cryptodev_trace_sym_session_pool_create;
+ __rte_cryptodev_trace_sym_session_create;
+ __rte_cryptodev_trace_asym_session_create;
+ __rte_cryptodev_trace_sym_session_free;
+ __rte_cryptodev_trace_asym_session_free;
+ __rte_cryptodev_trace_sym_session_init;
+ __rte_cryptodev_trace_asym_session_init;
+ __rte_cryptodev_trace_sym_session_clear;
+ __rte_cryptodev_trace_asym_session_clear;
+ __rte_cryptodev_trace_dequeue_burst;
+ __rte_cryptodev_trace_enqueue_burst;
};