get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69147,
    "url": "https://patches.dpdk.org/api/patches/69147/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200422190349.3768487-28-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-28-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200422190349.3768487-28-jerinj@marvell.com",
    "date": "2020-04-22T19:03:44",
    "name": "[v7,27/32] eal/trace: add trace performance test cases",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fc532795780dd84f963b3c6e38da6937f6800325",
    "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-28-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/69147/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/69147/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 C2568A00C2;\n\tWed, 22 Apr 2020 21:08:40 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 05F3E1D6CC;\n\tWed, 22 Apr 2020 21:05:53 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 180A11D655\n for <dev@dpdk.org>; Wed, 22 Apr 2020 21:05:36 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 03MJ5apY020038; Wed, 22 Apr 2020 12:05:36 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 30fxwpk040-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 22 Apr 2020 12:05:36 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 22 Apr 2020 12:05:34 -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:34 -0700",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id 6459D3F703F;\n Wed, 22 Apr 2020 12:05:32 -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=3LIebgj9HOOiNycJYLOotA0+B3n8FGYIk4qeZ5FWAYQ=;\n b=pfA/qvI+FdXBKvZWWpKj6Nh3b+AUwnSUo+sfQRk3S5cfK/ZsQ/nyLBnRDVS0Ljp77EeH\n 5gQeDTar5naUY/V5HlxL5bJdo5ez8q5hhxh8gzGQyzm/UOC+Z0/S9mc17Y5WmL+Bvpll\n RbhK1fLcAZbTmyDA00VDCLpT8L77zzw3v7vRfQhfy/shIRaTtWUY4O9oKFzJvKWXY9xv\n SiucJpKeI2LII6H5RtyOChYj/sBPsy7/2ixY7PyTENI6OEJgTsTlv7dTtnMXkNWfrTRN\n S7+I3d81b0Iti2TLO9MOlnrxY8y7ev4rL9i4FdJ6eCEWkp0flvDY6f04zE+wdtncuZUK MQ==",
        "From": "<jerinj@marvell.com>",
        "To": "",
        "CC": "<dev@dpdk.org>, <thomas@monjalon.net>, <bruce.richardson@intel.com>,\n <david.marchand@redhat.com>, <mattias.ronnblom@ericsson.com>,\n <skori@marvell.com>, Jerin Jacob <jerinj@marvell.com>",
        "Date": "Thu, 23 Apr 2020 00:33:44 +0530",
        "Message-ID": "<20200422190349.3768487-28-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 27/32] eal/trace: add trace performance test\n\tcases",
        "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: Jerin Jacob <jerinj@marvell.com>\n\nThis test case shall be used to measure the trace overhead.\n\nExample command to run the performance test case.\n\necho \"trace_perf_autotest\" | ./build/app/test/dpdk-test -c 0x3 --trace=.*\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\n---\n app/test/Makefile          |   1 +\n app/test/meson.build       |   2 +\n app/test/test_trace_perf.c | 183 +++++++++++++++++++++++++++++++++++++\n 3 files changed, 186 insertions(+)\n create mode 100644 app/test/test_trace_perf.c",
    "diff": "diff --git a/app/test/Makefile b/app/test/Makefile\nindex 0b5807d7e..4582eca6c 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -155,6 +155,7 @@ SRCS-y += test_version.c\n SRCS-y += test_func_reentrancy.c\n SRCS-y += test_trace.c\n SRCS-y += test_trace_register.c\n+SRCS-y += test_trace_perf.c\n SRCS-y += test_service_cores.c\n \n ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)\ndiff --git a/app/test/meson.build b/app/test/meson.build\nindex a0b2c1fa8..a9a8eabcd 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -129,6 +129,7 @@ test_sources = files('commands.c',\n \t'test_ticketlock.c',\n \t'test_trace.c',\n \t'test_trace_register.c',\n+\t'test_trace_perf.c',\n \t'test_version.c',\n \t'virtual_pmd.c'\n )\n@@ -283,6 +284,7 @@ perf_test_names = [\n         'rand_perf_autotest',\n         'hash_readwrite_perf_autotest',\n         'hash_readwrite_lf_perf_autotest',\n+        'trace_perf_autotest',\n ]\n \n driver_test_names = [\ndiff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c\nnew file mode 100644\nindex 000000000..df1c8eb76\n--- /dev/null\n+++ b/app/test/test_trace_perf.c\n@@ -0,0 +1,183 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_cycles.h>\n+#include <rte_debug.h>\n+#include <rte_eal.h>\n+#include <rte_malloc.h>\n+#include <rte_lcore.h>\n+#include <rte_eal_trace.h>\n+\n+#include \"test.h\"\n+#include \"test_trace.h\"\n+\n+struct test_data;\n+\n+struct lcore_data {\n+\tvolatile bool done;\n+\tvolatile bool started;\n+\tuint64_t total_cycles;\n+\tuint64_t total_calls;\n+} __rte_cache_aligned;\n+\n+struct test_data {\n+\tunsigned int nb_workers;\n+\tstruct lcore_data ldata[];\n+} __rte_cache_aligned;\n+\n+#define STEP 100\n+#define CENT_OPS(OP) do {     \\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+OP; OP; OP; OP; OP; OP; OP; OP; OP; OP;\\\n+} while (0)\n+\n+static void\n+measure_perf(const char *str, struct test_data *data)\n+{\n+\tuint64_t hz = rte_get_timer_hz();\n+\tuint64_t total_cycles = 0;\n+\tuint64_t total_calls = 0;\n+\tdouble cycles, ns;\n+\tunsigned int workers;\n+\n+\tfor (workers = 0; workers < data->nb_workers; workers++) {\n+\t\ttotal_cycles += data->ldata[workers].total_cycles;\n+\t\ttotal_calls += data->ldata[workers].total_calls;\n+\t}\n+\n+\tcycles = total_calls ? (double)total_cycles / (double)total_calls : 0;\n+\tcycles /= STEP;\n+\tcycles /= 100; /* CENT_OPS */\n+\n+\tns = (cycles / (double)hz) * 1E9;\n+\tprintf(\"%16s: cycles=%f ns=%f\\n\", str, cycles, ns);\n+}\n+\n+static void\n+wait_till_workers_are_ready(struct test_data *data)\n+{\n+\tunsigned int workers;\n+\n+\tfor (workers = 0; workers < data->nb_workers; workers++)\n+\t\twhile (!data->ldata[workers].started)\n+\t\t\trte_pause();\n+}\n+\n+static void\n+signal_workers_to_finish(struct test_data *data)\n+{\n+\tunsigned int workers;\n+\n+\tfor (workers = 0; workers < data->nb_workers; workers++) {\n+\t\tdata->ldata[workers].done = 1;\n+\t\trte_smp_wmb();\n+\t}\n+}\n+\n+#define WORKER_DEFINE(func)\\\n+static void __rte_noinline \\\n+__worker_##func(struct lcore_data *ldata)\\\n+{\\\n+\tuint64_t start;\\\n+\tint i;\\\n+\twhile (!ldata->done) {\\\n+\t\tstart = rte_get_timer_cycles();\\\n+\t\tfor (i = 0; i < STEP; i++)\\\n+\t\t\tCENT_OPS(func);\\\n+\t\tldata->total_cycles += rte_get_timer_cycles() - start;\\\n+\t\tldata->total_calls++;\\\n+\t} \\\n+} \\\n+static int \\\n+worker_fn_##func(void *arg)\\\n+{\\\n+\tstruct lcore_data *ldata = arg;\\\n+\tldata->started = 1;\\\n+\trte_smp_wmb();\\\n+\t__worker_##func(ldata);\\\n+\treturn 0;\\\n+}\n+\n+\n+/* Test to find trace overhead */\n+#define GENERIC_VOID rte_eal_trace_generic_void()\n+#define GENERIC_U64 rte_eal_trace_generic_u64(0x120000)\n+#define GENERIC_INT rte_eal_trace_generic_int(-34)\n+#define GENERIC_FLOAT rte_eal_trace_generic_float(3.3f)\n+#define GENERIC_DOUBLE rte_eal_trace_generic_double(3.66666)\n+#define GENERIC_STR rte_eal_trace_generic_str(\"hello world\")\n+#define VOID_FP app_dpdk_test_fp()\n+\n+WORKER_DEFINE(GENERIC_VOID)\n+WORKER_DEFINE(GENERIC_U64)\n+WORKER_DEFINE(GENERIC_INT)\n+WORKER_DEFINE(GENERIC_FLOAT)\n+WORKER_DEFINE(GENERIC_DOUBLE)\n+WORKER_DEFINE(GENERIC_STR)\n+WORKER_DEFINE(VOID_FP)\n+\n+static void\n+run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)\n+{\n+\tunsigned int id, worker = 0;\n+\n+\tmemset(data, 0, sz);\n+\tdata->nb_workers = rte_lcore_count() - 1;\n+\tRTE_LCORE_FOREACH_SLAVE(id)\n+\t\trte_eal_remote_launch(f, &data->ldata[worker++], id);\n+\n+\twait_till_workers_are_ready(data);\n+\trte_delay_ms(100); /* Wait for some time to accumulate the stats */\n+\tmeasure_perf(str, data);\n+\tsignal_workers_to_finish(data);\n+\n+\tRTE_LCORE_FOREACH_SLAVE(id)\n+\t\trte_eal_wait_lcore(id);\n+}\n+\n+static int\n+test_trace_perf(void)\n+{\n+\tunsigned int nb_cores, nb_workers;\n+\tstruct test_data *data;\n+\tsize_t sz;\n+\n+\tnb_cores = rte_lcore_count();\n+\tnb_workers = nb_cores - 1;\n+\tif (nb_cores < 2) {\n+\t\tprintf(\"Need minimum two cores for testing\\n\");\n+\t\treturn TEST_SKIPPED;\n+\t}\n+\n+\tprintf(\"Timer running at %5.2fMHz\\n\", rte_get_timer_hz()/1E6);\n+\tsz = sizeof(struct test_data);\n+\tsz += nb_workers * sizeof(struct lcore_data);\n+\n+\tdata = rte_zmalloc(NULL, sz, RTE_CACHE_LINE_SIZE);\n+\tif (data == NULL) {\n+\t\tprintf(\"Failed to allocate memory\\n\");\n+\t\treturn TEST_FAILED;\n+\t}\n+\n+\trun_test(\"void\", worker_fn_GENERIC_VOID, data, sz);\n+\trun_test(\"u64\", worker_fn_GENERIC_U64, data, sz);\n+\trun_test(\"int\", worker_fn_GENERIC_INT, data, sz);\n+\trun_test(\"float\", worker_fn_GENERIC_FLOAT, data, sz);\n+\trun_test(\"double\", worker_fn_GENERIC_DOUBLE, data, sz);\n+\trun_test(\"string\", worker_fn_GENERIC_STR, data, sz);\n+\trun_test(\"void_fp\", worker_fn_VOID_FP, data, sz);\n+\n+\trte_free(data);\n+\treturn TEST_SUCCESS;\n+}\n+\n+REGISTER_TEST_COMMAND(trace_perf_autotest, test_trace_perf);\n",
    "prefixes": [
        "v7",
        "27/32"
    ]
}