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 853AB42926; Wed, 12 Apr 2023 13:00:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5585C40FAE; Wed, 12 Apr 2023 13:00:41 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 32BB64067B for ; Wed, 12 Apr 2023 13:00:39 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] dmadev: add tracepoints Date: Wed, 12 Apr 2023 13:00:34 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87864@smartserver.smartshare.dk> In-Reply-To: <20230412024808.41339-1-fengchengwen@huawei.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] dmadev: add tracepoints Thread-Index: Adls6jC7YR4U3Xn4RDe2MbgV9Zs1jAAQZogA References: <20230412024808.41339-1-fengchengwen@huawei.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Chengwen Feng" , "Kevin Laatz" , "Bruce Richardson" Cc: , 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 > From: Chengwen Feng [mailto:fengchengwen@huawei.com] > Sent: Wednesday, 12 April 2023 04.48 >=20 > Add tracepoints at important APIs for tracing support. >=20 > Signed-off-by: Chengwen Feng > --- [...] > diff --git a/lib/dmadev/rte_dmadev_trace.h = b/lib/dmadev/rte_dmadev_trace.h > new file mode 100644 > index 0000000000..0dae78ca15 > --- /dev/null > +++ b/lib/dmadev/rte_dmadev_trace.h > @@ -0,0 +1,133 @@ > +/* 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), > + int enable_silent =3D (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), > + int src_port_type =3D conf->src_port.port_type; > + int dst_port_type =3D conf->dst_port.port_type; > + int direction =3D 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_get, This should be a fast path trace point. For reference, ethdev considers rte_eth_stats_get() a fast path = function. > + 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( > + 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_vchan_status, This should be a fast path trace point. For reference, ethdev considers rte_eth_link_get() a fast path function. > + RTE_TRACE_POINT_ARGS(int16_t dev_id, uint16_t vchan, > + enum rte_dma_vchan_status *status, int ret), > + int vchan_status =3D *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( > + 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..f5ebad1bc4 > --- /dev/null > +++ b/lib/dmadev/rte_dmadev_trace_fp.h > @@ -0,0 +1,113 @@ > +/* 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_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), > + int has_error_val =3D *has_error; > + int last_idx_val =3D *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), > + int last_idx_val =3D *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..4ee1b3f74a 100644 > --- a/lib/dmadev/version.map > +++ b/lib/dmadev/version.map > @@ -1,6 +1,16 @@ > EXPERIMENTAL { > global: >=20 > + # 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; > + Intuitively, I would suppose that the 23.07 functions should be listed = after the 21.11 functions, not before. > + # added in 21.11 Good catch. > rte_dma_close; > rte_dma_configure; > rte_dma_count_avail; > -- > 2.17.1