Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/69027/?format=api
http://patches.dpdk.org/api/patches/69027/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200421123949.38270-17-ciara.power@intel.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": "<20200421123949.38270-17-ciara.power@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200421123949.38270-17-ciara.power@intel.com", "date": "2020-04-21T12:39:48", "name": "[v3,16/17] eal: add eal telemetry callbacks", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "34d121149f03050dd556e63aae689e3da67b5476", "submitter": { "id": 978, "url": "http://patches.dpdk.org/api/people/978/?format=api", "name": "Power, Ciara", "email": "ciara.power@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200421123949.38270-17-ciara.power@intel.com/mbox/", "series": [ { "id": 9543, "url": "http://patches.dpdk.org/api/series/9543/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9543", "date": "2020-04-21T12:39:32", "name": "update and simplify telemetry library.", "version": 3, "mbox": "http://patches.dpdk.org/series/9543/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/69027/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/69027/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BF958A0597;\n\tTue, 21 Apr 2020 15:04:02 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0CD001D6AB;\n\tTue, 21 Apr 2020 15:00:11 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id 74E091D651\n for <dev@dpdk.org>; Tue, 21 Apr 2020 15:00:04 +0200 (CEST)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Apr 2020 06:00:04 -0700", "from silpixa00399953.ir.intel.com (HELO\n silpixa00399953.ger.corp.intel.com) ([10.237.222.53])\n by fmsmga004.fm.intel.com with ESMTP; 21 Apr 2020 06:00:01 -0700" ], "IronPort-SDR": [ "\n EJ0b0PbS6ArVmfEYjbSRIoQNoZdOpjBj6vYxcJRZr1f0ZrLfj4F5vgz4F79tlfP/T6vss0B600\n eKaVwexJ8hNg==", "\n Iws/31JOEWccdvG54WC8BNwuWbl3ERAQVkIIk/USZRpbAStSOCFgINz6YU+hjWt0cS+4WZlGvJ\n bWGUcuJ8S6Og==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.72,410,1580803200\"; d=\"scan'208\";a=\"279629350\"", "From": "Ciara Power <ciara.power@intel.com>", "To": "dev@dpdk.org,\n\tkevin.laatz@intel.com", "Cc": "reshma.pattan@intel.com, jerinjacobk@gmail.com, david.marchand@redhat.com,\n keith.wiles@intel.com, mb@smartsharesystems.com, thomas@monjalon.net,\n Bruce Richardson <bruce.richardson@intel.com>,\n Ciara Power <ciara.power@intel.com>", "Date": "Tue, 21 Apr 2020 13:39:48 +0100", "Message-Id": "<20200421123949.38270-17-ciara.power@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200421123949.38270-1-ciara.power@intel.com>", "References": "<20200319171907.60891-1-ciara.power@intel.com>\n <20200421123949.38270-1-ciara.power@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 16/17] eal: add eal telemetry callbacks", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Bruce Richardson <bruce.richardson@intel.com>\n\nEAL now registers commands to provide some basic info from EAL.\n\nExample:\nConnecting to /var/run/dpdk/rte/dpdk_telemetry.v2\n{\"pid\": 926, \"version\": \"DPDK 20.05.0-rc0\", \"max_output_len\": 16384}\n--> /\n{\"/\": [\"/\", \"/eal/app_params\", \"/eal/params\", \"/ethdev/link_status\", \\\n \"/ethdev/list\", \"/ethdev/xstats\", \"/info\", \"/rawdev/list\", \\\n \"/rawdev/xstats\"]}\n--> /eal/app_params\n{\"/eal/app_params\": [\"-i\"]}\n--> /eal/params\n{\"/eal/params\": [\"./app/dpdk-testpmd\"]}\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n\n---\nv2:\n - Removed /eal/version command as /info replaces it.\n - Compile telemetry callbacks and include headers if not in Windows\n execution environment.\n---\n lib/librte_eal/common/eal_common_options.c | 71 ++++++++++++++++++++++\n lib/librte_eal/common/eal_options.h | 3 +\n lib/librte_eal/freebsd/eal.c | 3 +\n lib/librte_eal/linux/eal.c | 3 +\n 4 files changed, 80 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex e722064c27..e3774f6779 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -29,6 +29,9 @@\n #include <rte_version.h>\n #include <rte_devargs.h>\n #include <rte_memcpy.h>\n+#ifndef RTE_EXEC_ENV_WINDOWS\n+#include <rte_telemetry.h>\n+#endif\n \n #include \"eal_internal_cfg.h\"\n #include \"eal_options.h\"\n@@ -132,6 +135,74 @@ static int master_lcore_parsed;\n static int mem_parsed;\n static int core_parsed;\n \n+#ifndef RTE_EXEC_ENV_WINDOWS\n+static char **eal_args;\n+static char **eal_app_args;\n+\n+#define EAL_PARAM_REQ \"/eal/params\"\n+#define EAL_APP_PARAM_REQ \"/eal/app_params\"\n+\n+/* callback handler for telemetry library to report out EAL flags */\n+int\n+handle_eal_info_request(const char *cmd, const char *params __rte_unused,\n+\t\tchar *buffer, int buf_len)\n+{\n+\tchar **args;\n+\tint used = 0;\n+\tint i = 0;\n+\n+\tif (strcmp(cmd, EAL_PARAM_REQ) == 0)\n+\t\targs = eal_args;\n+\telse\n+\t\targs = eal_app_args;\n+\n+\tif (args == NULL || args[0] == NULL)\n+\t\treturn rte_tel_json_empty_array(buffer, buf_len, used);\n+\n+\tfor ( ; args[i] != NULL; i++)\n+\t\tused = rte_tel_json_add_array_string(buffer, buf_len, used,\n+\t\t\t\targs[i]);\n+\treturn used;\n+}\n+\n+int\n+eal_save_args(int argc, char **argv)\n+{\n+\tint i, j;\n+\n+\trte_telemetry_register_cmd(EAL_PARAM_REQ, handle_eal_info_request);\n+\trte_telemetry_register_cmd(EAL_APP_PARAM_REQ, handle_eal_info_request);\n+\n+\t/* clone argv to report out later. We overprovision, but\n+\t * this does not waste huge amounts of memory\n+\t */\n+\teal_args = calloc(argc + 1, sizeof(*eal_args));\n+\tif (eal_args == NULL)\n+\t\treturn -1;\n+\n+\tfor (i = 0; i < argc; i++) {\n+\t\teal_args[i] = strdup(argv[i]);\n+\t\tif (strcmp(argv[i], \"--\") == 0)\n+\t\t\tbreak;\n+\t}\n+\teal_args[i++] = NULL; /* always finish with NULL */\n+\n+\t/* allow reporting of any app args we know about too */\n+\tif (i >= argc)\n+\t\treturn 0;\n+\n+\teal_app_args = calloc(argc - i + 1, sizeof(*eal_args));\n+\tif (eal_app_args == NULL)\n+\t\treturn -1;\n+\n+\tfor (j = 0; i < argc; j++, i++)\n+\t\teal_app_args[j] = strdup(argv[i]);\n+\teal_app_args[j] = NULL;\n+\n+\treturn 0;\n+}\n+#endif\n+\n static int\n eal_option_device_add(enum rte_devtype type, const char *optarg)\n {\ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex 225ad4bb59..5373e9f5e3 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -88,5 +88,8 @@ int eal_check_common_options(struct internal_config *internal_cfg);\n void eal_common_usage(void);\n enum rte_proc_type_t eal_proc_type_detect(void);\n int eal_plugins_init(void);\n+int eal_save_args(int argc, char **argv);\n+int handle_eal_info_request(const char *cmd, const char *params __rte_unused,\n+\t\tchar *buffer, int buf_len);\n \n #endif /* EAL_OPTIONS_H */\ndiff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c\nindex 2397bdfd50..3e7bb34ccc 100644\n--- a/lib/librte_eal/freebsd/eal.c\n+++ b/lib/librte_eal/freebsd/eal.c\n@@ -716,6 +716,9 @@ rte_eal_init(int argc, char **argv)\n \n \teal_reset_internal_config(&internal_config);\n \n+\t/* clone argv to report out later in telemetry */\n+\teal_save_args(argc, argv);\n+\n \t/* set log level as early as possible */\n \teal_log_level_parse(argc, argv);\n \ndiff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c\nindex 4be885e8a5..4c3c769490 100644\n--- a/lib/librte_eal/linux/eal.c\n+++ b/lib/librte_eal/linux/eal.c\n@@ -983,6 +983,9 @@ rte_eal_init(int argc, char **argv)\n \t/* set log level as early as possible */\n \teal_log_level_parse(argc, argv);\n \n+\t/* clone argv to report out later in telemetry */\n+\teal_save_args(argc, argv);\n+\n \tif (rte_eal_cpu_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot detect lcores.\");\n \t\trte_errno = ENOTSUP;\n", "prefixes": [ "v3", "16/17" ] }{ "id": 69027, "url": "