Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/123369/?format=api
http://patches.dpdk.org/api/patches/123369/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230207193731.1242505-6-rjarry@redhat.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20230207193731.1242505-6-rjarry@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230207193731.1242505-6-rjarry@redhat.com", "date": "2023-02-07T19:37:31", "name": "[v9,5/5] eal: add lcore usage telemetry endpoint", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "653b0df961aa998f1df6f4d26dcfde82e60c1d19", "submitter": { "id": 2850, "url": "http://patches.dpdk.org/api/people/2850/?format=api", "name": "Robin Jarry", "email": "rjarry@redhat.com" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230207193731.1242505-6-rjarry@redhat.com/mbox/", "series": [ { "id": 25871, "url": "http://patches.dpdk.org/api/series/25871/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25871", "date": "2022-11-23T10:26:08", "name": "lcore telemetry improvements", "version": 1, "mbox": "http://patches.dpdk.org/series/25871/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/123369/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/123369/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 44AE141C33;\n\tTue, 7 Feb 2023 20:38:08 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6947742D13;\n\tTue, 7 Feb 2023 20:37:51 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 364AA42670\n for <dev@dpdk.org>; Tue, 7 Feb 2023 20:37:49 +0100 (CET)", "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-121-8Op5OkrMNYKpwCvA8FqIOg-1; Tue, 07 Feb 2023 14:37:47 -0500", "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com\n [10.11.54.3])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 45D8F801779;\n Tue, 7 Feb 2023 19:37:47 +0000 (UTC)", "from ringo.home (unknown [10.39.208.16])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 6F39F1121314;\n Tue, 7 Feb 2023 19:37:46 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1675798668;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=sUIaYtxK64a4+Pe43pleFN9m60Ys9Uhyd8DlUAo1V5k=;\n b=Uzlxt/q7ZXmGqAeBcWvY2DLBJmrTLdFANvy9sz9AUCxJ8ZIxCDOT8rlRzdJ1ULEswH+5ZW\n db6OwOaIGl9aXnKYRrPwBs/psDRayZFmY9UuMaEUDA8gehlsTIvxL4oqJBnKRjIH7M5YCw\n BCPHDEVVunoYPxDwLOcex2qiFpvKvlo=", "X-MC-Unique": "8Op5OkrMNYKpwCvA8FqIOg-1", "From": "Robin Jarry <rjarry@redhat.com>", "To": "dev@dpdk.org", "Cc": "Robin Jarry <rjarry@redhat.com>,\n\tKevin Laatz <kevin.laatz@intel.com>", "Subject": "[PATCH v9 5/5] eal: add lcore usage telemetry endpoint", "Date": "Tue, 7 Feb 2023 20:37:31 +0100", "Message-Id": "<20230207193731.1242505-6-rjarry@redhat.com>", "In-Reply-To": "<20221123102612.1688865-1-rjarry@redhat.com>", "References": "<20221123102612.1688865-1-rjarry@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.3", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Allow fetching CPU cycles usage for all lcores with a single request.\nThis endpoint is intended for repeated and frequent invocations by\nexternal monitoring systems and therefore returns condensed data.\n\nIt consists of a single dictionary with three keys: \"lcore_ids\",\n\"total_cycles\" and \"busy_cycles\" that are mapped to three arrays of\ninteger values. Each array has the same number of values, one per lcore,\nin the same order.\n\nExample:\n\n --> /eal/lcore/usage\n {\n \"/eal/lcore/usage\": {\n \"lcore_ids\": [\n 4,\n 5\n ],\n \"total_cycles\": [\n 23846845590,\n 23900558914\n ],\n \"busy_cycles\": [\n 21043446682,\n 21448837316\n ]\n }\n }\n\nSigned-off-by: Robin Jarry <rjarry@redhat.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n\nNotes:\n v8 -> v9: Updated with 64 bits integer telemetry functions\n\n doc/guides/rel_notes/release_23_03.rst | 5 ++-\n lib/eal/common/eal_common_lcore.c | 60 ++++++++++++++++++++++++++\n 2 files changed, 63 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst\nindex 17d38d5ea264..4f2878846829 100644\n--- a/doc/guides/rel_notes/release_23_03.rst\n+++ b/doc/guides/rel_notes/release_23_03.rst\n@@ -57,8 +57,9 @@ New Features\n \n * **Added support for reporting lcore usage in applications.**\n \n- * The ``/eal/lcore/list`` and ``/eal/lcore/info`` telemetry endpoints have\n- been added to provide information similar to ``rte_lcore_dump()``.\n+ * The ``/eal/lcore/list``, ``/eal/lcore/usage`` and ``/eal/lcore/info``\n+ telemetry endpoints have been added to provide information similar to\n+ ``rte_lcore_dump()``.\n * Applications can register a callback at startup via\n ``rte_lcore_register_usage_cb()`` to provide lcore usage information.\n \ndiff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c\nindex fcda7c50119a..088adb14b4b6 100644\n--- a/lib/eal/common/eal_common_lcore.c\n+++ b/lib/eal/common/eal_common_lcore.c\n@@ -569,6 +569,63 @@ handle_lcore_info(const char *cmd __rte_unused, const char *params, struct rte_t\n \treturn rte_lcore_iterate(lcore_telemetry_info_cb, &info);\n }\n \n+struct lcore_telemetry_usage {\n+\tstruct rte_tel_data *lcore_ids;\n+\tstruct rte_tel_data *total_cycles;\n+\tstruct rte_tel_data *busy_cycles;\n+};\n+\n+static int\n+lcore_telemetry_usage_cb(unsigned int lcore_id, void *arg)\n+{\n+\tstruct lcore_telemetry_usage *u = arg;\n+\tstruct rte_lcore_usage usage;\n+\trte_lcore_usage_cb usage_cb;\n+\n+\t/* The callback may not set all the fields in the structure, so clear it here. */\n+\tmemset(&usage, 0, sizeof(usage));\n+\t/* Guard against concurrent modification of lcore_usage_cb. */\n+\tusage_cb = lcore_usage_cb;\n+\tif (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) {\n+\t\trte_tel_data_add_array_uint(u->lcore_ids, lcore_id);\n+\t\trte_tel_data_add_array_uint(u->total_cycles, usage.total_cycles);\n+\t\trte_tel_data_add_array_uint(u->busy_cycles, usage.busy_cycles);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+handle_lcore_usage(const char *cmd __rte_unused,\n+\t\tconst char *params __rte_unused,\n+\t\tstruct rte_tel_data *d)\n+{\n+\tstruct lcore_telemetry_usage usage;\n+\tstruct rte_tel_data *lcore_ids = rte_tel_data_alloc();\n+\tstruct rte_tel_data *total_cycles = rte_tel_data_alloc();\n+\tstruct rte_tel_data *busy_cycles = rte_tel_data_alloc();\n+\n+\tif (!lcore_ids || !total_cycles || !busy_cycles) {\n+\t\trte_tel_data_free(lcore_ids);\n+\t\trte_tel_data_free(total_cycles);\n+\t\trte_tel_data_free(busy_cycles);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\trte_tel_data_start_dict(d);\n+\trte_tel_data_start_array(lcore_ids, RTE_TEL_UINT_VAL);\n+\trte_tel_data_start_array(total_cycles, RTE_TEL_UINT_VAL);\n+\trte_tel_data_start_array(busy_cycles, RTE_TEL_UINT_VAL);\n+\trte_tel_data_add_dict_container(d, \"lcore_ids\", lcore_ids, 0);\n+\trte_tel_data_add_dict_container(d, \"total_cycles\", total_cycles, 0);\n+\trte_tel_data_add_dict_container(d, \"busy_cycles\", busy_cycles, 0);\n+\tusage.lcore_ids = lcore_ids;\n+\tusage.total_cycles = total_cycles;\n+\tusage.busy_cycles = busy_cycles;\n+\n+\treturn rte_lcore_iterate(lcore_telemetry_usage_cb, &usage);\n+}\n+\n RTE_INIT(lcore_telemetry)\n {\n \trte_telemetry_register_cmd(\n@@ -577,5 +634,8 @@ RTE_INIT(lcore_telemetry)\n \trte_telemetry_register_cmd(\n \t\t\"/eal/lcore/info\", handle_lcore_info,\n \t\t\"Returns lcore info. Parameters: int lcore_id\");\n+\trte_telemetry_register_cmd(\n+\t\t\"/eal/lcore/usage\", handle_lcore_usage,\n+\t\t\"Returns lcore cycles usage. Takes no parameters\");\n }\n #endif /* !RTE_EXEC_ENV_WINDOWS */\n", "prefixes": [ "v9", "5/5" ] }{ "id": 123369, "url": "