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 34225A052B; Thu, 30 Jul 2020 20:29:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 62CDD10A3; Thu, 30 Jul 2020 20:29:05 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id D47B9A69 for ; Thu, 30 Jul 2020 20:29:03 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 112555C01D8; Thu, 30 Jul 2020 14:29:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 30 Jul 2020 14:29:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= QGwdLtC/V9D3YtuLxHpMAgVH7zjWg/mfBhIlg9E1tCQ=; b=CjyC/XufEQ85Zb+d qGgqW73sY5IKCJwaXHIKJubyWEbzOiO7SHzn+lqwI2TsoZ2yEd1mQu5JbCh1rmeq OXibTV85zldi/QskrlbZO/U9RTYPYBdq3DbKXNysqygKqilI5eSnx4ixuyrEdv/u S/YnO8a3quqFxbySUQxMfM0EDuJ1hz4CzYn59nvFaoLN2c5N2suuPVQbjKlPmory BS0QpPlguzD4Ygo5Yy9sclPUj4nZ5wCCuE6X4SsrOgWLUb2DI4JcNS1mTaquG9jO Ca5OzCUJaar6eENL16L+KDHMPNJAi/TTWpvRwy9fOuQb5NEPkx8AQdBL5CzHYY6d 2E2N2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=QGwdLtC/V9D3YtuLxHpMAgVH7zjWg/mfBhIlg9E1t CQ=; b=qmFC3jtsbLql1PLZpJcAN8LKcEY+pqihGBQLqEcRwUxLzZN6bvSpYp3oQ 7T3D7jVF03icjVAgrzqudxfVlGvqVxGdAQY5g4BMd+RTloBQ8QxaZvJhpB1BM3Tr dYym276NkfMm4XNXiJ4yuMf3nKJC7gry0lYga/cuy6QvY3e2+ipL/Q9lv8sLppcx BABysAvNMLV1YUfTO4L5G1Y/8ANcKqD13hu001fhj7W2TvqePKIXfwFZa8kETB4A l6y6ZoBTYMCYZhVPSs6BqXwZJdOaYmd0tyft7wdgUiCFUTl2BPlLd/QTpEwqukFC 068nzb/5HiTkgVMXt52fYTCzrh4Kg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C2F1230600B2; Thu, 30 Jul 2020 14:29:00 -0400 (EDT) From: Thomas Monjalon To: Ciara Power Cc: kevin.laatz@intel.com, dev@dpdk.org, bruce.richardson@intel.com Date: Thu, 30 Jul 2020 20:28:59 +0200 Message-ID: <3728578.6CtKLKD1J2@thomas> In-Reply-To: <20200724112033.24860-1-ciara.power@intel.com> References: <20200721160924.62082-1-ciara.power@intel.com> <20200724112033.24860-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3] doc: add more detail to telemetry guides 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" 24/07/2020 13:20, Ciara Power: > +**Example Callback** > + > +This callback is an example of handling multiple commands in one callback, > +and also shows the use of params which holds a port ID. The params input needs > +to be validated and converted to the required integer type for port ID. The cmd > +parameter is then used in a comparison to decide which command was requested, > +which will decide what port information should fill the rte_tel_data structure. Some variable names above needs to be enclosed in ``. [...] > +Array Data > +^^^^^^^^^^ > + > + Some data will need to be formatted in a list structure. For example, if a > + callback needs to return five integer values in the data response, it can be > + constructed using the following functions to build up the list: > + > + .. code-block:: c > + > + rte_tel_data_start_array(d, RTE_TEL_INT_VAL); > + for(i = 0; i < 5; i++) > + rte_tel_data_add_array_int(d, i); > + > + The resulting response to the client shows the list data provided above > + by the handler function in the library/app, placed in a JSON reply by > + telemetry:: Indent of normal text is wrong. > -The data structure is then formatted into a JSON response before sending. > -The resulting response shows the port list data provided above by the handler > -function in ethdev, placed in a JSON reply by telemetry: > + {"/example_lib/five_ints": [0, 1, 2, 3, 4]} > > -.. code-block:: console > > - {"/ethdev/list": [0, 1]} > +Dictionary Data > +^^^^^^^^^^^^^^^ > + > + For data that needs to be structured in a dictionary with key/value pairs, > + the data utilities API can also be used. For example, some information about > + a brownie recipe is constructed in the callback function shown below: > + > + .. code-block:: c > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_string(d, "Recipe", "Brownies"); > + rte_tel_data_add_dict_int(d, "Prep time (mins)", 25); > + rte_tel_data_add_dict_int(d, "Cooking time (mins)", 30); > + rte_tel_data_add_dict_int(d, "Serves", 16); > + > + The resulting response to the client shows the key/value data provided above > + by the handler function in telemetry, placed in a JSON reply by telemetry:: > + > + {"/example_lib/brownie_recipe": {"Recipe": "Brownies", "Prep time (mins)": 25, > + "Cooking time (mins)": 30, "Serves": 16}} Indent issue in the section and below as well. > + > + > +String Data > +^^^^^^^^^^^ > + > + Telemetry also supports single string data. The data utilities API can again > + be used for this, see the example below. > + > + .. code-block:: c > + > + rte_tel_data_string(d, "This is an example string"); > + > + Giving the following response to the client:: > + > + {"/example_lib/string_example": "This is an example string"} [...] > +Using Commands > +-------------- > + > +To use commands, with a DPDK app running (e.g. testpmd), use the > +dpdk-telemetry.py script. For details on its use, see the :doc:`../howto/telemetry`. script name should be in `` Applied with above changes.