From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30A34A0471 for ; Tue, 13 Aug 2019 06:38:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 28C5F1BDAE; Tue, 13 Aug 2019 06:38:00 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1910F1B952 for ; Tue, 13 Aug 2019 06:37:58 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 21:37:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,380,1559545200"; d="scan'208";a="200361611" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 12 Aug 2019 21:37:58 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 21:37:58 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 21:37:57 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.19]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.204]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 12:37:55 +0800 From: "Wang, Haiyue" To: Stephen Hemminger CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information Thread-Index: AQHVUYTDT/0YGy+MOU67JpkccwCfnab35B0AgACXj0A= Date: Tue, 13 Aug 2019 04:37:55 +0000 Message-ID: References: <1565665572-65495-1-git-send-email-haiyue.wang@intel.com> <1565665572-65495-2-git-send-email-haiyue.wang@intel.com> <20190812202436.662e6ca8@hermes.lan> In-Reply-To: <20190812202436.662e6ca8@hermes.lan> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGEwODRiMjEtN2UzZC00NjZmLWFmODctMTM5NmI4M2E5NDU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaUtqZTdjUnVhQVZzbHJERG44SW43TmsrOFhSYzVtcEZpYVhmWHptck9hZjR5bUE5ZGI2K3dNWjVZRjVOUEwzUSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, August 13, 2019 11:25 > To: Wang, Haiyue > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trac= e information >=20 > On Tue, 13 Aug 2019 11:06:10 +0800 > Haiyue Wang wrote: >=20 > > Enhance the PMD to support retrieving trace information like > > Rx/Tx burst selection etc. > > > > Signed-off-by: Haiyue Wang > > --- > > lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ > > lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ > > lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ > > 3 files changed, 31 insertions(+) > > > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_eth= dev.c > > index 17d183e..6098fad 100644 > > --- a/lib/librte_ethdev/rte_ethdev.c > > +++ b/lib/librte_ethdev/rte_ethdev.c > > @@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint= 16_t queue_id, > > } > > > > int > > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id, > > + enum rte_eth_trace type, char *buf, int sz) > > +{ > > + struct rte_eth_dev *dev; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > > + > > + if (buf =3D=3D NULL) > > + return -EINVAL; > > + > > + dev =3D &rte_eth_devices[port_id]; > > + > > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP); > > + > > + return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz); >=20 > What if queueid is out of bounds? Some trace may not need queueid, so skip it check here, make it a little flexible. >=20 > The bigger problem is that this information is like a log message > and unstructured, which makes it device specific and useless for automati= on. >=20 > Why not just keep it in the log like it is now? Yes, log is good now (but need run with extra options). This patch works li= ke run time debug tool, it identify the code running status. Not for automatio= n now. But if we want this kind of things, hook the code point, define a rule to format the message. >=20 > > int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, > > struct rte_eth_txq_info *qinfo); > > > > +int > > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id, > > + enum rte_eth_trace type, char *buf, int sz); > > + >=20 > You didn't run checkpatch, otherwise you would have seen complaints > about not listing API as experimental. >=20 ./devtools/checkpatches.sh ? 3/3 valid patches > Also the API would have to be in the map file as well. >=20 > Docbook comments are also missing. >=20 >=20 This is rough draft, so show the code firstly. ;-)