From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0082.outbound.protection.outlook.com [104.47.2.82]) by dpdk.org (Postfix) with ESMTP id B88302C60 for ; Fri, 24 Aug 2018 15:04:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A78VULgajbZwXFb9Wie4IEw6LRqomAFFzdo7+NoqRco=; b=AHAx8MLJbI+Wm4dfD9lZ9kNALWh+s7HbOpfAT30zi2N1uqjeFCi3tMeNaYMAnRUK5EbbT42tjHAsYHkCkECiLSoeehA/qlreYxx8fRv3MbC6bY+kbQwZUnvGunGf/TBZ8wptU9ln2qy6In3Tg9w7iXpAG8DbY5ehk3sBCJ296Nc= Received: from [10.232.14.39] (14.142.187.166) by DB7PR04MB4681.eurprd04.prod.outlook.com (2603:10a6:5:37::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.13; Fri, 24 Aug 2018 13:04:09 +0000 To: Ciara Power , harry.van.haaren@intel.com, brian.archbold@intel.com, emma.kenny@intel.com Cc: dev@dpdk.org References: <1535026093-101872-1-git-send-email-ciara.power@intel.com> <1535026093-101872-2-git-send-email-ciara.power@intel.com> From: Shreyansh Jain Message-ID: Date: Fri, 24 Aug 2018 18:33:43 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1535026093-101872-2-git-send-email-ciara.power@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0012.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::22) To DB7PR04MB4681.eurprd04.prod.outlook.com (2603:10a6:5:37::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0544a93-6e8a-4fb1-9acf-08d609c2155a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4681; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4681; 3:MxcO1K7YMz3y3kePhELbzzkdqadme3x8xAdZDuEXk1WYed3+unVA3StjN0n2HK4m64IR+X0HR5SmxHp1VzIPtw/RRvx/WzmZceOimxhaiajN1T2DCiCMIpyPPTx0rmNWDbBS1cHLVaSOBZv17MWW74TfXCnvKRD5m9hadfzuoy81n8xm8diISinrT78WaPBL8aOWWQ2Q6xUaWpIgvkLRaMw4ZEKvSjRnQ6dlXIqYE5xaqgc8nJlkeRZsX3xIsaro; 25:+wPzyHzFsBGUnFSRvTkh3l4Gm6L1aCX5MQgkl8cFW7B59mj6yv05gqIYAM147aJvoAzia994Jof6hl7RVZtcWVyhXn0bHbRa8DPzLSRBKpYdXUx0BqYohzvk9saeuOxuOM2qoiAxpY1isEifrk35ORuXYtsQtfYyhWvy6vIjR0gPpeYGoCLH5wf7DXwL2Nqe/aVAIVSpSZ6sNJw8tQApJzIBSUcDwjFEN28Mn30EoeXwJJA8pBC4Eg5/8YQ+OpoB5Qspt/U9X8E5jTajUSRPpCQ/8Hh9ahPCQYOsnwLS1ZwH0XBoEHyLz+JnLN6sbm4RxLXMH5pxIB+ODeFYTFovfg==; 31:OiEur9ajraztz5P9JbJcsLuVAdP8PYLATBMjvS+t4mvKEJDpbWsP5Vyyt/aW1MZbyqO9lp7D2IX64Z3fbqJGcVVQgnKbJiAA/a8sNuBpikcISZVUO8vTA/QRdT/ZksvA575lILpOrYGong6D0bKA41h54mfoQ6uZ5UzVk9X5L8YuYDxxmN4alpSqOPAw+dK2y+NmqAxssuAmHh4OlRmINW4KhiBWW8/OueCQyq8P8KA= X-MS-TrafficTypeDiagnostic: DB7PR04MB4681: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4681; 20:BxJTRrem83OGQJIMOj9jiwDw/tkYx6m2HAN3ajw8x0wBK0fE0/i6bWFRxDVtj2bldijik7Mubf4cbPcueCTRWWK1AUUs7lnniCFFUQtwxC6urZFzxrScFJjR508lYrKsJ3zkCPYP3WX7lGyhOmTdgLejHTdGdGXjILV4uyAbZVnZI+fPE6jsxVu4PCbu4xjyGMsU6Dnid8mm/HSiMmNfKTIEVjankb2cbx06edQV3sqPj+hr8K4UsRIuBePz0ngbHb3pGs7f7J5cyoNnWIYjpR2SNZXFH1A09B5J4jpKRPpVXdRP6EV8txyPNqITE4q3PTb8YvJD03ckQgQ+eV88BG5eZcvNm9G0khXM2DirinuJxsMo6mLCjHCV9JDj79vBjADf0d1Bwj8QmLqZibNIPWKhrxiexfIYO7YitZu4eaZNsO9fthVUt5hX5IfOtN9zR/Y5EiThv3m/Uwpi1O8QuM95FsVEk7rXVuRf9Wv6P957HPiHGsZaXhyYxDEYnLIS; 4:6StWb/VZHP2clmcaIaJyHwjXjbLTKECMvwDIPZCscOcuxLem55DsqU/U0FSRMfk03PvBUVD4TEqZd8F/vKljjhOm3drr2rqmFBm4vbEJTO0dtVJLt+TzGmCle4WySPuYcSXq4Ab7XStlZl647RPBN77nY0Wwb4zWp+jG2LhFtVsg8xuxKGmPPua02uvxo0DzbnV2qccVz2P2ZPpzFrIT0f8UkMQ+E7219GpQNMwwJ+Fs7E7q+qUZCu6j3zZ40ZNdA6iDHZlzsuzbUTlhN6D+GMx9VrBVnFm0U1Ifakf7xrsylg+gDo/kBfPdBAbo0lBn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4681; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4681; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(396003)(136003)(39860400002)(376002)(366004)(346002)(189003)(199004)(446003)(14444005)(86362001)(575784001)(23676004)(52146003)(956004)(16526019)(476003)(52116002)(11346002)(8936002)(229853002)(186003)(2486003)(2616005)(316002)(5660300001)(6346003)(16576012)(53936002)(3846002)(76176011)(58126008)(44832011)(97736004)(25786009)(6486002)(6246003)(64126003)(6116002)(230700001)(26005)(31696002)(4326008)(5009440100003)(77096007)(486006)(386003)(50466002)(7736002)(66066001)(2906002)(305945005)(31686004)(105586002)(68736007)(65956001)(65806001)(67846002)(106356001)(65826007)(81166006)(6666003)(8676002)(47776003)(478600001)(36756003)(81156014)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4681; H:[10.232.14.39]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA0TUI0NjgxOzIzOkRDWE5USk5wUGV0ckhCeWJxZ3lydEdFbnJE?= =?utf-8?B?UTRqUjE3ZTVsVFM4U0pPRW55TWM1K0RXaFRtVHJ4YjI2cGdNdWxpSmluWmVQ?= =?utf-8?B?NitSVzVyWlFPYmZWeVRYUm9vaVUzVlZrUlJmQmlQVzROVkFwYTUybm9aM2Qx?= =?utf-8?B?K3haYVhyYkMzOUI4OGt3TG5SZkxDb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Xd5cjZJQ0lSSlJLMUhLUGdOeG92NE5GNVF0RzNPaDFZ?= =?utf-8?Q?iENxq3xb4b/H3XwCdsomvNv2v?= X-Microsoft-Antispam-Message-Info: 5w3FlkCUTMwLSaZS04x+4XwbdwXyv05whZbMbPU/xJ1xSmdpyk9Ma/wRtnTkyxnIs5G/OdJeGNwXTKxL0nCnLIci3euTeqUr2vnPC0DMYerTUEHVEn2SnYVdwAEWSC2kynbZrovO7q60iIULvhejtefFFWDTGco812ZChbXjkdpz+5Lfftlg58vMguT9openHcbggjZv1zq3H6buxgjZtWTT7fUvUVQOavWiVwahFlEkpFQeD5/F32c5mTanvwDT/szZKRXTuRR/ok66G3acfIKtQqw/igoBmE06ByT6VJJAnrzsL9JZddVGLuh+3rsZA5/L24OHOkP6iYao9RBzX9zAh/8qWEz2FsyTLLD+90c= X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4681; 6:wttOCU1fUyom85kbEWRLwBQDTwO7aUhgpzbmSWjM8L04vS3XhHEdWmiMJ8qcd8GFrboenPT9k+3awddq9HLaltR+aXS1y8DZk89IsaredntISskGx+HBOVBQ9KDi0ZMoc0A+R4po7v8xvtUG4DPzW59tprALg3X6vlWTb9UmJRpmGSZNu3SHPFIBX3NHB/WvfCi0DA9B68NJvo2b5VJOomGDPYAYLEBzmVnjXQ+HD177JMFKNiUTldMZhwrOzgxbScAY8ZUBfCuNL/c5Jz9gwfZ44hcLpZunSp1OmSgcuxuuvkRGYdedL9LacKTouxwazv/gg2bRXnXW3yB8OpuKJAbNjT8gPPq26KsAfpI6qYDWavrCyCZqScwLpbphyqzijgB4Kvf3XGzGK7Bi4XbqkjrGsz6B2I2roZsBcT6/5WzOhQcCFFhSjySH0PDeo3jbYV1nXsDXSXugJL00oe3fGg==; 5:jKTcI1ENAP6rDvM4Z7OzoQ9ezc7JycDSai3uQBHRtmAedWh7y+rLBN1O6WATlQ15NhcmSdkAPUBsHmTz6LBrZKjV8IZxBOpq4bJGJo0W29PeB0aMZbyHFI3YEuVHJnBqJ4dIuPHPWJChgT0jsUZ2I15kevZLADQHNkkc0h9oCls=; 7:Cws93vUT01Wjetpw14hEKJl2zYRZXADIKtayWfFb4rkiM9KCifVTiOWifoJ1J1ktPLlAcu8i3c+rxjNkK8RUMU5GW/dDAh2F7+pnOoMqK7co4FmhP8EJpr8j08a5gc2rWDlrXBYa3fPbzfx2zIcvLKY7kqUVbOURDQQLEGsixb+J9wCxGDKpcyucpPxWC+Lfj4IuGKWOZGNcB0o6/HY3GA1J4y0/1a281SV7t7lMK9IyfQ3eJeCqdeQcJhc0rIj1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 13:04:09.3860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0544a93-6e8a-4fb1-9acf-08d609c2155a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4681 Subject: Re: [dpdk-dev] [PATCH 01/11] telemetry: initial telemetry infrastructure 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: , X-List-Received-Date: Fri, 24 Aug 2018 13:04:11 -0000 On Thursday 23 August 2018 05:38 PM, Ciara Power wrote: > This patch adds the infrastructure and initial code for the > telemetry library. > > A virtual device is used for telemetry, which is included in > this patch. To use telemetry, a command-line argument must be > used - "--vdev=telemetry". > > Control threads are used to get CPU cycles for telemetry, which > are configured in this patch also. > > Signed-off-by: Ciara Power > Signed-off-by: Brian Archbold > --- [...] /rte_pmd_telemetry_version.map > new file mode 100644 > index 0000000..a73e0f2 > --- /dev/null > +++ b/drivers/telemetry/telemetry/rte_pmd_telemetry_version.map > @@ -0,0 +1,9 @@ > +DPDK_18.05 { ^^^^^ I think you want 18.11 here. > + global: > + > + telemetry_probe; > + telemetry_remove; > + > + local: *; > + > +}; [...] > diff --git a/lib/Makefile b/lib/Makefile > index afa604e..8cbd035 100644 > --- a/lib/Makefile > +++ b/lib/Makefile > @@ -105,6 +105,8 @@ DEPDIRS-librte_gso := librte_eal librte_mbuf librte_ethdev librte_net > DEPDIRS-librte_gso += librte_mempool > DIRS-$(CONFIG_RTE_LIBRTE_BPF) += librte_bpf > DEPDIRS-librte_bpf := librte_eal librte_mempool librte_mbuf librte_ethdev > +DIRS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += librte_telemetry > +DEPDIRS-librte_telemetry := librte_eal librte_metrics librte_ethdev > > ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) > DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni > diff --git a/lib/librte_telemetry/Makefile b/lib/librte_telemetry/Makefile > new file mode 100644 > index 0000000..bda3788 > --- /dev/null > +++ b/lib/librte_telemetry/Makefile > @@ -0,0 +1,26 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2018 Intel Corporation > + > +include $(RTE_SDK)/mk/rte.vars.mk > + > +# library name > +LIB = librte_telemetry.a > + > +CFLAGS += -O3 > +CFLAGS += -I$(SRCDIR) > +CFLAGS += -DALLOW_EXPERIMENTAL_API > + > +LDLIBS += -lrte_eal -lrte_ethdev > +LDLIBS += -lrte_metrics > + > +EXPORT_MAP := rte_telemetry_version.map > + > +LIBABIVER := 1 > + > +# library source files > +SRCS-$(CONFIG_RTE_LIBRTE_TELEMETRY) := rte_telemetry.c > + > +# export include files > +SYMLINK-$(CONFIG_RTE_LIBRTE_TELEMETRY)-include := rte_telemetry.h > + > +include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/lib/librte_telemetry/meson.build b/lib/librte_telemetry/meson.build > new file mode 100644 > index 0000000..7716076 > --- /dev/null > +++ b/lib/librte_telemetry/meson.build > @@ -0,0 +1,7 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2018 Intel Corporation > + > +sources = files('rte_telemetry.c') > +headers = files('rte_telemetry.h', 'rte_telemetry_internal.h') > +deps += ['metrics', 'ethdev'] > +cflags += '-DALLOW_EXPERIMENTAL_API' > diff --git a/lib/librte_telemetry/rte_telemetry.c b/lib/librte_telemetry/rte_telemetry.c > new file mode 100644 > index 0000000..8d7b0e3 > --- /dev/null > +++ b/lib/librte_telemetry/rte_telemetry.c > @@ -0,0 +1,108 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2018 Intel Corporation > + */ > + > +#include > + > +#include > +#include > +#include > + > +#include "rte_telemetry.h" > +#include "rte_telemetry_internal.h" > + > +#define SLEEP_TIME 10 > + > +static telemetry_impl *static_telemetry; > + > +static int32_t > +rte_telemetry_run(void *userdata) > +{ > + struct telemetry_impl *telemetry = (struct telemetry_impl *)userdata; > + if (!telemetry) { > + TELEMETRY_LOG_WARN("Warning - TELEMETRY could not be " > + "initialised\n"); Your 'TELEMETRY_LOG_WARNING' already includes a '\n' in its definition. This would add another one. Can you re-check? > + return -1; > + } > + > + return 0; > +} > + > +static void > +*rte_telemetry_run_thread_func(void *userdata) > +{ > + int ret; > + struct telemetry_impl *telemetry = (struct telemetry_impl *)userdata; > + > + if (!telemetry) { > + TELEMETRY_LOG_ERR("Error - %s passed a NULL instance\n", > + __func__); I might be picky - but this is an internal function spawned using rte_ctrl_thread_create which already has a check whether the argument (static_telemetry) is NULL or not. So, this is like duplicating that work. > + pthread_exit(0); > + } > + > + while (telemetry->thread_status) { > + rte_telemetry_run(telemetry); > + ret = usleep(SLEEP_TIME); > + if (ret < 0) > + TELEMETRY_LOG_ERR("Error - Calling thread could not be" > + " put to sleep\n"); If the calling thread couldn't be put to sleep, you would continue looping without sleeping? Wouldn't that simply hog your CPU? Or, is that expected design? > + } > + pthread_exit(0); > +} > + > +int32_t > +rte_telemetry_init(uint32_t socket_id) > +{ > + int ret; > + pthread_attr_t attr; > + const char *telemetry_ctrl_thread = "telemetry"; > + > + if (static_telemetry) { > + TELEMETRY_LOG_WARN("Warning - TELEMETRY structure already " > + "initialised\n"); > + return -EALREADY; > + } > + > + static_telemetry = calloc(1, sizeof(struct telemetry_impl)); > + if (!static_telemetry) { > + TELEMETRY_LOG_ERR("Error - Memory could not be allocated\n"); > + return -ENOMEM; > + } > + > + static_telemetry->socket_id = socket_id; > + rte_metrics_init(static_telemetry->socket_id); > + pthread_attr_init(&attr); > + ret = rte_ctrl_thread_create(&static_telemetry->thread_id, > + telemetry_ctrl_thread, &attr, rte_telemetry_run_thread_func, > + (void *)static_telemetry); > + static_telemetry->thread_status = 1; > + if (ret < 0) { > + ret = rte_telemetry_cleanup(); > + if (ret < 0) > + TELEMETRY_LOG_ERR("Error - TELEMETRY cleanup failed\n"); > + return -EPERM; > + } > + return 0; > +} > + > +int32_t > +rte_telemetry_cleanup(void) > +{ > + struct telemetry_impl *telemetry = static_telemetry; > + telemetry->thread_status = 0; > + pthread_join(telemetry->thread_id, NULL); > + free(telemetry); > + static_telemetry = NULL; > + return 0; Maybe if you could use be a little more liberal with new lines, it would be slightly easier to read. But again, that is my personal opinion. > +} > + > +int telemetry_log_level; > +RTE_INIT(rte_telemetry_log_init); > + > +static void > +rte_telemetry_log_init(void) > +{ > + telemetry_log_level = rte_log_register("lib.telemetry"); > + if (telemetry_log_level >= 0) > + rte_log_set_level(telemetry_log_level, RTE_LOG_ERR); > +} [...] > +#endif > diff --git a/lib/librte_telemetry/rte_telemetry_version.map b/lib/librte_telemetry/rte_telemetry_version.map > new file mode 100644 > index 0000000..efd437d > --- /dev/null > +++ b/lib/librte_telemetry/rte_telemetry_version.map > @@ -0,0 +1,6 @@ > +DPDK_18.05 { ^^^^^^ I think you want it to be 18.11 here. > + global: > + > + rte_telemetry_init; > + local: *; > +}; [...]