Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/69143/?format=api
https://patches.dpdk.org/api/patches/69143/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200422190349.3768487-24-jerinj@marvell.com/", "project": { "id": 1, "url": "https://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": "<20200422190349.3768487-24-jerinj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200422190349.3768487-24-jerinj@marvell.com", "date": "2020-04-22T19:03:40", "name": "[v7,23/32] eal/trace: add trace dir configuration parameter", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "e15209c901b2334ec1f86155c7b34fc2a85c21c5", "submitter": { "id": 1188, "url": "https://patches.dpdk.org/api/people/1188/?format=api", "name": "Jerin Jacob Kollanukkaran", "email": "jerinj@marvell.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200422190349.3768487-24-jerinj@marvell.com/mbox/", "series": [ { "id": 9574, "url": "https://patches.dpdk.org/api/series/9574/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9574", "date": "2020-04-22T19:03:17", "name": "DPDK Trace support", "version": 7, "mbox": "https://patches.dpdk.org/series/9574/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/69143/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/69143/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 57F03A00C2;\n\tWed, 22 Apr 2020 21:07:57 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AAFB51D668;\n\tWed, 22 Apr 2020 21:05:38 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5F10F1C43A\n for <dev@dpdk.org>; Wed, 22 Apr 2020 21:05:24 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 03MJ5NN4011612; Wed, 22 Apr 2020 12:05:23 -0700", "from sc-exch04.marvell.com ([199.233.58.184])\n by mx0b-0016f401.pphosted.com with ESMTP id 30jd013jn0-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 22 Apr 2020 12:05:23 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com\n (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 22 Apr 2020 12:05:20 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 22 Apr 2020 12:05:20 -0700", "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id A8B643F7054;\n Wed, 22 Apr 2020 12:05:16 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=Z1up+m60O6einzqDdfybEzP6k1ZLT8Kw/oscnNX2wsQ=;\n b=jXMieopTn5371zw2rJXBReLustpvGAJWR+UsdPYRGyAiNP9C0EVQQatlVxzGUacLgMvS\n koV+cnNtKespqxNqKTt77MmWvuxLq+q/X8mX3o60OzUWJ8NrwpWqEo4PhpFEonG7F6Kt\n 1u2cLQN4GP3bBj1v73mpztdWvZYh3zUxhVy3OaHcG0nfWdNtimpS9qIcuA6Wx2Hw6Orq\n HWcNujCs17HFN29HGspOVDRuUQvx0wLr+T0HsVYr7brd1cCIrvqGyJyFyybdCAcxs39q\n NDWkv0zL14/7QV0emgPcdwCKX8uA2GgQU9e3S8c0upzar6/6SeP0WvcwcPq/TGZVFjSo uQ==", "From": "<jerinj@marvell.com>", "To": "John McNamara <john.mcnamara@intel.com>, Marko Kovacevic\n <marko.kovacevic@intel.com>, Jerin Jacob <jerinj@marvell.com>, \"Sunil Kumar\n Kori\" <skori@marvell.com>", "CC": "<dev@dpdk.org>, <thomas@monjalon.net>, <bruce.richardson@intel.com>,\n <david.marchand@redhat.com>, <mattias.ronnblom@ericsson.com>", "Date": "Thu, 23 Apr 2020 00:33:40 +0530", "Message-ID": "<20200422190349.3768487-24-jerinj@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200422190349.3768487-1-jerinj@marvell.com>", "References": "<20200419100133.3232316-1-jerinj@marvell.com>\n <20200422190349.3768487-1-jerinj@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676\n definitions=2020-04-22_06:2020-04-22,\n 2020-04-22 signatures=0", "Subject": "[dpdk-dev] [PATCH v7 23/32] eal/trace: add trace dir configuration\n\tparameter", "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: Sunil Kumar Kori <skori@marvell.com>\n\nTrace library exposes --trace-dir EAL parameter to configure\ndirectory where traces will be generated.\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\n---\n doc/guides/linux_gsg/eal_args.include.rst | 11 ++++\n lib/librte_eal/common/eal_common_options.c | 15 ++++++\n .../common/eal_common_trace_utils.c | 54 +++++++++++++++++++\n lib/librte_eal/common/eal_options.h | 2 +\n lib/librte_eal/common/eal_trace.h | 1 +\n 5 files changed, 83 insertions(+)", "diff": "diff --git a/doc/guides/linux_gsg/eal_args.include.rst b/doc/guides/linux_gsg/eal_args.include.rst\nindex d9e6a1d95..98bfcd357 100644\n--- a/doc/guides/linux_gsg/eal_args.include.rst\n+++ b/doc/guides/linux_gsg/eal_args.include.rst\n@@ -152,6 +152,17 @@ Debugging options\n \n Can be specified multiple times up to 32 times.\n \n+* ``--trace-dir=<directory path>``\n+\n+ Specify trace directory for trace output. For example:\n+\n+ Configuring ``/tmp/`` as a trace output directory::\n+\n+ --trace-dir=/tmp\n+\n+ By default, trace output will created at ``home`` directory and parameter\n+ must be specified once only.\n+\n Other options\n ~~~~~~~~~~~~~\n \ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex bb6c13177..f242d56a7 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -69,6 +69,7 @@ eal_long_options[] = {\n \t{OPT_LCORES, 1, NULL, OPT_LCORES_NUM },\n \t{OPT_LOG_LEVEL, 1, NULL, OPT_LOG_LEVEL_NUM },\n \t{OPT_TRACE, 1, NULL, OPT_TRACE_NUM },\n+\t{OPT_TRACE_DIR, 1, NULL, OPT_TRACE_DIR_NUM },\n \t{OPT_MASTER_LCORE, 1, NULL, OPT_MASTER_LCORE_NUM },\n \t{OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},\n \t{OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM },\n@@ -1430,6 +1431,15 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tbreak;\n \t}\n \n+\tcase OPT_TRACE_DIR_NUM: {\n+\t\tif (eal_trace_dir_args_save(optarg) < 0) {\n+\t\t\tRTE_LOG(ERR, EAL, \"invalid parameters for --\"\n+\t\t\t\tOPT_TRACE_DIR \"\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tbreak;\n+\t}\n+\n \tcase OPT_LCORES_NUM:\n \t\tif (eal_parse_lcores(optarg) < 0) {\n \t\t\tRTE_LOG(ERR, EAL, \"invalid parameter for --\"\n@@ -1709,6 +1719,11 @@ eal_common_usage(void)\n \t \" Enable trace based on regular expression trace name.\\n\"\n \t \" By default, the trace is disabled.\\n\"\n \t \"\t\t User must specify this option to enable trace.\\n\"\n+\t \" --\"OPT_TRACE_DIR\"=<directory path>\\n\"\n+\t \" Specify trace directory for trace output.\\n\"\n+\t \" By default, trace output will created at\\n\"\n+\t \" $HOME directory and parameter must be\\n\"\n+\t \" specified once only.\\n\"\n \t \" -v Display version information on startup\\n\"\n \t \" -h, --help This help\\n\"\n \t \" --\"OPT_IN_MEMORY\" Operate entirely in memory. This will\\n\"\ndiff --git a/lib/librte_eal/common/eal_common_trace_utils.c b/lib/librte_eal/common/eal_common_trace_utils.c\nindex 7f4726d62..41f2bdd05 100644\n--- a/lib/librte_eal/common/eal_common_trace_utils.c\n+++ b/lib/librte_eal/common/eal_common_trace_utils.c\n@@ -118,6 +118,22 @@ trace_session_name_generate(char *trace_dir)\n \treturn -rte_errno;\n }\n \n+static int\n+trace_dir_update(const char *str)\n+{\n+\tstruct trace *trace = trace_obj_get();\n+\tint rc, remaining;\n+\n+\tremaining = sizeof(trace->dir) - trace->dir_offset;\n+\trc = rte_strscpy(&trace->dir[0] + trace->dir_offset, str, remaining);\n+\tif (rc < 0)\n+\t\tgoto fail;\n+\n+\ttrace->dir_offset += rc;\n+fail:\n+\treturn rc;\n+}\n+\n int\n eal_trace_args_save(const char *optarg)\n {\n@@ -177,6 +193,37 @@ trace_args_apply(const char *arg)\n \treturn 0;\n }\n \n+int\n+eal_trace_dir_args_save(char const *optarg)\n+{\n+\tstruct trace *trace = trace_obj_get();\n+\tuint32_t size = sizeof(trace->dir);\n+\tchar *dir_path = NULL;\n+\tint rc;\n+\n+\tif (optarg == NULL) {\n+\t\ttrace_err(\"no optarg is passed\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (strlen(optarg) >= size) {\n+\t\ttrace_err(\"input string is too big\");\n+\t\treturn -ENAMETOOLONG;\n+\t}\n+\n+\tdir_path = (char *)calloc(1, size);\n+\tif (dir_path == NULL) {\n+\t\ttrace_err(\"fail to allocate memory\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tsprintf(dir_path, \"%s/\", optarg);\n+\trc = trace_dir_update(dir_path);\n+\n+\tfree(dir_path);\n+\treturn rc;\n+}\n+\n int\n trace_epoch_time_save(void)\n {\n@@ -247,6 +294,10 @@ trace_mkdir(void)\n \t\t\treturn rc;\n \t\t}\n \n+\t\trc = trace_dir_update(dir_path);\n+\t\tfree(dir_path);\n+\t\tif (rc < 0)\n+\t\t\treturn rc;\n \t}\n \n \t/* Create the path if it t exist, no \"mkdir -p\" available here */\n@@ -258,6 +309,9 @@ trace_mkdir(void)\n \t}\n \n \trc = trace_session_name_generate(session);\n+\tif (rc < 0)\n+\t\treturn rc;\n+\trc = trace_dir_update(session);\n \tif (rc < 0)\n \t\treturn rc;\n \ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex 4700410fd..04222e57f 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -35,6 +35,8 @@ enum {\n \tOPT_LOG_LEVEL_NUM,\n #define OPT_TRACE \"trace\"\n \tOPT_TRACE_NUM,\n+#define OPT_TRACE_DIR \"trace-dir\"\n+\tOPT_TRACE_DIR_NUM,\n #define OPT_MASTER_LCORE \"master-lcore\"\n \tOPT_MASTER_LCORE_NUM,\n #define OPT_MBUF_POOL_OPS_NAME \"mbuf-pool-ops-name\"\ndiff --git a/lib/librte_eal/common/eal_trace.h b/lib/librte_eal/common/eal_trace.h\nindex df4dd8efd..7af7d63f0 100644\n--- a/lib/librte_eal/common/eal_trace.h\n+++ b/lib/librte_eal/common/eal_trace.h\n@@ -114,5 +114,6 @@ int eal_trace_init(void);\n void eal_trace_fini(void);\n int eal_trace_args_save(const char *optarg);\n void eal_trace_args_free(void);\n+int eal_trace_dir_args_save(const char *optarg);\n \n #endif /* __EAL_TRACE_H */\n", "prefixes": [ "v7", "23/32" ] }{ "id": 69143, "url": "