get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69132,
    "url": "https://patches.dpdk.org/api/patches/69132/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200422190349.3768487-13-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-13-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200422190349.3768487-13-jerinj@marvell.com",
    "date": "2020-04-22T19:03:29",
    "name": "[v7,12/32] eal/trace: implement registration payload",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "36ba9bbe18e107d8992b7bc900e565a051f46d54",
    "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-13-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/69132/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/69132/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 5F8F6A00C2;\n\tWed, 22 Apr 2020 21:06:05 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D95881D5E9;\n\tWed, 22 Apr 2020 21:04:55 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E7F541C1EC\n for <dev@dpdk.org>; Wed, 22 Apr 2020 21:04:41 +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 03MJ1RxK005822; Wed, 22 Apr 2020 12:04:41 -0700",
            "from sc-exch04.marvell.com ([199.233.58.184])\n by mx0b-0016f401.pphosted.com with ESMTP id 30jd013jgn-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 22 Apr 2020 12:04:41 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) 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:04:39 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 22 Apr 2020 12:04:38 -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:04:38 -0700",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id 2C7A63F703F;\n Wed, 22 Apr 2020 12:04:35 -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=utp1dTsde5pd/uqYN2yk/73rGST5aFgC8ozcf08svt0=;\n b=IbBYfvZeAXTNkyDTZwGhx8mXyYPUi/Hv4xO+IjV2UkW2UlgJz2fZQKm/kQdbAf3VjSNR\n l8N+/pLhoDk7SJ814ckBS5ad2hKoRL1wIYLh0u/tPIqziEtwa1OUrLtGEJep9tpulQSU\n +YjCjyOASBkofoYYvMbROXodSV/1S/qrbqdZftcJvjnjGR/uV/4Z6HlPIq8+CdhPbD5E\n v8hSq83EjCtQvebC29ujLSNe5wV1URfTxOYSWmcMJjYHp50GKul9+m+WBca55GhiDNy1\n hmKPG1Lz4dRYwkukTsSqxgMYLuxEAZsM5jpo7Yf6wC1/KRtRHzz+UghMTsnbuVsHW4xT 7A==",
        "From": "<jerinj@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Sunil Kumar 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:29 +0530",
        "Message-ID": "<20200422190349.3768487-13-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 12/32] eal/trace: implement registration\n\tpayload",
        "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\nThe trace function payloads such as rte_trace_point_emit_* have\ndual functions. The first to emit the payload for the registration\nfunction and the second one to act as trace memory emitters.\n\nWhen it used as registration payload, it will do the following to\nfulfill the registration job.\n- Find out the size of the event\n- Generate metadata field string using __rte_trace_point_emit_field().\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\n---\n lib/librte_eal/common/eal_common_trace.c      | 19 +++++++++++++++++++\n lib/librte_eal/include/rte_trace_point.h      | 19 +++++++++++++++++++\n .../include/rte_trace_point_register.h        | 19 +++++++++++++++++++\n lib/librte_eal/rte_eal_version.map            |  1 +\n 4 files changed, 58 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/common/eal_common_trace.c\nindex bca1232f9..4985980c4 100644\n--- a/lib/librte_eal/common/eal_common_trace.c\n+++ b/lib/librte_eal/common/eal_common_trace.c\n@@ -379,6 +379,25 @@ trace_mem_per_thread_free(void)\n \trte_spinlock_unlock(&trace->lock);\n }\n \n+void\n+__rte_trace_point_emit_field(size_t sz, const char *in, const char *datatype)\n+{\n+\tchar *field = RTE_PER_LCORE(ctf_field);\n+\tint count = RTE_PER_LCORE(ctf_count);\n+\tsize_t size;\n+\tint rc;\n+\n+\tsize = RTE_MAX(0, TRACE_CTF_FIELD_SIZE - 1 - count);\n+\tRTE_PER_LCORE(trace_point_sz) += sz;\n+\trc = snprintf(RTE_PTR_ADD(field, count), size, \"%s %s;\", datatype, in);\n+\tif (rc <= 0 || (size_t)rc >= size) {\n+\t\tRTE_PER_LCORE(trace_point_sz) = 0;\n+\t\ttrace_crit(\"CTF field is too long\");\n+\t\treturn;\n+\t}\n+\tRTE_PER_LCORE(ctf_count) += rc;\n+}\n+\n int\n __rte_trace_point_register(rte_trace_point_t *handle, const char *name,\n \t\t\t   void (*register_fn)(void))\ndiff --git a/lib/librte_eal/include/rte_trace_point.h b/lib/librte_eal/include/rte_trace_point.h\nindex 8e37f971e..f4e6d7e42 100644\n--- a/lib/librte_eal/include/rte_trace_point.h\n+++ b/lib/librte_eal/include/rte_trace_point.h\n@@ -236,6 +236,25 @@ __rte_trace_point_fp_is_enabled(void)\n __rte_experimental\n void __rte_trace_mem_per_thread_alloc(void);\n \n+/**\n+ * @internal\n+ *\n+ * Helper function to emit field.\n+ *\n+ * @param sz\n+ *   The tracepoint size.\n+ * @param field\n+ *   The name of the trace event.\n+ * @param type\n+ *   The datatype of the trace event as string.\n+ * @return\n+ *   - 0: Success.\n+ *   - <0: Failure.\n+ */\n+__rte_experimental\n+void __rte_trace_point_emit_field(size_t sz, const char *field,\n+\t\t\t\t  const char *type);\n+\n /**\n  * @internal\n  *\ndiff --git a/lib/librte_eal/include/rte_trace_point_register.h b/lib/librte_eal/include/rte_trace_point_register.h\nindex b21302c3d..3f61f8346 100644\n--- a/lib/librte_eal/include/rte_trace_point_register.h\n+++ b/lib/librte_eal/include/rte_trace_point_register.h\n@@ -17,4 +17,23 @@ RTE_DECLARE_PER_LCORE(volatile int, trace_point_sz);\n \t__rte_trace_point_register(&__##trace, RTE_STR(name),\\\n \t\t\t\t   (void (*)(void)) trace)\n \n+#define __rte_trace_point_emit_header_generic(t)\\\n+\tRTE_PER_LCORE(trace_point_sz) = __RTE_TRACE_EVENT_HEADER_SZ\n+\n+#define __rte_trace_point_emit_header_fp(t) \\\n+\t__rte_trace_point_emit_header_generic(t)\n+\n+#define __rte_trace_point_emit(in, type)\\\n+do {\\\n+\tRTE_BUILD_BUG_ON(sizeof(type) != sizeof(typeof(in)));\\\n+\t__rte_trace_point_emit_field(sizeof(type), RTE_STR(in), RTE_STR(type));\\\n+} while (0)\n+\n+#define rte_trace_point_emit_string(in)\\\n+do {\\\n+\tRTE_SET_USED(in);\\\n+\t__rte_trace_point_emit_field(__RTE_TRACE_EMIT_STRING_LEN_MAX,\\\n+\t\t\t\t   RTE_STR(in)\"[32]\", \"string_bounded_t\");\\\n+} while (0)\n+\n #endif /* _RTE_TRACE_POINT_REGISTER_H_ */\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex b4b3a92e5..8b51c8a5b 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -338,6 +338,7 @@ EXPERIMENTAL {\n \n \t# added in 20.05\n \t__rte_trace_mem_per_thread_alloc;\n+\t__rte_trace_point_emit_field;\n \t__rte_trace_point_register;\n \tper_lcore_trace_mem;\n \tper_lcore_trace_point_sz;\n",
    "prefixes": [
        "v7",
        "12/32"
    ]
}