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 EC52842996; Thu, 20 Apr 2023 12:12:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8C5D40A4B; Thu, 20 Apr 2023 12:12:19 +0200 (CEST) Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) by mails.dpdk.org (Postfix) with ESMTP id 284E240687 for ; Thu, 20 Apr 2023 12:12:18 +0200 (CEST) Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-440403d34a4so122549e0c.0 for ; Thu, 20 Apr 2023 03:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681985537; x=1684577537; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=k0gc/GT69lXswAHEbJgr3YlvbdBxnFzT07mcVgXDvTc=; b=kiyPn87d9OgCCnosHAImbSWYbvvMN3Wofo6/a8ubSmxYaHfCMfuBwvNU1CEVZS0cIQ DAj2EvWXQvokVt0seg7XhF4P4U4EKpunGkI4jF2GsbHqCPgtAYMgj/gSkKznUYoGcOb9 rryyqGuoGxnpAOVs1A2qCxBqF/D0rLiK/Ez5oLDoOCYpaV/ZMdvB9yxodKDxVuQHJin3 zhA8odhrF6SeDiCBEpIbS3iUi7gdggpXGVpq922Oh8nmDj3a/hhsmon/2q2i06ebYdS4 hKkSlI8Kc7Ptpt822atGgQh84y8x+oN0+36Zo1wEyNYBWNeyJRCQMHnqMKQZ0eeZiHp3 D59A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985537; x=1684577537; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k0gc/GT69lXswAHEbJgr3YlvbdBxnFzT07mcVgXDvTc=; b=WseUJZxQZWEZPXMGT8C0U6Q9KyGJzfvunT9PmUI8dLSvTtkgxF3VKGEd4v+ueQUMw8 +dWJDYR9pOj17qR8MzYJI9RpgoosR4NYSzuf9ps3A31MMuq6waHD9UV9B28AMDJDiN0y aCX4EPdjg8WoTW04UPwVuDgS32sremIOjKF+9Wmco26kQMCK7i18+kuKlOYZiZGR4snv MBu9HWfk/G+yJlqE1HIuDO3lWuTMokjZa97S7WDkpFL33YOY80peTp5/BM6ZILXP2pc+ TtW0fGet3bmaIZ2G5OQQMQAwQIYYQt7wWwhg0UDBoGbx4z6z3u8RzeLnOEvIGKaBz8Qi c4kQ== X-Gm-Message-State: AAQBX9echpoxv8BhY17i86Nf913K4hrRqdM6LLAJXNLDG42baEACpFDk 06GiA9bOcr7dJ0vEnHskiRF177F6a0gwrNoXKdHgkhjCD1pZ/w== X-Google-Smtp-Source: AKy350bE+J8G+lhjTE6IwUSkRiKmlu/g3w2SAOw0mXkzslSHSsBEv3n0woYnVqn8BqGAUkeS997swyYznVejee7SNlY= X-Received: by 2002:a05:6102:252:b0:42e:3bb5:e855 with SMTP id a18-20020a056102025200b0042e3bb5e855mr689557vsq.9.1681985537331; Thu, 20 Apr 2023 03:12:17 -0700 (PDT) MIME-Version: 1.0 References: <20230420100803.494-1-viacheslavo@nvidia.com> <20230420100803.494-3-viacheslavo@nvidia.com> In-Reply-To: <20230420100803.494-3-viacheslavo@nvidia.com> From: Jerin Jacob Date: Thu, 20 Apr 2023 15:41:51 +0530 Message-ID: Subject: Re: [RFC 2/5] common/mlx5: introduce tracepoints for mlx5 drivers To: Viacheslav Ovsiienko Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Thu, Apr 20, 2023 at 3:38=E2=80=AFPM Viacheslav Ovsiienko wrote: > > There is an intention to engage DPDK tracing capabilities > for mlx5 PMDs monitoring and profiling in various modes. > The patch introduces tracepoints for the Tx datapath in > the ethernet device driver. > > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/common/mlx5/meson.build | 1 + > drivers/common/mlx5/mlx5_trace.c | 25 +++++++++++ > drivers/common/mlx5/mlx5_trace.h | 72 ++++++++++++++++++++++++++++++++ > drivers/common/mlx5/version.map | 8 ++++ > 4 files changed, 106 insertions(+) > create mode 100644 drivers/common/mlx5/mlx5_trace.c > create mode 100644 drivers/common/mlx5/mlx5_trace.h > > diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.= build > index 9dc809f192..e074ffb140 100644 > --- a/drivers/common/mlx5/meson.build > +++ b/drivers/common/mlx5/meson.build > @@ -19,6 +19,7 @@ sources +=3D files( > 'mlx5_common_mp.c', > 'mlx5_common_mr.c', > 'mlx5_malloc.c', > + 'mlx5_trace.c', > 'mlx5_common_pci.c', > 'mlx5_common_devx.c', > 'mlx5_common_utils.c', > diff --git a/drivers/common/mlx5/mlx5_trace.c b/drivers/common/mlx5/mlx5_= trace.c > new file mode 100644 > index 0000000000..b9f14413ad > --- /dev/null > +++ b/drivers/common/mlx5/mlx5_trace.c > @@ -0,0 +1,25 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright (c) 2022 NVIDIA Corporation & Affiliates > + */ > + > +#include > +#include > + > +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_entry, > + pmd.net.mlx5.tx.entry) > + > +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_exit, > + pmd.net.mlx5.tx.exit) > + > +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_wqe, > + pmd.net.mlx5.tx.wqe) > + > +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_wait, > + pmd.net.mlx5.tx.wait) > + > +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_push, > + pmd.net.mlx5.tx.push) > + > +RTE_TRACE_POINT_REGISTER(rte_pmd_mlx5_trace_tx_complete, > + pmd.net.mlx5.tx.complete) > + > diff --git a/drivers/common/mlx5/mlx5_trace.h b/drivers/common/mlx5/mlx5_= trace.h > new file mode 100644 > index 0000000000..57512e654f > --- /dev/null > +++ b/drivers/common/mlx5/mlx5_trace.h > @@ -0,0 +1,72 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright (c) 2022 NVIDIA Corporation & Affiliates > + */ > + > +#ifndef RTE_PMD_MLX5_TRACE_H_ > +#define RTE_PMD_MLX5_TRACE_H_ > + > +/** > + * @file > + * > + * API for mlx5 PMD trace support > + */ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include > +#include > +#include > + > +RTE_TRACE_POINT_FP( > + rte_pmd_mlx5_trace_tx_entry, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(queue_id); > +) > + > +RTE_TRACE_POINT_FP( > + rte_pmd_mlx5_trace_tx_exit, > + RTE_TRACE_POINT_ARGS(uint16_t nb_sent, uint16_t nb_req), > + rte_trace_point_emit_u16(nb_sent); > + rte_trace_point_emit_u16(nb_req); > +) > + > +RTE_TRACE_POINT_FP( > + rte_pmd_mlx5_trace_tx_wqe, > + RTE_TRACE_POINT_ARGS(uint32_t opcode), > + rte_trace_point_emit_u32(opcode); > +) > + > +RTE_TRACE_POINT_FP( > + rte_pmd_mlx5_trace_tx_wait, > + RTE_TRACE_POINT_ARGS(uint64_t ts), > + rte_trace_point_emit_u64(ts); > +) > + > + > +RTE_TRACE_POINT_FP( > + rte_pmd_mlx5_trace_tx_push, > + RTE_TRACE_POINT_ARGS(const struct rte_mbuf *mbuf, uint16_t wqe_id= ), > + rte_trace_point_emit_ptr(mbuf); > + rte_trace_point_emit_u32(mbuf->pkt_len); > + rte_trace_point_emit_u16(mbuf->nb_segs); > + rte_trace_point_emit_u16(wqe_id); > +) > + > +RTE_TRACE_POINT_FP( > + rte_pmd_mlx5_trace_tx_complete, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, > + uint16_t wqe_id, uint64_t ts), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(queue_id); > + rte_trace_point_emit_u64(ts); > + rte_trace_point_emit_u16(wqe_id); > +) > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* RTE_PMD_MLX5_TRACE_H_ */ > diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/versio= n.map > index e05e1aa8c5..d0ec8571e6 100644 > --- a/drivers/common/mlx5/version.map > +++ b/drivers/common/mlx5/version.map > @@ -158,5 +158,13 @@ INTERNAL { > > mlx5_os_interrupt_handler_create; # WINDOWS_NO_EXPORT > mlx5_os_interrupt_handler_destroy; # WINDOWS_NO_EXPORT > + > + __rte_pmd_mlx5_trace_tx_entry; > + __rte_pmd_mlx5_trace_tx_exit; > + __rte_pmd_mlx5_trace_tx_wqe; > + __rte_pmd_mlx5_trace_tx_wait; > + __rte_pmd_mlx5_trace_tx_push; > + __rte_pmd_mlx5_trace_tx_complete; No need to expose these symbols. It is getting removed from rest of DPDK. Application can do rte_trace_lookup() to get this address. > + > local: *; > }; > -- > 2.18.1 >