From patchwork Thu Feb 9 09:43:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 123565 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7E1F41C4D; Thu, 9 Feb 2023 10:45:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FC8C42D0B; Thu, 9 Feb 2023 10:44:11 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 747F042D0B for ; Thu, 9 Feb 2023 10:44:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675935849; 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=wYbEJiWqzoGPZ5F+yBXqlNoapczKw0hL3U45VBFvU78=; b=I0CRRGeNXZBGk2mZnScCL/K38l8SugqHb67j3YcC0CVaZFQUIZ1yKQoiYXF6/sg7o8smpQ M/wRcZXCtjmJJ57JgGE5Dlpdz5Ow7hOUrMPi1omX/2I/QMsyYjsrlf+QUetl4SoBfNiUeo YpF8L7g9Gq/Lxc4CRqBInmQfcB4kC0Q= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-keuEl27CPYWHO-2UD0swvg-1; Thu, 09 Feb 2023 04:44:07 -0500 X-MC-Unique: keuEl27CPYWHO-2UD0swvg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A61C38173C5; Thu, 9 Feb 2023 09:44:07 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00BA8C16022; Thu, 9 Feb 2023 09:44:05 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Robin Jarry , =?utf-8?q?Morten_Br=C3=B8rup?= , Kevin Laatz Subject: [PATCH v10 1/5] eal: add lcore info in telemetry Date: Thu, 9 Feb 2023 10:43:50 +0100 Message-Id: <20230209094354.1377424-2-rjarry@redhat.com> In-Reply-To: <20230209094354.1377424-1-rjarry@redhat.com> References: <20221123102612.1688865-1-rjarry@redhat.com> <20230209094354.1377424-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Report the same information than rte_lcore_dump() in the telemetry API into /eal/lcore/list and /eal/lcore/info,ID. Example: --> /eal/lcore/info,3 { "/eal/lcore/info": { "lcore_id": 3, "socket": 0, "role": "RTE", "cpuset": [ 3 ] } } Signed-off-by: Robin Jarry Acked-by: Morten Brørup Reviewed-by: Kevin Laatz --- Notes: v9 -> v10: s/info->lcore_id != lcore_id/lcore_id != info->lcore_id/ lib/eal/common/eal_common_lcore.c | 126 +++++++++++++++++++++++++----- 1 file changed, 108 insertions(+), 18 deletions(-) diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c index 06c594b0224f..d45a40831393 100644 --- a/lib/eal/common/eal_common_lcore.c +++ b/lib/eal/common/eal_common_lcore.c @@ -10,6 +10,9 @@ #include #include #include +#ifndef RTE_EXEC_ENV_WINDOWS +#include +#endif #include "eal_private.h" #include "eal_thread.h" @@ -419,35 +422,35 @@ rte_lcore_iterate(rte_lcore_iterate_cb cb, void *arg) return ret; } +static const char * +lcore_role_str(enum rte_lcore_role_t role) +{ + switch (role) { + case ROLE_RTE: + return "RTE"; + case ROLE_SERVICE: + return "SERVICE"; + case ROLE_NON_EAL: + return "NON_EAL"; + default: + return "UNKNOWN"; + } +} + static int lcore_dump_cb(unsigned int lcore_id, void *arg) { struct rte_config *cfg = rte_eal_get_configuration(); char cpuset[RTE_CPU_AFFINITY_STR_LEN]; - const char *role; FILE *f = arg; int ret; - switch (cfg->lcore_role[lcore_id]) { - case ROLE_RTE: - role = "RTE"; - break; - case ROLE_SERVICE: - role = "SERVICE"; - break; - case ROLE_NON_EAL: - role = "NON_EAL"; - break; - default: - role = "UNKNOWN"; - break; - } - ret = eal_thread_dump_affinity(&lcore_config[lcore_id].cpuset, cpuset, sizeof(cpuset)); fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s\n", lcore_id, - rte_lcore_to_socket_id(lcore_id), role, cpuset, - ret == 0 ? "" : "..."); + rte_lcore_to_socket_id(lcore_id), + lcore_role_str(cfg->lcore_role[lcore_id]), + cpuset, ret == 0 ? "" : "..."); return 0; } @@ -456,3 +459,90 @@ rte_lcore_dump(FILE *f) { rte_lcore_iterate(lcore_dump_cb, f); } + +#ifndef RTE_EXEC_ENV_WINDOWS +static int +lcore_telemetry_id_cb(unsigned int lcore_id, void *arg) +{ + struct rte_tel_data *d = arg; + return rte_tel_data_add_array_int(d, lcore_id); +} + +static int +handle_lcore_list(const char *cmd __rte_unused, + const char *params __rte_unused, + struct rte_tel_data *d) +{ + int ret; + + ret = rte_tel_data_start_array(d, RTE_TEL_INT_VAL); + if (ret == 0) + ret = rte_lcore_iterate(lcore_telemetry_id_cb, d); + + return ret; +} + +struct lcore_telemetry_info { + unsigned int lcore_id; + struct rte_tel_data *d; +}; + +static int +lcore_telemetry_info_cb(unsigned int lcore_id, void *arg) +{ + struct rte_config *cfg = rte_eal_get_configuration(); + struct lcore_telemetry_info *info = arg; + struct rte_tel_data *cpuset; + unsigned int cpu; + + if (lcore_id != info->lcore_id) + return 0; + + rte_tel_data_start_dict(info->d); + rte_tel_data_add_dict_int(info->d, "lcore_id", lcore_id); + rte_tel_data_add_dict_int(info->d, "socket", rte_lcore_to_socket_id(lcore_id)); + rte_tel_data_add_dict_string(info->d, "role", lcore_role_str(cfg->lcore_role[lcore_id])); + cpuset = rte_tel_data_alloc(); + if (cpuset == NULL) + return -ENOMEM; + rte_tel_data_start_array(cpuset, RTE_TEL_INT_VAL); + for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { + if (CPU_ISSET(cpu, &lcore_config[lcore_id].cpuset)) + rte_tel_data_add_array_int(cpuset, cpu); + } + rte_tel_data_add_dict_container(info->d, "cpuset", cpuset, 0); + + return 0; +} + +static int +handle_lcore_info(const char *cmd __rte_unused, const char *params, struct rte_tel_data *d) +{ + struct lcore_telemetry_info info = { .d = d }; + unsigned long lcore_id; + char *endptr; + + if (params == NULL) + return -EINVAL; + errno = 0; + lcore_id = strtoul(params, &endptr, 10); + if (errno) + return -errno; + if (*params == '\0' || *endptr != '\0' || lcore_id >= RTE_MAX_LCORE) + return -EINVAL; + + info.lcore_id = lcore_id; + + return rte_lcore_iterate(lcore_telemetry_info_cb, &info); +} + +RTE_INIT(lcore_telemetry) +{ + rte_telemetry_register_cmd( + "/eal/lcore/list", handle_lcore_list, + "List of lcore ids. Takes no parameters"); + rte_telemetry_register_cmd( + "/eal/lcore/info", handle_lcore_info, + "Returns lcore info. Parameters: int lcore_id"); +} +#endif /* !RTE_EXEC_ENV_WINDOWS */ From patchwork Thu Feb 9 09:43:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 123566 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3777441C4D; Thu, 9 Feb 2023 10:45:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D4C942D12; Thu, 9 Feb 2023 10:44:14 +0100 (CET) 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 AF1F842D1D for ; Thu, 9 Feb 2023 10:44:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675935852; 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=c4u31Nhuyrq78u8mimRYk4taYS9zFQlkvqF4I8UHpSs=; b=Cz2WMS1/A2hmg8mSn4JOtEI+hba56yOJGjtMFDsjb/B1mV3mn249nyZ0Bpj091SXqI4w6R RY940sT5csncq69M4oWAbW/MVte9sctmf0sdrDJrbFqT9D+OjyX9MgQP3Df3rsKJH1zRhD xhsMC0tStGAiRXS3vN0plSN4/RYDzmw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-rRc5G77gOHS5MUnJV0N6KA-1; Thu, 09 Feb 2023 04:44:08 -0500 X-MC-Unique: rRc5G77gOHS5MUnJV0N6KA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 95E4038173C5; Thu, 9 Feb 2023 09:44:08 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93592C16022; Thu, 9 Feb 2023 09:44:07 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Robin Jarry , =?utf-8?q?Morten_Br=C3=B8rup?= , Kevin Laatz Subject: [PATCH v10 2/5] eal: report applications lcore usage Date: Thu, 9 Feb 2023 10:43:51 +0100 Message-Id: <20230209094354.1377424-3-rjarry@redhat.com> In-Reply-To: <20230209094354.1377424-1-rjarry@redhat.com> References: <20221123102612.1688865-1-rjarry@redhat.com> <20230209094354.1377424-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Allow applications to register a callback that will be invoked in rte_lcore_dump() and when requesting lcore info in the telemetry API. The callback is expected to return the number of TSC cycles that have passed since application start and the number of these cycles that were spent doing busy work. Signed-off-by: Robin Jarry Acked-by: Morten Brørup Reviewed-by: Kevin Laatz --- Notes: v9 -> v10: no change doc/guides/rel_notes/release_23_03.rst | 7 ++++ lib/eal/common/eal_common_lcore.c | 40 +++++++++++++++++++-- lib/eal/include/rte_lcore.h | 48 ++++++++++++++++++++++++++ lib/eal/version.map | 1 + 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst index 1fa101c420cd..17d38d5ea264 100644 --- a/doc/guides/rel_notes/release_23_03.rst +++ b/doc/guides/rel_notes/release_23_03.rst @@ -55,6 +55,13 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added support for reporting lcore usage in applications.** + + * The ``/eal/lcore/list`` and ``/eal/lcore/info`` telemetry endpoints have + been added to provide information similar to ``rte_lcore_dump()``. + * Applications can register a callback at startup via + ``rte_lcore_register_usage_cb()`` to provide lcore usage information. + * **Updated AMD axgbe driver.** * Added multi-process support. diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c index d45a40831393..8fcdebd87692 100644 --- a/lib/eal/common/eal_common_lcore.c +++ b/lib/eal/common/eal_common_lcore.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include #include #include @@ -437,20 +438,45 @@ lcore_role_str(enum rte_lcore_role_t role) } } +static rte_lcore_usage_cb lcore_usage_cb; + +void +rte_lcore_register_usage_cb(rte_lcore_usage_cb cb) +{ + lcore_usage_cb = cb; +} + static int lcore_dump_cb(unsigned int lcore_id, void *arg) { struct rte_config *cfg = rte_eal_get_configuration(); char cpuset[RTE_CPU_AFFINITY_STR_LEN]; + struct rte_lcore_usage usage; + rte_lcore_usage_cb usage_cb; + char *usage_str = NULL; FILE *f = arg; int ret; + /* The callback may not set all the fields in the structure, so clear it here. */ + memset(&usage, 0, sizeof(usage)); + /* Guard against concurrent modification of lcore_usage_cb. */ + usage_cb = lcore_usage_cb; + if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) { + if (asprintf(&usage_str, ", busy cycles %"PRIu64"/%"PRIu64, + usage.busy_cycles, usage.total_cycles) < 0) { + return -ENOMEM; + } + } ret = eal_thread_dump_affinity(&lcore_config[lcore_id].cpuset, cpuset, sizeof(cpuset)); - fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s\n", lcore_id, + fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s%s\n", lcore_id, rte_lcore_to_socket_id(lcore_id), lcore_role_str(cfg->lcore_role[lcore_id]), - cpuset, ret == 0 ? "" : "..."); + cpuset, ret == 0 ? "" : "...", + usage_str != NULL ? usage_str : ""); + + free(usage_str); + return 0; } @@ -492,7 +518,9 @@ lcore_telemetry_info_cb(unsigned int lcore_id, void *arg) { struct rte_config *cfg = rte_eal_get_configuration(); struct lcore_telemetry_info *info = arg; + struct rte_lcore_usage usage; struct rte_tel_data *cpuset; + rte_lcore_usage_cb usage_cb; unsigned int cpu; if (lcore_id != info->lcore_id) @@ -511,6 +539,14 @@ lcore_telemetry_info_cb(unsigned int lcore_id, void *arg) rte_tel_data_add_array_int(cpuset, cpu); } rte_tel_data_add_dict_container(info->d, "cpuset", cpuset, 0); + /* The callback may not set all the fields in the structure, so clear it here. */ + memset(&usage, 0, sizeof(usage)); + /* Guard against concurrent modification of lcore_usage_cb. */ + usage_cb = lcore_usage_cb; + if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) { + rte_tel_data_add_dict_uint(info->d, "total_cycles", usage.total_cycles); + rte_tel_data_add_dict_uint(info->d, "busy_cycles", usage.busy_cycles); + } return 0; } diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h index 9c7865052100..30f83f4d578c 100644 --- a/lib/eal/include/rte_lcore.h +++ b/lib/eal/include/rte_lcore.h @@ -328,6 +328,54 @@ typedef int (*rte_lcore_iterate_cb)(unsigned int lcore_id, void *arg); int rte_lcore_iterate(rte_lcore_iterate_cb cb, void *arg); +/** + * lcore usage statistics. + */ +struct rte_lcore_usage { + /** + * The total amount of time that the application has been running on + * this lcore, in TSC cycles. + */ + uint64_t total_cycles; + /** + * The amount of time the application was busy, handling some + * workload on this lcore, in TSC cycles. + */ + uint64_t busy_cycles; +}; + +/** + * Callback to allow applications to report lcore usage. + * + * @param [in] lcore_id + * The lcore to consider. + * @param [out] usage + * Counters representing this lcore usage. This can never be NULL. + * @return + * - 0 if fields in usage were updated successfully. The fields that the + * application does not support must not be modified. + * - a negative value if the information is not available or if any error occurred. + */ +typedef int (*rte_lcore_usage_cb)(unsigned int lcore_id, struct rte_lcore_usage *usage); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Register a callback from an application to be called in rte_lcore_dump() and + * the /eal/lcore/info telemetry endpoint handler. Applications are expected to + * report lcore usage statistics via this callback. + * + * If a callback was already registered, it can be replaced with another callback + * or unregistered with NULL. The previously registered callback may remain in + * use for an undetermined period of time. + * + * @param cb + * The callback function. + */ +__rte_experimental +void rte_lcore_register_usage_cb(rte_lcore_usage_cb cb); + /** * List all lcores. * diff --git a/lib/eal/version.map b/lib/eal/version.map index 6523102157e2..2c05e5f2fb60 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -441,6 +441,7 @@ EXPERIMENTAL { rte_thread_join; # added in 23.03 + rte_lcore_register_usage_cb; rte_thread_set_name; }; From patchwork Thu Feb 9 09:43:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 123568 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0916441C4D; Thu, 9 Feb 2023 10:46:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B68F442D39; Thu, 9 Feb 2023 10:44:18 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 28B2A42B71 for ; Thu, 9 Feb 2023 10:44:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675935856; 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=VP2DvNo5i5u4UK1Zue1jhF1d0gjuNvyYqg7AUgdw880=; b=TGM+ZLgRE9/JJkxEZ43oVtPb0uX5nw+NZPzcHfkODHFMYeIPsAGsuqVLmLlzi6PNzDnI3c ae0FwU25qB72uYTqmUOhZG10plr52nGsGHs2JotJAWHIIDD2KajYS7TooBObVstChO0CN8 hzEeSf2mUme3l2ipw+glcUdT4+BRVhs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-85-Yosw_qAgMDqiJBWEZFnMpg-1; Thu, 09 Feb 2023 04:44:11 -0500 X-MC-Unique: Yosw_qAgMDqiJBWEZFnMpg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9DC0038173C5; Thu, 9 Feb 2023 09:44:10 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3358AC16022; Thu, 9 Feb 2023 09:44:09 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Robin Jarry , =?utf-8?q?Morten_Br=C3=B8rup?= , Konstantin Ananyev , Kevin Laatz , Aman Singh , Yuying Zhang Subject: [PATCH v10 3/5] app/testpmd: add dump command for lcores Date: Thu, 9 Feb 2023 10:43:52 +0100 Message-Id: <20230209094354.1377424-4-rjarry@redhat.com> In-Reply-To: <20230209094354.1377424-1-rjarry@redhat.com> References: <20221123102612.1688865-1-rjarry@redhat.com> <20230209094354.1377424-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Add a simple command that calls rte_lcore_dump(). Signed-off-by: Robin Jarry Acked-by: Morten Brørup Acked-by: Konstantin Ananyev Reviewed-by: Kevin Laatz --- Notes: v9 -> v10: no change app/test-pmd/cmdline.c | 3 +++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index cb8c174020b0..bb7ff2b44989 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -8357,6 +8357,8 @@ static void cmd_dump_parsed(void *parsed_result, rte_mempool_list_dump(stdout); else if (!strcmp(res->dump, "dump_devargs")) rte_devargs_dump(stdout); + else if (!strcmp(res->dump, "dump_lcores")) + rte_lcore_dump(stdout); else if (!strcmp(res->dump, "dump_log_types")) rte_log_dump(stdout); } @@ -8370,6 +8372,7 @@ static cmdline_parse_token_string_t cmd_dump_dump = "dump_ring#" "dump_mempool#" "dump_devargs#" + "dump_lcores#" "dump_log_types"); static cmdline_parse_inst_t cmd_dump = { diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 79a1fa9cb73d..9ceb21dfbbdf 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -591,6 +591,13 @@ Dumps the user device list:: testpmd> dump_devargs +dump lcores +~~~~~~~~~~~ + +Dumps the logical cores list:: + + testpmd> dump_lcores + dump log types ~~~~~~~~~~~~~~ From patchwork Thu Feb 9 09:43:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 123569 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B8D1841C4D; Thu, 9 Feb 2023 10:46:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 293D942DAD; Thu, 9 Feb 2023 10:44:20 +0100 (CET) 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 EB04742D55 for ; Thu, 9 Feb 2023 10:44:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675935857; 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=rfBhjH2vqbgipHLn3QR60QjTI6/lozoR+QGkHbXHmZk=; b=XwEzn7i51HipdVFTVJM/005MwjavLRvti8/duRraZ+63sOuT37vmEjLmkwIpZr3uK1rEsT c9LtEW/vsLmIOVmSvxHsTCejBEvwk/iFkvluXIIWue/230ru+nB9XsFXx6aXhejs1t2i8k hJbP+ABU3F9dsBK2AUVAWAYdUOUlVrc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-482-2xkfGSWfOFaJeLzWFwXM8w-1; Thu, 09 Feb 2023 04:44:13 -0500 X-MC-Unique: 2xkfGSWfOFaJeLzWFwXM8w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE5271C426AC; Thu, 9 Feb 2023 09:44:12 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2208FC16022; Thu, 9 Feb 2023 09:44:10 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Robin Jarry , =?utf-8?q?Morten_Br=C3=B8rup?= , Konstantin Ananyev , Kevin Laatz , Aman Singh , Yuying Zhang Subject: [PATCH v10 4/5] app/testpmd: report lcore usage Date: Thu, 9 Feb 2023 10:43:53 +0100 Message-Id: <20230209094354.1377424-5-rjarry@redhat.com> In-Reply-To: <20230209094354.1377424-1-rjarry@redhat.com> References: <20221123102612.1688865-1-rjarry@redhat.com> <20230209094354.1377424-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 The --record-core-cycles option already accounts for busy cycles. One turn of packet_fwd_t is considered "busy" if there was at least one received or transmitted packet. Rename core_cycles to busy_cycles in struct fwd_stream to make it more explicit. Add total_cycles to struct fwd_lcore. Add cycles accounting in noisy_vnf where it was missing. When --record-core-cycles is specified, register a callback with rte_lcore_register_usage_cb() and update total_cycles every turn of lcore loop based on a starting tsc value. In the callback, resolve the proper struct fwd_lcore based on lcore_id and return the lcore total_cycles and the sum of busy_cycles of all its fwd_streams. This makes the cycles counters available in rte_lcore_dump() and the lcore telemetry API: testpmd> dump_lcores lcore 3, socket 0, role RTE, cpuset 3 lcore 4, socket 0, role RTE, cpuset 4, busy cycles 1228584096/9239923140 lcore 5, socket 0, role RTE, cpuset 5, busy cycles 1255661768/9218141538 --> /eal/lcore/info,4 { "/eal/lcore/info": { "lcore_id": 4, "socket": 0, "role": "RTE", "cpuset": [ 4 ], "busy_cycles": 10623340318, "total_cycles": 55331167354 } } Signed-off-by: Robin Jarry Acked-by: Morten Brørup Acked-by: Konstantin Ananyev Reviewed-by: Kevin Laatz --- Notes: v9 -> v10: Fixed reset of total_cycles without stopping app/test-pmd/noisy_vnf.c | 8 +++++++- app/test-pmd/testpmd.c | 44 +++++++++++++++++++++++++++++++++++++--- app/test-pmd/testpmd.h | 25 +++++++++++++++-------- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c index c65ec6f06a5c..ce5a3e5e6987 100644 --- a/app/test-pmd/noisy_vnf.c +++ b/app/test-pmd/noisy_vnf.c @@ -144,6 +144,7 @@ pkt_burst_noisy_vnf(struct fwd_stream *fs) struct noisy_config *ncf = noisy_cfg[fs->rx_port]; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_mbuf *tmp_pkts[MAX_PKT_BURST]; + uint64_t start_tsc = 0; uint16_t nb_deqd = 0; uint16_t nb_rx = 0; uint16_t nb_tx = 0; @@ -153,6 +154,8 @@ pkt_burst_noisy_vnf(struct fwd_stream *fs) bool needs_flush = false; uint64_t now; + get_start_cycles(&start_tsc); + nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst, nb_pkt_per_burst); inc_rx_burst_stats(fs, nb_rx); @@ -169,7 +172,7 @@ pkt_burst_noisy_vnf(struct fwd_stream *fs) inc_tx_burst_stats(fs, nb_tx); fs->tx_packets += nb_tx; fs->fwd_dropped += drop_pkts(pkts_burst, nb_rx, nb_tx); - return; + goto end; } fifo_free = rte_ring_free_count(ncf->f); @@ -219,6 +222,9 @@ pkt_burst_noisy_vnf(struct fwd_stream *fs) fs->fwd_dropped += drop_pkts(tmp_pkts, nb_deqd, sent); ncf->prev_time = rte_get_timer_cycles(); } +end: + if (nb_rx > 0 || nb_tx > 0) + get_end_cycles(fs, start_tsc); } #define NOISY_STRSIZE 256 diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e366f81a0f46..d02f96df7570 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2053,7 +2053,7 @@ fwd_stats_display(void) fs->rx_bad_outer_ip_csum; if (record_core_cycles) - fwd_cycles += fs->core_cycles; + fwd_cycles += fs->busy_cycles; } for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) { pt_id = fwd_ports_ids[i]; @@ -2145,7 +2145,7 @@ fwd_stats_display(void) else total_pkts = total_recv; - printf("\n CPU cycles/packet=%.2F (total cycles=" + printf("\n CPU cycles/packet=%.2F (busy cycles=" "%"PRIu64" / total %s packets=%"PRIu64") at %"PRIu64 " MHz Clock\n", (double) fwd_cycles / total_pkts, @@ -2184,8 +2184,10 @@ fwd_stats_reset(void) memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats)); memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats)); - fs->core_cycles = 0; + fs->busy_cycles = 0; } + for (i = 0; i < cur_fwd_config.nb_fwd_lcores; i++) + fwd_lcores[i]->total_cycles = 0; } static void @@ -2248,6 +2250,7 @@ static void run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd) { struct fwd_stream **fsm; + uint64_t prev_tsc; streamid_t nb_fs; streamid_t sm_id; #ifdef RTE_LIB_BITRATESTATS @@ -2262,6 +2265,7 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd) #endif fsm = &fwd_streams[fc->stream_idx]; nb_fs = fc->stream_nb; + prev_tsc = rte_rdtsc(); do { for (sm_id = 0; sm_id < nb_fs; sm_id++) if (!fsm[sm_id]->disabled) @@ -2284,10 +2288,40 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd) latencystats_lcore_id == rte_lcore_id()) rte_latencystats_update(); #endif + if (record_core_cycles) { + uint64_t tsc = rte_rdtsc(); + fc->total_cycles += tsc - prev_tsc; + prev_tsc = tsc; + } } while (! fc->stopped); } +static int +lcore_usage_callback(unsigned int lcore_id, struct rte_lcore_usage *usage) +{ + struct fwd_stream **fsm; + struct fwd_lcore *fc; + streamid_t nb_fs; + streamid_t sm_id; + + fc = lcore_to_fwd_lcore(lcore_id); + if (fc == NULL) + return -1; + + fsm = &fwd_streams[fc->stream_idx]; + nb_fs = fc->stream_nb; + usage->busy_cycles = 0; + usage->total_cycles = fc->total_cycles; + + for (sm_id = 0; sm_id < nb_fs; sm_id++) { + if (!fsm[sm_id]->disabled) + usage->busy_cycles += fsm[sm_id]->busy_cycles; + } + + return 0; +} + static int start_pkt_forward_on_core(void *fwd_arg) { @@ -4527,6 +4561,10 @@ main(int argc, char** argv) rte_stats_bitrate_reg(bitrate_data); } #endif + + if (record_core_cycles) + rte_lcore_register_usage_cb(lcore_usage_callback); + #ifdef RTE_LIB_CMDLINE if (init_cmdline() != 0) rte_exit(EXIT_FAILURE, diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 7d24d25970d2..6ec2f6879b47 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -174,7 +174,7 @@ struct fwd_stream { #ifdef RTE_LIB_GRO unsigned int gro_times; /**< GRO operation times */ #endif - uint64_t core_cycles; /**< used for RX and TX processing */ + uint64_t busy_cycles; /**< used with --record-core-cycles */ struct pkt_burst_stats rx_burst_stats; struct pkt_burst_stats tx_burst_stats; struct fwd_lcore *lcore; /**< Lcore being scheduled. */ @@ -360,6 +360,7 @@ struct fwd_lcore { streamid_t stream_nb; /**< number of streams in "fwd_streams" */ lcoreid_t cpuid_idx; /**< index of logical core in CPU id table */ volatile char stopped; /**< stop forwarding when set */ + uint64_t total_cycles; /**< used with --record-core-cycles */ }; /* @@ -785,16 +786,17 @@ is_proc_primary(void) return rte_eal_process_type() == RTE_PROC_PRIMARY; } -static inline unsigned int -lcore_num(void) +static inline struct fwd_lcore * +lcore_to_fwd_lcore(uint16_t lcore_id) { unsigned int i; - for (i = 0; i < RTE_MAX_LCORE; ++i) - if (fwd_lcores_cpuids[i] == rte_lcore_id()) - return i; + for (i = 0; i < cur_fwd_config.nb_fwd_lcores; ++i) { + if (fwd_lcores_cpuids[i] == lcore_id) + return fwd_lcores[i]; + } - rte_panic("lcore_id of current thread not found in fwd_lcores_cpuids\n"); + return NULL; } void @@ -803,7 +805,12 @@ parse_fwd_portlist(const char *port); static inline struct fwd_lcore * current_fwd_lcore(void) { - return fwd_lcores[lcore_num()]; + struct fwd_lcore *fc = lcore_to_fwd_lcore(rte_lcore_id()); + + if (fc == NULL) + rte_panic("lcore_id of current thread not found in fwd_lcores_cpuids\n"); + + return fc; } /* Mbuf Pools */ @@ -839,7 +846,7 @@ static inline void get_end_cycles(struct fwd_stream *fs, uint64_t start_tsc) { if (record_core_cycles) - fs->core_cycles += rte_rdtsc() - start_tsc; + fs->busy_cycles += rte_rdtsc() - start_tsc; } static inline void From patchwork Thu Feb 9 09:43:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 123567 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF7BA41C4D; Thu, 9 Feb 2023 10:45:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8056042D1D; Thu, 9 Feb 2023 10:44:17 +0100 (CET) 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 09EF142D75 for ; Thu, 9 Feb 2023 10:44:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675935855; 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=rjAEjyv//dyuphxHtk7H2zpv+6rylVi1dicZlf7YcyI=; b=IP/saGbGJDs1WpOmcQD0oN3P8wUcr3kyfrSHzFx7LjQpCz7PWklh+/exrqk0r0ErKOE49E Lk0lcCChMnI1TwBLX63fkbdcUDpoed3WD69OholT7VF8rT9ukRTiAC78mGlqkbNXqFvlkv qefF38EGXVepnKLW5QB/2wHWVr3vzlk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-536-x2Q48SJPNsiUdgrBLjxhQA-1; Thu, 09 Feb 2023 04:44:14 -0500 X-MC-Unique: x2Q48SJPNsiUdgrBLjxhQA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AAC685CCE8; Thu, 9 Feb 2023 09:44:14 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A206C16023; Thu, 9 Feb 2023 09:44:13 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Robin Jarry , Kevin Laatz Subject: [PATCH v10 5/5] eal: add lcore usage telemetry endpoint Date: Thu, 9 Feb 2023 10:43:54 +0100 Message-Id: <20230209094354.1377424-6-rjarry@redhat.com> In-Reply-To: <20230209094354.1377424-1-rjarry@redhat.com> References: <20221123102612.1688865-1-rjarry@redhat.com> <20230209094354.1377424-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Allow fetching CPU cycles usage for all lcores with a single request. This endpoint is intended for repeated and frequent invocations by external monitoring systems and therefore returns condensed data. It consists of a single dictionary with three keys: "lcore_ids", "total_cycles" and "busy_cycles" that are mapped to three arrays of integer values. Each array has the same number of values, one per lcore, in the same order. Example: --> /eal/lcore/usage { "/eal/lcore/usage": { "lcore_ids": [ 4, 5 ], "total_cycles": [ 23846845590, 23900558914 ], "busy_cycles": [ 21043446682, 21448837316 ] } } Signed-off-by: Robin Jarry Reviewed-by: Kevin Laatz --- Notes: v9 -> v10: no change doc/guides/rel_notes/release_23_03.rst | 5 ++- lib/eal/common/eal_common_lcore.c | 60 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst index 17d38d5ea264..4f2878846829 100644 --- a/doc/guides/rel_notes/release_23_03.rst +++ b/doc/guides/rel_notes/release_23_03.rst @@ -57,8 +57,9 @@ New Features * **Added support for reporting lcore usage in applications.** - * The ``/eal/lcore/list`` and ``/eal/lcore/info`` telemetry endpoints have - been added to provide information similar to ``rte_lcore_dump()``. + * The ``/eal/lcore/list``, ``/eal/lcore/usage`` and ``/eal/lcore/info`` + telemetry endpoints have been added to provide information similar to + ``rte_lcore_dump()``. * Applications can register a callback at startup via ``rte_lcore_register_usage_cb()`` to provide lcore usage information. diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c index 8fcdebd87692..837acbe4142a 100644 --- a/lib/eal/common/eal_common_lcore.c +++ b/lib/eal/common/eal_common_lcore.c @@ -572,6 +572,63 @@ handle_lcore_info(const char *cmd __rte_unused, const char *params, struct rte_t return rte_lcore_iterate(lcore_telemetry_info_cb, &info); } +struct lcore_telemetry_usage { + struct rte_tel_data *lcore_ids; + struct rte_tel_data *total_cycles; + struct rte_tel_data *busy_cycles; +}; + +static int +lcore_telemetry_usage_cb(unsigned int lcore_id, void *arg) +{ + struct lcore_telemetry_usage *u = arg; + struct rte_lcore_usage usage; + rte_lcore_usage_cb usage_cb; + + /* The callback may not set all the fields in the structure, so clear it here. */ + memset(&usage, 0, sizeof(usage)); + /* Guard against concurrent modification of lcore_usage_cb. */ + usage_cb = lcore_usage_cb; + if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) { + rte_tel_data_add_array_uint(u->lcore_ids, lcore_id); + rte_tel_data_add_array_uint(u->total_cycles, usage.total_cycles); + rte_tel_data_add_array_uint(u->busy_cycles, usage.busy_cycles); + } + + return 0; +} + +static int +handle_lcore_usage(const char *cmd __rte_unused, + const char *params __rte_unused, + struct rte_tel_data *d) +{ + struct lcore_telemetry_usage usage; + struct rte_tel_data *lcore_ids = rte_tel_data_alloc(); + struct rte_tel_data *total_cycles = rte_tel_data_alloc(); + struct rte_tel_data *busy_cycles = rte_tel_data_alloc(); + + if (!lcore_ids || !total_cycles || !busy_cycles) { + rte_tel_data_free(lcore_ids); + rte_tel_data_free(total_cycles); + rte_tel_data_free(busy_cycles); + return -ENOMEM; + } + + rte_tel_data_start_dict(d); + rte_tel_data_start_array(lcore_ids, RTE_TEL_UINT_VAL); + rte_tel_data_start_array(total_cycles, RTE_TEL_UINT_VAL); + rte_tel_data_start_array(busy_cycles, RTE_TEL_UINT_VAL); + rte_tel_data_add_dict_container(d, "lcore_ids", lcore_ids, 0); + rte_tel_data_add_dict_container(d, "total_cycles", total_cycles, 0); + rte_tel_data_add_dict_container(d, "busy_cycles", busy_cycles, 0); + usage.lcore_ids = lcore_ids; + usage.total_cycles = total_cycles; + usage.busy_cycles = busy_cycles; + + return rte_lcore_iterate(lcore_telemetry_usage_cb, &usage); +} + RTE_INIT(lcore_telemetry) { rte_telemetry_register_cmd( @@ -580,5 +637,8 @@ RTE_INIT(lcore_telemetry) rte_telemetry_register_cmd( "/eal/lcore/info", handle_lcore_info, "Returns lcore info. Parameters: int lcore_id"); + rte_telemetry_register_cmd( + "/eal/lcore/usage", handle_lcore_usage, + "Returns lcore cycles usage. Takes no parameters"); } #endif /* !RTE_EXEC_ENV_WINDOWS */