From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE55842BA9; Fri, 26 May 2023 10:49:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3685540DDA; Fri, 26 May 2023 10:49:50 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D66F540A89 for ; Fri, 26 May 2023 10:49:47 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QSJWn5PLXzTkqW; Fri, 26 May 2023 16:49:41 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 26 May 2023 16:49:44 +0800 From: Chengwen Feng To: , , Kevin Laatz , Bruce Richardson CC: Subject: [PATCH v4] dmadev: add tracepoints Date: Fri, 26 May 2023 08:42:13 +0000 Message-ID: <20230526084213.30586-1-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230412024808.41339-1-fengchengwen@huawei.com> References: <20230412024808.41339-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add tracepoints at important APIs for tracing support. Signed-off-by: Chengwen Feng Acked-by: Morten Brørup --- v4: Fix asan smoke fail. v3: Address Morten's comment: Move stats_get and vchan_status and to trace_fp.h. v2: Address Morten's comment: Make stats_get as fast-path trace-points. Place fast-path trace-point functions behind in version.map. --- lib/dmadev/meson.build | 2 +- lib/dmadev/rte_dmadev.c | 39 +++++-- lib/dmadev/rte_dmadev.h | 56 +++++++--- lib/dmadev/rte_dmadev_trace.h | 118 +++++++++++++++++++++ lib/dmadev/rte_dmadev_trace_fp.h | 150 +++++++++++++++++++++++++++ lib/dmadev/rte_dmadev_trace_points.c | 59 +++++++++++ lib/dmadev/version.map | 10 ++ 7 files changed, 413 insertions(+), 21 deletions(-) create mode 100644 lib/dmadev/rte_dmadev_trace.h create mode 100644 lib/dmadev/rte_dmadev_trace_fp.h create mode 100644 lib/dmadev/rte_dmadev_trace_points.c diff --git a/lib/dmadev/meson.build b/lib/dmadev/meson.build index 2f17587b75..e0d90aea67 100644 --- a/lib/dmadev/meson.build +++ b/lib/dmadev/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2021 HiSilicon Limited. -sources = files('rte_dmadev.c') +sources = files('rte_dmadev.c', 'rte_dmadev_trace_points.c') headers = files('rte_dmadev.h') indirect_headers += files('rte_dmadev_core.h') driver_sdk_headers += files('rte_dmadev_pmd.h') diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 8c095e1f35..25fa78de8f 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -17,6 +17,7 @@ #include "rte_dmadev.h" #include "rte_dmadev_pmd.h" +#include "rte_dmadev_trace.h" static int16_t dma_devices_max; @@ -434,6 +435,8 @@ rte_dma_info_get(int16_t dev_id, struct rte_dma_info *dev_info) dev_info->numa_node = dev->device->numa_node; dev_info->nb_vchans = dev->data->dev_conf.nb_vchans; + rte_dma_trace_info_get(dev_id, dev_info); + return 0; } @@ -483,6 +486,8 @@ rte_dma_configure(int16_t dev_id, const struct rte_dma_conf *dev_conf) memcpy(&dev->data->dev_conf, dev_conf, sizeof(struct rte_dma_conf)); + rte_dma_trace_configure(dev_id, dev_conf, ret); + return ret; } @@ -509,6 +514,7 @@ rte_dma_start(int16_t dev_id) goto mark_started; ret = (*dev->dev_ops->dev_start)(dev); + rte_dma_trace_start(dev_id, ret); if (ret != 0) return ret; @@ -535,6 +541,7 @@ rte_dma_stop(int16_t dev_id) goto mark_stopped; ret = (*dev->dev_ops->dev_stop)(dev); + rte_dma_trace_stop(dev_id, ret); if (ret != 0) return ret; @@ -565,6 +572,8 @@ rte_dma_close(int16_t dev_id) if (ret == 0) dma_release(dev); + rte_dma_trace_close(dev_id, ret); + return ret; } @@ -655,14 +664,18 @@ rte_dma_vchan_setup(int16_t dev_id, uint16_t vchan, if (*dev->dev_ops->vchan_setup == NULL) return -ENOTSUP; - return (*dev->dev_ops->vchan_setup)(dev, vchan, conf, + ret = (*dev->dev_ops->vchan_setup)(dev, vchan, conf, sizeof(struct rte_dma_vchan_conf)); + rte_dma_trace_vchan_setup(dev_id, vchan, conf, ret); + + return ret; } int rte_dma_stats_get(int16_t dev_id, uint16_t vchan, struct rte_dma_stats *stats) { const struct rte_dma_dev *dev = &rte_dma_devices[dev_id]; + int ret; if (!rte_dma_is_valid(dev_id) || stats == NULL) return -EINVAL; @@ -677,14 +690,18 @@ rte_dma_stats_get(int16_t dev_id, uint16_t vchan, struct rte_dma_stats *stats) if (*dev->dev_ops->stats_get == NULL) return -ENOTSUP; memset(stats, 0, sizeof(struct rte_dma_stats)); - return (*dev->dev_ops->stats_get)(dev, vchan, stats, - sizeof(struct rte_dma_stats)); + ret = (*dev->dev_ops->stats_get)(dev, vchan, stats, + sizeof(struct rte_dma_stats)); + rte_dma_trace_stats_get(dev_id, vchan, stats, ret); + + return ret; } int rte_dma_stats_reset(int16_t dev_id, uint16_t vchan) { struct rte_dma_dev *dev = &rte_dma_devices[dev_id]; + int ret; if (!rte_dma_is_valid(dev_id)) return -EINVAL; @@ -698,13 +715,17 @@ rte_dma_stats_reset(int16_t dev_id, uint16_t vchan) if (*dev->dev_ops->stats_reset == NULL) return -ENOTSUP; - return (*dev->dev_ops->stats_reset)(dev, vchan); + ret = (*dev->dev_ops->stats_reset)(dev, vchan); + rte_dma_trace_stats_reset(dev_id, vchan, ret); + + return ret; } int rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status *status) { struct rte_dma_dev *dev = &rte_dma_devices[dev_id]; + int ret; if (!rte_dma_is_valid(dev_id)) return -EINVAL; @@ -716,7 +737,10 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status * if (*dev->dev_ops->vchan_status == NULL) return -ENOTSUP; - return (*dev->dev_ops->vchan_status)(dev, vchan, status); + ret = (*dev->dev_ops->vchan_status)(dev, vchan, status); + rte_dma_trace_vchan_status(dev_id, vchan, status, ret); + + return ret; } static const char * @@ -792,9 +816,10 @@ rte_dma_dump(int16_t dev_id, FILE *f) dev->data->dev_conf.enable_silent ? "on" : "off"); if (dev->dev_ops->dev_dump != NULL) - return (*dev->dev_ops->dev_dump)(dev, f); + ret = (*dev->dev_ops->dev_dump)(dev, f); + rte_dma_trace_dump(dev_id, f, ret); - return 0; + return ret; } static int diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h index e61d71959e..e792b90ef8 100644 --- a/lib/dmadev/rte_dmadev.h +++ b/lib/dmadev/rte_dmadev.h @@ -796,6 +796,7 @@ struct rte_dma_sge { }; #include "rte_dmadev_core.h" +#include "rte_dmadev_trace_fp.h" /**@{@name DMA operation flag * @see rte_dma_copy() @@ -856,6 +857,7 @@ rte_dma_copy(int16_t dev_id, uint16_t vchan, rte_iova_t src, rte_iova_t dst, uint32_t length, uint64_t flags) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + int ret; #ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid(dev_id) || length == 0) @@ -864,7 +866,10 @@ rte_dma_copy(int16_t dev_id, uint16_t vchan, rte_iova_t src, rte_iova_t dst, return -ENOTSUP; #endif - return (*obj->copy)(obj->dev_private, vchan, src, dst, length, flags); + ret = (*obj->copy)(obj->dev_private, vchan, src, dst, length, flags); + rte_dma_trace_copy(dev_id, vchan, src, dst, length, flags, ret); + + return ret; } /** @@ -907,6 +912,7 @@ rte_dma_copy_sg(int16_t dev_id, uint16_t vchan, struct rte_dma_sge *src, uint64_t flags) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + int ret; #ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid(dev_id) || src == NULL || dst == NULL || @@ -916,8 +922,12 @@ rte_dma_copy_sg(int16_t dev_id, uint16_t vchan, struct rte_dma_sge *src, return -ENOTSUP; #endif - return (*obj->copy_sg)(obj->dev_private, vchan, src, dst, nb_src, - nb_dst, flags); + ret = (*obj->copy_sg)(obj->dev_private, vchan, src, dst, nb_src, + nb_dst, flags); + rte_dma_trace_copy_sg(dev_id, vchan, src, dst, nb_src, nb_dst, flags, + ret); + + return ret; } /** @@ -955,6 +965,7 @@ rte_dma_fill(int16_t dev_id, uint16_t vchan, uint64_t pattern, rte_iova_t dst, uint32_t length, uint64_t flags) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + int ret; #ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid(dev_id) || length == 0) @@ -963,8 +974,11 @@ rte_dma_fill(int16_t dev_id, uint16_t vchan, uint64_t pattern, return -ENOTSUP; #endif - return (*obj->fill)(obj->dev_private, vchan, pattern, dst, length, - flags); + ret = (*obj->fill)(obj->dev_private, vchan, pattern, dst, length, + flags); + rte_dma_trace_fill(dev_id, vchan, pattern, dst, length, flags, ret); + + return ret; } /** @@ -989,6 +1003,7 @@ static inline int rte_dma_submit(int16_t dev_id, uint16_t vchan) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + int ret; #ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid(dev_id)) @@ -997,7 +1012,10 @@ rte_dma_submit(int16_t dev_id, uint16_t vchan) return -ENOTSUP; #endif - return (*obj->submit)(obj->dev_private, vchan); + ret = (*obj->submit)(obj->dev_private, vchan); + rte_dma_trace_submit(dev_id, vchan, ret); + + return ret; } /** @@ -1031,7 +1049,7 @@ rte_dma_completed(int16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, uint16_t *last_idx, bool *has_error) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; - uint16_t idx; + uint16_t idx, ret; bool err; #ifdef RTE_DMADEV_DEBUG @@ -1055,8 +1073,12 @@ rte_dma_completed(int16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, has_error = &err; *has_error = false; - return (*obj->completed)(obj->dev_private, vchan, nb_cpls, last_idx, - has_error); + ret = (*obj->completed)(obj->dev_private, vchan, nb_cpls, last_idx, + has_error); + rte_dma_trace_completed(dev_id, vchan, nb_cpls, last_idx, has_error, + ret); + + return ret; } /** @@ -1095,7 +1117,7 @@ rte_dma_completed_status(int16_t dev_id, uint16_t vchan, enum rte_dma_status_code *status) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; - uint16_t idx; + uint16_t idx, ret; #ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid(dev_id) || nb_cpls == 0 || status == NULL) @@ -1107,8 +1129,12 @@ rte_dma_completed_status(int16_t dev_id, uint16_t vchan, if (last_idx == NULL) last_idx = &idx; - return (*obj->completed_status)(obj->dev_private, vchan, nb_cpls, - last_idx, status); + ret = (*obj->completed_status)(obj->dev_private, vchan, nb_cpls, + last_idx, status); + rte_dma_trace_completed_status(dev_id, vchan, nb_cpls, last_idx, status, + ret); + + return ret; } /** @@ -1131,6 +1157,7 @@ static inline uint16_t rte_dma_burst_capacity(int16_t dev_id, uint16_t vchan) { struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + uint16_t ret; #ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid(dev_id)) @@ -1138,7 +1165,10 @@ rte_dma_burst_capacity(int16_t dev_id, uint16_t vchan) if (*obj->burst_capacity == NULL) return 0; #endif - return (*obj->burst_capacity)(obj->dev_private, vchan); + ret = (*obj->burst_capacity)(obj->dev_private, vchan); + rte_dma_trace_burst_capacity(dev_id, vchan, ret); + + return ret; } #ifdef __cplusplus diff --git a/lib/dmadev/rte_dmadev_trace.h b/lib/dmadev/rte_dmadev_trace.h new file mode 100644 index 0000000000..cbcddb3a70 --- /dev/null +++ b/lib/dmadev/rte_dmadev_trace.h @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 HiSilicon Limited + */ + +#ifndef RTE_DMADEV_TRACE_H +#define RTE_DMADEV_TRACE_H + +/** + * @file + * + * API for dmadev trace support. + */ + +#include + +#include "rte_dmadev.h" + +#ifdef __cplusplus +extern "C" { +#endif + +RTE_TRACE_POINT( + rte_dma_trace_info_get, + RTE_TRACE_POINT_ARGS(int16_t dev_id, struct rte_dma_info *dev_info), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_string(dev_info->dev_name); + rte_trace_point_emit_u64(dev_info->dev_capa); + rte_trace_point_emit_u16(dev_info->max_vchans); + rte_trace_point_emit_u16(dev_info->max_desc); + rte_trace_point_emit_u16(dev_info->min_desc); + rte_trace_point_emit_u16(dev_info->max_sges); + rte_trace_point_emit_i16(dev_info->numa_node); + rte_trace_point_emit_u16(dev_info->nb_vchans); +) + +RTE_TRACE_POINT( + rte_dma_trace_configure, + RTE_TRACE_POINT_ARGS(int16_t dev_id, const struct rte_dma_conf *dev_conf, + int ret), +#ifdef _RTE_TRACE_POINT_REGISTER_H_ + const struct rte_dma_conf __dev_conf = {0}; + dev_conf = &__dev_conf; +#endif /* _RTE_TRACE_POINT_REGISTER_H_ */ + int enable_silent = (int)dev_conf->enable_silent; + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(dev_conf->nb_vchans); + rte_trace_point_emit_int(enable_silent); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_dma_trace_start, + RTE_TRACE_POINT_ARGS(int16_t dev_id, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_dma_trace_stop, + RTE_TRACE_POINT_ARGS(int16_t dev_id, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_dma_trace_close, + RTE_TRACE_POINT_ARGS(int16_t dev_id, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_dma_trace_vchan_setup, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, + const struct rte_dma_vchan_conf *conf, int ret), +#ifdef _RTE_TRACE_POINT_REGISTER_H_ + const struct rte_dma_vchan_conf __conf = {0}; + conf = &__conf; +#endif /* _RTE_TRACE_POINT_REGISTER_H_ */ + int src_port_type = conf->src_port.port_type; + int dst_port_type = conf->dst_port.port_type; + int direction = conf->direction; + uint64_t src_pcie_cfg; + uint64_t dst_pcie_cfg; + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_int(direction); + rte_trace_point_emit_u16(conf->nb_desc); + rte_trace_point_emit_int(src_port_type); + memcpy(&src_pcie_cfg, &conf->src_port.pcie, sizeof(uint64_t)); + rte_trace_point_emit_u64(src_pcie_cfg); + memcpy(&dst_pcie_cfg, &conf->dst_port.pcie, sizeof(uint64_t)); + rte_trace_point_emit_int(dst_port_type); + rte_trace_point_emit_u64(dst_pcie_cfg); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_dma_trace_stats_reset, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_dma_trace_dump, + RTE_TRACE_POINT_ARGS(int16_t dev_id, FILE *f, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_ptr(f); + rte_trace_point_emit_int(ret); +) + +#ifdef __cplusplus +} +#endif + +#endif /* RTE_DMADEV_TRACE_H */ diff --git a/lib/dmadev/rte_dmadev_trace_fp.h b/lib/dmadev/rte_dmadev_trace_fp.h new file mode 100644 index 0000000000..9bcdf7434e --- /dev/null +++ b/lib/dmadev/rte_dmadev_trace_fp.h @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 HiSilicon Limited + */ + +#ifndef RTE_DMADEV_TRACE_FP_H +#define RTE_DMADEV_TRACE_FP_H + +/** + * @file + * + * API for dmadev fastpath trace support + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +RTE_TRACE_POINT_FP( + rte_dma_trace_stats_get, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, + struct rte_dma_stats *stats, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_u64(stats->submitted); + rte_trace_point_emit_u64(stats->completed); + rte_trace_point_emit_u64(stats->errors); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_vchan_status, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, + enum rte_dma_vchan_status *status, int ret), +#ifdef _RTE_TRACE_POINT_REGISTER_H_ + enum rte_dma_vchan_status __status = 0; + status = &__status; +#endif /* _RTE_TRACE_POINT_REGISTER_H_ */ + int vchan_status = *status; + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_int(vchan_status); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_copy, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, rte_iova_t src, + rte_iova_t dst, uint32_t length, uint64_t flags, + int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_u64(src); + rte_trace_point_emit_u64(dst); + rte_trace_point_emit_u32(length); + rte_trace_point_emit_u64(flags); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_copy_sg, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, + struct rte_dma_sge *src, struct rte_dma_sge *dst, + uint16_t nb_src, uint16_t nb_dst, uint64_t flags, + int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_ptr(src); + rte_trace_point_emit_ptr(dst); + rte_trace_point_emit_u16(nb_src); + rte_trace_point_emit_u16(nb_dst); + rte_trace_point_emit_u64(flags); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_fill, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, uint64_t pattern, + rte_iova_t dst, uint32_t length, uint64_t flags, + int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_u64(pattern); + rte_trace_point_emit_u64(dst); + rte_trace_point_emit_u32(length); + rte_trace_point_emit_u64(flags); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_submit, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, int ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_completed, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, + const uint16_t nb_cpls, uint16_t *last_idx, + bool *has_error, uint16_t ret), +#ifdef _RTE_TRACE_POINT_REGISTER_H_ + uint16_t __last_idx = 0; + bool __has_error = false; + last_idx = &__last_idx; + has_error = &__has_error; +#endif /* _RTE_TRACE_POINT_REGISTER_H_ */ + int has_error_val = *has_error; + int last_idx_val = *last_idx; + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_u16(nb_cpls); + rte_trace_point_emit_int(last_idx_val); + rte_trace_point_emit_int(has_error_val); + rte_trace_point_emit_u16(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_completed_status, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, + const uint16_t nb_cpls, uint16_t *last_idx, + enum rte_dma_status_code *status, uint16_t ret), +#ifdef _RTE_TRACE_POINT_REGISTER_H_ + uint16_t __last_idx = 0; + last_idx = &__last_idx; +#endif /* _RTE_TRACE_POINT_REGISTER_H_ */ + int last_idx_val = *last_idx; + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_u16(nb_cpls); + rte_trace_point_emit_int(last_idx_val); + rte_trace_point_emit_ptr(status); + rte_trace_point_emit_u16(ret); +) + +RTE_TRACE_POINT_FP( + rte_dma_trace_burst_capacity, + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, uint16_t ret), + rte_trace_point_emit_i16(dev_id); + rte_trace_point_emit_u16(vchan); + rte_trace_point_emit_u16(ret); +) + +#ifdef __cplusplus +} +#endif + +#endif /* RTE_DMADEV_TRACE_FP_H */ diff --git a/lib/dmadev/rte_dmadev_trace_points.c b/lib/dmadev/rte_dmadev_trace_points.c new file mode 100644 index 0000000000..ddf60922bf --- /dev/null +++ b/lib/dmadev/rte_dmadev_trace_points.c @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2023 HiSilicon Limited + */ + +#include + +#include "rte_dmadev_trace.h" +#include "rte_dmadev_trace_fp.h" + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_info_get, + lib.dmadev.info_get) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_configure, + lib.dmadev.configure) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_start, + lib.dmadev.start) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_stop, + lib.dmadev.stop) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_close, + lib.dmadev.close) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_vchan_setup, + lib.dmadev.vchan_setup) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_stats_get, + lib.dmadev.stats_get) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_stats_reset, + lib.dmadev.stats_reset) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_vchan_status, + lib.dmadev.vchan_status) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_dump, + lib.dmadev.dump) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_copy, + lib.dmadev.copy) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_copy_sg, + lib.dmadev.copy_sg) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_fill, + lib.dmadev.fill) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_submit, + lib.dmadev.submit) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_completed, + lib.dmadev.completed) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_completed_status, + lib.dmadev.completed_status) + +RTE_TRACE_POINT_REGISTER(rte_dma_trace_burst_capacity, + lib.dmadev.burst_capacity) diff --git a/lib/dmadev/version.map b/lib/dmadev/version.map index 7031d6b335..04db94bce5 100644 --- a/lib/dmadev/version.map +++ b/lib/dmadev/version.map @@ -1,6 +1,7 @@ EXPERIMENTAL { global: + # added in 21.11 rte_dma_close; rte_dma_configure; rte_dma_count_avail; @@ -17,6 +18,15 @@ EXPERIMENTAL { rte_dma_vchan_setup; rte_dma_vchan_status; + # added in 23.07 + __rte_dma_trace_burst_capacity; + __rte_dma_trace_completed; + __rte_dma_trace_completed_status; + __rte_dma_trace_copy; + __rte_dma_trace_copy_sg; + __rte_dma_trace_fill; + __rte_dma_trace_submit; + local: *; }; -- 2.17.1