DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <mcoqueli@redhat.com>
To: Nicolas Chautru <nicolas.chautru@intel.com>
Cc: dev@dpdk.org, maxime.coquelin@redhat.com, hemant.agrawal@nxp.com,
	 hernan.vargas@intel.com
Subject: Re: [PATCH v1 1/2] bbdev: add trace points per operation
Date: Thu, 16 Oct 2025 17:48:33 +0200	[thread overview]
Message-ID: <CAO55cswXSDNtm6Wng5x5p_D2QnWg_TLzw5Dv0j5p+ry9jovpVQ@mail.gmail.com> (raw)
In-Reply-To: <20250527223642.31577-2-nicolas.chautru@intel.com>

On Wed, May 28, 2025 at 12:36 AM Nicolas Chautru
<nicolas.chautru@intel.com> wrote:
>
> Adds trace points for rte_bbdev for each operation
> type set of input parameters.
> ---
>  lib/bbdev/bbdev_trace.h        | 113 +++++++++++++++++++++++++++++++++
>  lib/bbdev/bbdev_trace_points.c |  12 ++++
>  lib/bbdev/rte_bbdev.c          |  24 +++++++
>  lib/bbdev/rte_bbdev.h          |  14 ++++
>  4 files changed, 163 insertions(+)
>
> diff --git a/lib/bbdev/bbdev_trace.h b/lib/bbdev/bbdev_trace.h
> index 7256d6b703..dbef6efa3b 100644
> --- a/lib/bbdev/bbdev_trace.h
> +++ b/lib/bbdev/bbdev_trace.h
> @@ -62,6 +62,119 @@ RTE_TRACE_POINT(
>         rte_trace_point_emit_u16(queue_id);
>  )
>
> +
> +RTE_TRACE_POINT(
> +       rte_bbdev_trace_op_ldpc_dec,
> +       RTE_TRACE_POINT_ARGS(const struct rte_bbdev_op_ldpc_dec ldpc_dec),
> +       rte_trace_point_emit_u8(ldpc_dec.code_block_mode);
> +       rte_trace_point_emit_u8(ldpc_dec.tb_params.c);
> +       rte_trace_point_emit_u8(ldpc_dec.tb_params.cab);
> +       rte_trace_point_emit_u32(ldpc_dec.tb_params.ea);
> +       rte_trace_point_emit_u32(ldpc_dec.tb_params.eb);
> +       rte_trace_point_emit_u8(ldpc_dec.tb_params.r);
> +       rte_trace_point_emit_u32(ldpc_dec.cb_params.e);
> +       rte_trace_point_emit_u32(ldpc_dec.op_flags);
> +       rte_trace_point_emit_u8(ldpc_dec.basegraph);
> +       rte_trace_point_emit_u16(ldpc_dec.z_c);
> +       rte_trace_point_emit_u16(ldpc_dec.n_cb);
> +       rte_trace_point_emit_u8(ldpc_dec.q_m);
> +       rte_trace_point_emit_u16(ldpc_dec.n_filler);
> +       rte_trace_point_emit_u8(ldpc_dec.rv_index);
> +       rte_trace_point_emit_u8(ldpc_dec.iter_max);
> +       rte_trace_point_emit_u8(ldpc_dec.iter_count);
> +       rte_trace_point_emit_u32(ldpc_dec.harq_combined_input.length);
> +)
> +
> +RTE_TRACE_POINT(
> +       rte_bbdev_trace_op_ldpc_enc,
> +       RTE_TRACE_POINT_ARGS(const struct rte_bbdev_op_ldpc_enc ldpc_enc),
> +       rte_trace_point_emit_u8(ldpc_enc.code_block_mode);
> +       rte_trace_point_emit_u8(ldpc_enc.tb_params.c);
> +       rte_trace_point_emit_u8(ldpc_enc.tb_params.cab);
> +       rte_trace_point_emit_u32(ldpc_enc.tb_params.ea);
> +       rte_trace_point_emit_u32(ldpc_enc.tb_params.eb);
> +       rte_trace_point_emit_u8(ldpc_enc.tb_params.r);
> +       rte_trace_point_emit_u32(ldpc_enc.cb_params.e);
> +       rte_trace_point_emit_u32(ldpc_enc.op_flags);
> +       rte_trace_point_emit_u8(ldpc_enc.basegraph);
> +       rte_trace_point_emit_u16(ldpc_enc.z_c);
> +       rte_trace_point_emit_u16(ldpc_enc.n_cb);
> +       rte_trace_point_emit_u8(ldpc_enc.q_m);
> +       rte_trace_point_emit_u16(ldpc_enc.n_filler);
> +       rte_trace_point_emit_u8(ldpc_enc.rv_index);
> +)
> +
> +RTE_TRACE_POINT(
> +       rte_bbdev_trace_op_turbo_enc,
> +       RTE_TRACE_POINT_ARGS(const struct rte_bbdev_op_turbo_enc turbo_enc),
> +       rte_trace_point_emit_u8(turbo_enc.code_block_mode);
> +       rte_trace_point_emit_u32(turbo_enc.op_flags);
> +       rte_trace_point_emit_u8(turbo_enc.rv_index);
> +       rte_trace_point_emit_u16(turbo_enc.tb_params.k_neg);
> +       rte_trace_point_emit_u16(turbo_enc.tb_params.k_pos);
> +       rte_trace_point_emit_u8(turbo_enc.tb_params.c_neg);
> +       rte_trace_point_emit_u8(turbo_enc.tb_params.c);
> +       rte_trace_point_emit_u8(turbo_enc.tb_params.cab);
> +       rte_trace_point_emit_u32(turbo_enc.tb_params.ea);
> +       rte_trace_point_emit_u32(turbo_enc.tb_params.eb);
> +       rte_trace_point_emit_u8(turbo_enc.tb_params.r);
> +       rte_trace_point_emit_u32(turbo_enc.cb_params.e);
> +       rte_trace_point_emit_u16(turbo_enc.cb_params.k);
> +)
> +
> +RTE_TRACE_POINT(
> +       rte_bbdev_trace_op_turbo_dec,
> +       RTE_TRACE_POINT_ARGS(const struct rte_bbdev_op_turbo_dec turbo_dec),
> +       rte_trace_point_emit_u8(turbo_dec.code_block_mode);
> +       rte_trace_point_emit_u32(turbo_dec.op_flags);
> +       rte_trace_point_emit_u8(turbo_dec.rv_index);
> +       rte_trace_point_emit_u8(turbo_dec.iter_count);
> +       rte_trace_point_emit_u8(turbo_dec.ext_scale);
> +       rte_trace_point_emit_u8(turbo_dec.num_maps);
> +       rte_trace_point_emit_u16(turbo_dec.tb_params.k_neg);
> +       rte_trace_point_emit_u16(turbo_dec.tb_params.k_pos);
> +       rte_trace_point_emit_u8(turbo_dec.tb_params.c_neg);
> +       rte_trace_point_emit_u8(turbo_dec.tb_params.c);
> +       rte_trace_point_emit_u8(turbo_dec.tb_params.cab);
> +       rte_trace_point_emit_u32(turbo_dec.tb_params.ea);
> +       rte_trace_point_emit_u32(turbo_dec.tb_params.eb);
> +       rte_trace_point_emit_u8(turbo_dec.tb_params.r);
> +       rte_trace_point_emit_u32(turbo_dec.cb_params.e);
> +       rte_trace_point_emit_u16(turbo_dec.cb_params.k);
> +)
> +
> +RTE_TRACE_POINT(
> +       rte_bbdev_trace_op_fft,
> +       RTE_TRACE_POINT_ARGS(const struct rte_bbdev_op_fft fft),
> +       rte_trace_point_emit_u32(fft.op_flags);
> +       rte_trace_point_emit_u16(fft.input_sequence_size);
> +       rte_trace_point_emit_u16(fft.input_leading_padding);
> +       rte_trace_point_emit_u16(fft.output_sequence_size);
> +       rte_trace_point_emit_u16(fft.output_leading_depadding);
> +       rte_trace_point_emit_u16(fft.cs_bitmap);
> +       rte_trace_point_emit_u8(fft.num_antennas_log2);
> +       rte_trace_point_emit_u8(fft.idft_log2);
> +       rte_trace_point_emit_u8(fft.dft_log2);
> +       rte_trace_point_emit_u8(fft.cs_time_adjustment);
> +       rte_trace_point_emit_u8(fft.idft_shift);
> +       rte_trace_point_emit_u8(fft.dft_shift);
> +       rte_trace_point_emit_u16(fft.ncs_reciprocal);
> +       rte_trace_point_emit_u16(fft.power_shift);
> +       rte_trace_point_emit_u16(fft.fp16_exp_adjust);
> +       rte_trace_point_emit_u8(fft.freq_resample_mode);
> +       rte_trace_point_emit_u16(fft.output_depadded_size);
> +)
> +
> +RTE_TRACE_POINT(
> +       rte_bbdev_trace_op_mldts,
> +       RTE_TRACE_POINT_ARGS(const struct rte_bbdev_op_mldts mldts),
> +       rte_trace_point_emit_u32(mldts.op_flags);
> +       rte_trace_point_emit_u16(mldts.num_rbs);
> +       rte_trace_point_emit_u16(mldts.num_layers);
> +       rte_trace_point_emit_u8(mldts.r_rep);
> +       rte_trace_point_emit_u8(mldts.c_rep);
> +)
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/bbdev/bbdev_trace_points.c b/lib/bbdev/bbdev_trace_points.c
> index 942c7be819..23d1164e7d 100644
> --- a/lib/bbdev/bbdev_trace_points.c
> +++ b/lib/bbdev/bbdev_trace_points.c
> @@ -21,6 +21,18 @@ RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_start,
>         lib.bbdev.queue.start)
>  RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_stop,
>         lib.bbdev.queue.stop)
> +RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_op_ldpc_dec,
> +       lib.bbdev.op.ldpc_dec);
> +RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_op_ldpc_enc,
> +       lib.bbdev.op.ldpc_enc);
> +RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_op_turbo_dec,
> +       lib.bbdev.op.turbo_dec);
> +RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_op_turbo_enc,
> +       lib.bbdev.op.turbo_enc);
> +RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_op_fft,
> +       lib.bbdev.op.fft);
> +RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_op_mldts,
> +       lib.bbdev.op.mldts);
>
>  RTE_EXPORT_EXPERIMENTAL_SYMBOL(__rte_bbdev_trace_enqueue, 25.03)
>  RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_enqueue,
> diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
> index e0f8c8eb0d..4958a87646 100644
> --- a/lib/bbdev/rte_bbdev.c
> +++ b/lib/bbdev/rte_bbdev.c
> @@ -1281,6 +1281,30 @@ rte_bbdev_queue_ops_dump(uint16_t dev_id, uint16_t queue_id, FILE *f)
>         return dev->dev_ops->queue_ops_dump(dev, queue_id, f);
>  }
>
> +RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_bbdev_ops_trace, 25.03)
> +void
> +rte_bbdev_ops_trace(void *op, enum rte_bbdev_op_type op_type)
> +{
> +       struct rte_bbdev_dec_op *op_dec = op;
> +       struct rte_bbdev_enc_op *op_enc = op;
> +       struct rte_bbdev_fft_op *op_fft = op;
> +       struct rte_bbdev_mldts_op *op_mldts = op;
> +
> +       if (op_type == RTE_BBDEV_OP_LDPC_DEC) {
> +               rte_bbdev_trace_op_ldpc_dec(op_dec->ldpc_dec);
> +       } else if (op_type == RTE_BBDEV_OP_LDPC_ENC) {
> +               rte_bbdev_trace_op_ldpc_enc(op_enc->ldpc_enc);
> +       } else if (op_type == RTE_BBDEV_OP_FFT) {
> +               rte_bbdev_trace_op_fft(op_fft->fft);
> +       } else if (op_type == RTE_BBDEV_OP_MLDTS) {
> +               rte_bbdev_trace_op_mldts(op_mldts->mldts);
> +       } else if (op_type == RTE_BBDEV_OP_TURBO_DEC) {
> +               rte_bbdev_trace_op_turbo_dec(op_dec->turbo_dec);
> +       } else if (op_type == RTE_BBDEV_OP_TURBO_ENC) {
> +               rte_bbdev_trace_op_turbo_enc(op_enc->turbo_enc);
> +       }
> +}
> +
>  RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_bbdev_ops_param_string, 24.11)
>  char *
>  rte_bbdev_ops_param_string(void *op, enum rte_bbdev_op_type op_type, char *str, uint32_t len)
> diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
> index 710280f0df..4912bc7b6f 100644
> --- a/lib/bbdev/rte_bbdev.h
> +++ b/lib/bbdev/rte_bbdev.h
> @@ -1147,6 +1147,20 @@ __rte_experimental
>  char *
>  rte_bbdev_ops_param_string(void *op, enum rte_bbdev_op_type op_type, char *str, uint32_t len);
>
> +/**
> + * Add a trace with detail of operation.
> + *
> + *  @param op
> + *    Pointer to an operation.
> + *
> + *  @param op_type
> + *    Operation type enum.
> + *
> + */
> +__rte_experimental
> +void
> +rte_bbdev_ops_trace(void *op, enum rte_bbdev_op_type op_type);
> +
>  #ifdef __cplusplus
>  }
>  #endif

Looks good to me.
I'm wondering if it would make sense to have a rte_bbdev_ops_trace_fp
version that would be a a noop
if RTE_ENABLE_TRACE_FP is not set.
It could be called in the hot paths and enabled when debugging?

It could be done as an add-on patch.

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

> --
> 2.34.1
>


  reply	other threads:[~2025-10-16 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 22:36 [PATCH v1 0/2] bbdev: add trace point per operations Nicolas Chautru
2025-05-27 22:36 ` [PATCH v1 1/2] bbdev: add trace points per operation Nicolas Chautru
2025-10-16 15:48   ` Maxime Coquelin [this message]
2025-05-27 22:36 ` [PATCH v1 2/2] baseband/acc: " Nicolas Chautru
2025-10-16 15:44   ` Maxime Coquelin
2025-10-16 16:01     ` Maxime Coquelin
2025-10-16 16:39 ` [PATCH v1 0/2] bbdev: add trace point per operations Maxime Coquelin

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=CAO55cswXSDNtm6Wng5x5p_D2QnWg_TLzw5Dv0j5p+ry9jovpVQ@mail.gmail.com \
    --to=mcoqueli@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=hernan.vargas@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=nicolas.chautru@intel.com \
    /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).