DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Chengwen Feng" <fengchengwen@huawei.com>,
	"Kevin Laatz" <kevin.laatz@intel.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>
Subject: RE: [PATCH] dmadev: add tracepoints
Date: Wed, 12 Apr 2023 13:00:34 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87864@smartserver.smartshare.dk> (raw)
In-Reply-To: <20230412024808.41339-1-fengchengwen@huawei.com>

> From: Chengwen Feng [mailto:fengchengwen@huawei.com]
> Sent: Wednesday, 12 April 2023 04.48
> 
> Add tracepoints at important APIs for tracing support.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---

[...]

> 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 <rte_trace_point.h>
> +
> +#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 = (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 = 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_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 = *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 <rte_trace_point.h>
> +
> +#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 = *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),
> +	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 <rte_trace_point_register.h>
> +
> +#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:
> 
> +	# 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


  parent reply	other threads:[~2023-04-12 11:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  2:48 Chengwen Feng
2023-04-12  9:52 ` Bruce Richardson
2023-04-13  3:44   ` fengchengwen
2023-04-13  8:45     ` Bruce Richardson
2023-04-12 11:00 ` Morten Brørup [this message]
2023-04-13  6:30   ` fengchengwen
2023-04-13  8:25     ` Morten Brørup
2023-04-15  0:33 ` [PATCH v3] " Chengwen Feng
2023-05-24 21:12   ` Thomas Monjalon
2023-05-27  0:17     ` fengchengwen
2023-05-26  8:42 ` [PATCH v4] " Chengwen Feng
2023-07-03  3:54   ` fengchengwen
2023-07-07 10:40   ` Thomas Monjalon
2023-07-09  3:23     ` fengchengwen
2023-07-10  6:49       ` Thomas Monjalon
2023-07-10  7:50         ` fengchengwen
2023-07-31 12:48           ` Thomas Monjalon
2023-08-03  7:52             ` fengchengwen
2023-08-14 14:16               ` Thomas Monjalon
2023-10-11  9:55                 ` fengchengwen
2023-11-06 20:59                   ` Thomas Monjalon
2023-11-07  1:26                     ` fengchengwen
2024-01-12 10:38                     ` fengchengwen
2023-10-20  2:21 ` [PATCH] dmadev: add tracepoints at control path APIs Chengwen Feng
2023-11-06 20:55   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35D87864@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=kevin.laatz@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).