get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/63604/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 63604,
    "url": "http://patches.dpdk.org/api/patches/63604/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191205173128.64543-3-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": "<20191205173128.64543-3-ciara.power@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191205173128.64543-3-ciara.power@intel.com",
    "date": "2019-12-05T17:31:24",
    "name": "[RFC,2/6] eal: integrate process-info library",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a8b5b32c54b4337b5ab5fdd89d11df3da3cb1440",
    "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/20191205173128.64543-3-ciara.power@intel.com/mbox/",
    "series": [
        {
            "id": 7741,
            "url": "http://patches.dpdk.org/api/series/7741/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7741",
            "date": "2019-12-05T17:31:22",
            "name": "replace telemetry with process_info",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7741/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63604/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/63604/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 0A158A04F2;\n\tThu,  5 Dec 2019 18:34:30 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C76351BF92;\n\tThu,  5 Dec 2019 18:34:14 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by dpdk.org (Postfix) with ESMTP id 3990B1BF88\n for <dev@dpdk.org>; Thu,  5 Dec 2019 18:34:12 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 05 Dec 2019 09:34:11 -0800",
            "from silpixa00399953.ir.intel.com (HELO\n silpixa00399953.ger.corp.intel.com) ([10.237.222.53])\n by orsmga002.jf.intel.com with ESMTP; 05 Dec 2019 09:34:09 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,282,1571727600\"; d=\"scan'208\";a=\"223711812\"",
        "From": "Ciara Power <ciara.power@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>,\n Ciara Power <ciara.power@intel.com>",
        "Date": "Thu,  5 Dec 2019 17:31:24 +0000",
        "Message-Id": "<20191205173128.64543-3-ciara.power@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191205173128.64543-1-ciara.power@intel.com>",
        "References": "<20191205173128.64543-1-ciara.power@intel.com>",
        "Subject": "[dpdk-dev] [RFC 2/6] eal: integrate process-info library",
        "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\nIntegrate the process info library into the EAL.\n - Initialize the process-info library as part of EAL init.\n   This can be disabled using an EAL parameter.\n - Register commands to provide some basic info from EAL.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n---\n lib/Makefile                               |  2 +-\n lib/librte_eal/common/eal_common_options.c | 75 ++++++++++++++++++++++\n lib/librte_eal/common/eal_internal_cfg.h   |  1 +\n lib/librte_eal/common/eal_options.h        |  5 ++\n lib/librte_eal/freebsd/eal/Makefile        |  1 +\n lib/librte_eal/freebsd/eal/eal.c           | 14 ++++\n lib/librte_eal/linux/eal/Makefile          |  1 +\n lib/librte_eal/linux/eal/eal.c             | 15 +++++\n lib/librte_eal/meson.build                 |  2 +-\n 9 files changed, 114 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/Makefile b/lib/Makefile\nindex 466cd04ef..cc61176da 100644\n--- a/lib/Makefile\n+++ b/lib/Makefile\n@@ -6,7 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n DIRS-$(CONFIG_RTE_LIBRTE_KVARGS) += librte_kvargs\n DIRS-$(CONFIG_RTE_LIBRTE_PROCESS_INFO) += librte_process_info\n DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal\n-DEPDIRS-librte_eal := librte_kvargs\n+DEPDIRS-librte_eal := librte_kvargs librte_process_info\n DIRS-$(CONFIG_RTE_LIBRTE_PCI) += librte_pci\n DEPDIRS-librte_pci := librte_eal\n DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex a7f9c5f9b..0839a523d 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -25,6 +25,7 @@\n #include <rte_version.h>\n #include <rte_devargs.h>\n #include <rte_memcpy.h>\n+#include <rte_process_info.h>\n \n #include \"eal_internal_cfg.h\"\n #include \"eal_options.h\"\n@@ -82,6 +83,7 @@ eal_long_options[] = {\n \t{OPT_LEGACY_MEM,        0, NULL, OPT_LEGACY_MEM_NUM       },\n \t{OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM},\n \t{OPT_MATCH_ALLOCATIONS, 0, NULL, OPT_MATCH_ALLOCATIONS_NUM},\n+\t{OPT_NO_PROCESS_INFO,   0, NULL, OPT_NO_PROCESS_INFO_NUM  },\n \t{0,                     0, NULL, 0                        }\n };\n \n@@ -126,6 +128,75 @@ static int master_lcore_parsed;\n static int mem_parsed;\n static int core_parsed;\n \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 process_info 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 if (strcmp(cmd, EAL_APP_PARAM_REQ) == 0)\n+\t\targs = eal_app_args;\n+\telse /* version */\n+\t\treturn snprintf(buffer, buf_len, \"\\\"%s\\\"\", rte_version());\n+\n+\tif (args == NULL || args[0] == NULL)\n+\t\treturn snprintf(buffer, buf_len, \"[]\"); /* empty list */\n+\n+\tused = strlcpy(buffer, \"[\", buf_len);\n+\twhile (args[i] != NULL)\n+\t\tused += snprintf(buffer + used, buf_len - used, \"\\\"%s\\\",\",\n+\t\t\t\targs[i++]);\n+\tbuffer[used - 1] = ']';\n+\treturn used;\n+}\n+\n+int\n+eal_save_args(int argc, char **argv)\n+{\n+\tint i, j;\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+\trte_process_info_register(EAL_PARAM_REQ, handle_eal_info_request);\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+\trte_process_info_register(EAL_APP_PARAM_REQ, handle_eal_info_request);\n+\n+\treturn 0;\n+}\n+\n static int\n eal_option_device_add(enum rte_devtype type, const char *optarg)\n {\n@@ -1446,6 +1517,9 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\t\treturn -1;\n \t\t}\n \t\tbreak;\n+\tcase OPT_NO_PROCESS_INFO_NUM:\n+\t\tconf->no_process_info = 1;\n+\t\tbreak;\n \n \t/* don't know what to do, leave this to caller */\n \tdefault:\n@@ -1687,6 +1761,7 @@ eal_common_usage(void)\n \t       \"  --\"OPT_IN_MEMORY\"   Operate entirely in memory. This will\\n\"\n \t       \"                      disable secondary process support\\n\"\n \t       \"  --\"OPT_BASE_VIRTADDR\"     Base virtual address\\n\"\n+\t       \"  --\"OPT_NO_PROCESS_INFO\"   Disable process info\\n\"\n \t       \"\\nEAL options for DEBUG use only:\\n\"\n \t       \"  --\"OPT_HUGE_UNLINK\"       Unlink hugepage files after init\\n\"\n \t       \"  --\"OPT_NO_HUGE\"           Use malloc instead of hugetlbfs\\n\"\ndiff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h\nindex a42f34923..c8226cb44 100644\n--- a/lib/librte_eal/common/eal_internal_cfg.h\n+++ b/lib/librte_eal/common/eal_internal_cfg.h\n@@ -82,6 +82,7 @@ struct internal_config {\n \trte_cpuset_t ctrl_cpuset;         /**< cpuset for ctrl threads */\n \tvolatile unsigned int init_complete;\n \t/**< indicates whether EAL has completed initialization */\n+\tunsigned int no_process_info;   /**< true to disable Process Info */\n };\n extern struct internal_config internal_config; /**< Global EAL configuration. */\n \ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex 9855429e5..0692666ef 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -69,6 +69,8 @@ enum {\n \tOPT_IOVA_MODE_NUM,\n #define OPT_MATCH_ALLOCATIONS  \"match-allocations\"\n \tOPT_MATCH_ALLOCATIONS_NUM,\n+#define OPT_NO_PROCESS_INFO    \"no-process-info\"\n+\tOPT_NO_PROCESS_INFO_NUM,\n \tOPT_LONG_MAX_NUM\n };\n \n@@ -84,5 +86,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/Makefile b/lib/librte_eal/freebsd/eal/Makefile\nindex b160b5790..3fd0d5edd 100644\n--- a/lib/librte_eal/freebsd/eal/Makefile\n+++ b/lib/librte_eal/freebsd/eal/Makefile\n@@ -19,6 +19,7 @@ LDLIBS += -lexecinfo\n LDLIBS += -lpthread\n LDLIBS += -lgcc_s\n LDLIBS += -lrte_kvargs\n+LDLIBS += -lrte_process_info\n \n EXPORT_MAP := ../../rte_eal_version.map\n \ndiff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c\nindex 6ae37e7e6..6d52b035f 100644\n--- a/lib/librte_eal/freebsd/eal/eal.c\n+++ b/lib/librte_eal/freebsd/eal/eal.c\n@@ -44,6 +44,7 @@\n #include <rte_option.h>\n #include <rte_atomic.h>\n #include <malloc_heap.h>\n+#include <rte_process_info.h>\n \n #include \"eal_private.h\"\n #include \"eal_thread.h\"\n@@ -724,6 +725,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 \n@@ -952,6 +956,16 @@ rte_eal_init(int argc, char **argv)\n \t\trte_eal_init_alert(\"Cannot clear runtime directory\\n\");\n \t\treturn -1;\n \t}\n+\tif (!internal_config.no_process_info)  {\n+\t\tconst char *error_str;\n+\t\tif (rte_process_info_init(rte_eal_get_runtime_dir(),\n+\t\t\t\t&error_str) != 0) {\n+\t\t\trte_eal_init_alert(error_str);\n+\t\t\treturn -1;\n+\t\t}\n+\t\trte_process_info_register(\"/eal:version\",\n+\t\t\t\thandle_eal_info_request);\n+\t}\n \n \teal_mcfg_complete();\n \ndiff --git a/lib/librte_eal/linux/eal/Makefile b/lib/librte_eal/linux/eal/Makefile\nindex e70cf104a..d09d2b4d0 100644\n--- a/lib/librte_eal/linux/eal/Makefile\n+++ b/lib/librte_eal/linux/eal/Makefile\n@@ -23,6 +23,7 @@ LDLIBS += -lpthread\n LDLIBS += -lgcc_s\n LDLIBS += -lrt\n LDLIBS += -lrte_kvargs\n+LDLIBS += -lrte_process_info\n ifeq ($(CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES),y)\n LDLIBS += -lnuma\n endif\ndiff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex c4233ec3c..e191be6e0 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -50,6 +50,7 @@\n #include <malloc_heap.h>\n #include <rte_vfio.h>\n #include <rte_option.h>\n+#include <rte_process_info.h>\n \n #include \"eal_private.h\"\n #include \"eal_thread.h\"\n@@ -987,6 +988,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 \n@@ -1291,6 +1295,17 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\tif (!internal_config.no_process_info)  {\n+\t\tconst char *error_str;\n+\t\tif (rte_process_info_init(rte_eal_get_runtime_dir(),\n+\t\t\t\t&error_str) != 0) {\n+\t\t\trte_eal_init_alert(error_str);\n+\t\t\treturn -1;\n+\t\t}\n+\t\trte_process_info_register(\"/eal:version\",\n+\t\t\t\thandle_eal_info_request);\n+\t}\n+\n \teal_mcfg_complete();\n \n \t/* Call each registered callback, if enabled */\ndiff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build\nindex 4be5118ce..89ee3b6b8 100644\n--- a/lib/librte_eal/meson.build\n+++ b/lib/librte_eal/meson.build\n@@ -13,7 +13,7 @@ dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)\n subdir(exec_env + '/eal')\n \n allow_experimental_apis = true\n-deps += 'kvargs'\n+deps += ['kvargs', 'process_info']\n if dpdk_conf.has('RTE_USE_LIBBSD')\n \text_deps += libbsd\n endif\n",
    "prefixes": [
        "RFC",
        "2/6"
    ]
}