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 3FB36459C6; Wed, 18 Sep 2024 10:56:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00A3042EEA; Wed, 18 Sep 2024 10:56:54 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id EBC8342DE4 for ; Wed, 18 Sep 2024 10:56:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726649812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y+LvZrtaj55kSzH+XClFSLtZJSoa2HUOvo2m5FwUMQo=; b=TwPgDE8ewYYzr05zYNB6Y/ulg/nWqYupwLnALLQPcwWTqmjaLdnhRbGzLxlFvmrBn0m0Je gXBo3La11JeJYTEHf7EqjX38uTtIUVPuNpcXkDnJPT2MdP8kbuVB5NkR3NdBjgW+pSqVXZ qA3A3W+9pZk3RcBRYqdCIhwP0Hyopwo= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-F7l45uumMySlQGBtHDndpg-1; Wed, 18 Sep 2024 04:56:51 -0400 X-MC-Unique: F7l45uumMySlQGBtHDndpg-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2f75cf9472dso45847721fa.3 for ; Wed, 18 Sep 2024 01:56:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726649810; x=1727254610; 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=Y+LvZrtaj55kSzH+XClFSLtZJSoa2HUOvo2m5FwUMQo=; b=DZi+nOEaoW3Cn5DbGDVD6q5BkGKgclhyrnVa8D76jvLZj3kQ3HmzwwCpNrcA2g6lmd ein0ui0qdGAbWffq3JMqwvTorTaY8kxRV0EsVhkYO1N2h9Yjqucz+ZUbXnPTFYIrK5Ar zw5fyV5RrIhBr3sca9BNLkcYdh7JusS5E5+dK8Mjl6KnW5nAR3sTrYqn5oBpmu25Syh4 v5v72tIo728FrVrnplwuy33s7AaXj+vW9rfDkp77TTLx5/sPphBnRY7mVJTRGNV6tNQO DPys2/ujvitvvB31zZLTFIgcVlMbuE+xCVcXNA/rn4WQ3Cd3anr72JPjbHbJcXfllETh SncQ== X-Gm-Message-State: AOJu0Yy90dDQlfn5diu0XIorwqitHmVxlqKPk6BQvSD5pZLk2WGuJDT4 nlQq4lTBsBTiAcO4bwIEn8/jjP14fB2jCYLBcaDMAPd4Vk8Hl8sisTAV4WqYeZkQoQxShxp9HJQ KdGQgt/qbow9JwDfxRFVWCDlxyIT6IojC/okhrYoE0KbMERQm/la01DA2TdO4KdVMaRuXrc+HgK M2a88uMW9FLhY5j/k= X-Received: by 2002:a2e:a99d:0:b0:2f7:5805:7a66 with SMTP id 38308e7fff4ca-2f787dad3e1mr126934861fa.8.1726649809790; Wed, 18 Sep 2024 01:56:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf78ZhN991yOM5rYLpRoycVqCm7RatjI/KBX/aNtlG5wuM0Si5lSCZusiJu1bdxjufhY9PvmshJnATAC5U0QA= X-Received: by 2002:a2e:a99d:0:b0:2f7:5805:7a66 with SMTP id 38308e7fff4ca-2f787dad3e1mr126933821fa.8.1726649807285; Wed, 18 Sep 2024 01:56:47 -0700 (PDT) MIME-Version: 1.0 References: <20240918060936.1231758-3-wanry@yunsilicon.com> In-Reply-To: <20240918060936.1231758-3-wanry@yunsilicon.com> From: David Marchand Date: Wed, 18 Sep 2024 10:56:35 +0200 Message-ID: Subject: Re: [PATCH v3 02/19] net/xsc: add log macro To: WanRenyong Cc: dev@dpdk.org, ferruh.yigit@amd.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Wed, Sep 18, 2024 at 8:10=E2=80=AFAM WanRenyong w= rote: > > Add log macro to print runtime messages and trace functions. > > Signed-off-by: WanRenyong > > --- > > v3: > * use RTE_LOG_LINE_PREFIX instead of rte_log > --- > drivers/net/xsc/xsc_ethdev.c | 11 +++++++++ > drivers/net/xsc/xsc_log.h | 46 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 57 insertions(+) > create mode 100644 drivers/net/xsc/xsc_log.h > > diff --git a/drivers/net/xsc/xsc_ethdev.c b/drivers/net/xsc/xsc_ethdev.c > index 0e48cb76fa..58ceaa3940 100644 > --- a/drivers/net/xsc/xsc_ethdev.c > +++ b/drivers/net/xsc/xsc_ethdev.c > @@ -1,3 +1,14 @@ > /* SPDX-License-Identifier: BSD-3-Clause > * Copyright 2024 Yunsilicon Technology Co., Ltd. > */ > + > +#include "xsc_log.h" > + > +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_init, init, NOTICE); > +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_driver, driver, NOTICE); > +#ifdef RTE_ETHDEV_DEBUG_RX > +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_rx, rx, DEBUG); > +#endif > +#ifdef RTE_ETHDEV_DEBUG_TX > +RTE_LOG_REGISTER_SUFFIX(xsc_logtype_tx, tx, DEBUG); > +#endif > diff --git a/drivers/net/xsc/xsc_log.h b/drivers/net/xsc/xsc_log.h > new file mode 100644 > index 0000000000..99a88fcd1b > --- /dev/null > +++ b/drivers/net/xsc/xsc_log.h > @@ -0,0 +1,46 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2024 Yunsilicon Technology Co., Ltd. > + */ > + > +#ifndef _XSC_LOG_H_ > +#define _XSC_LOG_H_ > + > +#include > + > +extern int xsc_logtype_init; > +extern int xsc_logtype_driver; > +#define RTE_LOGTYPE_XSC_INIT xsc_logtype_init > +#define RTE_LOGTYPE_XSC_DRV xsc_logtype_driver > + > + > +#define PMD_INIT_LOG(level, ...) \ > + RTE_LOG_LINE_PREFIX(level, XSC_INIT, "%s(): ", __func__, __VA_ARG= S__) Thank you for converting to RTE_LOG_LINE! > + > + > +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") > + > +#ifdef RTE_ETHDEV_DEBUG_RX > +extern int xsc_logtype_rx; > +#define RTE_LOGTYPE_XSC_RX xsc_logtype_rx > +#define PMD_RX_LOG(level, ...) \ > + RTE_LOG_LINE_PREFIX(level, XSC_RX, "%s(): ", __func__, __VA_ARGS_= _) > +#else > +#define PMD_RX_LOG(level, ...) do { } while (0) > +#endif > + > +#ifdef RTE_ETHDEV_DEBUG_TX > +extern int xsc_logtype_tx; > +#define RTE_LOGTYPE_XSC_TX xsc_logtype_tx > +#define PMD_TX_LOG(level, ...) \ > + RTE_LOG_LINE_PREFIX(level, XSC_TX, "%s(): ", __func__, __VA_ARGS_= _) > +#else > +#define PMD_TX_LOG(level, ...) do { } while (0) > +#endif I don't see any code calling those macros in the series, so I would remove them for now. You can introduce them in the future when needed. > + > +#define PMD_DRV_LOG_RAW(level, ...) \ > + RTE_LOG_LINE_PREFIX(level, XSC_DRV, "%s(): ", __func__, __VA_ARGS= __) > + > +#define PMD_DRV_LOG(level, ...) \ > + PMD_DRV_LOG_RAW(level, __VA_ARGS__) The PMD_DRV_LOG_RAW macro seems unused and can be removed =3D> PMD_DRV_LOG() directly calls RTE_LOG_LINE_PREFIX(). --=20 David Marchand