get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 135221,
    "url": "https://patches.dpdk.org/api/patches/135221/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231215064355.1429709-3-adwivedi@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": "<20231215064355.1429709-3-adwivedi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231215064355.1429709-3-adwivedi@marvell.com",
    "date": "2023-12-15T06:43:55",
    "name": "[v6,2/2] devtools: add tracepoint check in checkpatch",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7faa455b431ef13cabf8d44317ec944a3a879c1a",
    "submitter": {
        "id": 1561,
        "url": "https://patches.dpdk.org/api/people/1561/?format=api",
        "name": "Ankur Dwivedi",
        "email": "adwivedi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20231215064355.1429709-3-adwivedi@marvell.com/mbox/",
    "series": [
        {
            "id": 30572,
            "url": "https://patches.dpdk.org/api/series/30572/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30572",
            "date": "2023-12-15T06:43:53",
            "name": "devtools: add tracepoint check in checkpatch",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/30572/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/135221/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/135221/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 399AF436F8;\n\tFri, 15 Dec 2023 07:44:27 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2822A43314;\n\tFri, 15 Dec 2023 07:44:27 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 53B6C4330C\n for <dev@dpdk.org>; Fri, 15 Dec 2023 07:44:25 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 3BF4rELK019910; Thu, 14 Dec 2023 22:44:24 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3v06m0t93c-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 14 Dec 2023 22:44:24 -0800 (PST)",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 14 Dec 2023 22:44:22 -0800",
            "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.48 via Frontend\n Transport; Thu, 14 Dec 2023 22:44:22 -0800",
            "from localhost.localdomain (unknown [10.28.36.185])\n by maili.marvell.com (Postfix) with ESMTP id 090E43F706C;\n Thu, 14 Dec 2023 22:44:20 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding:content-type; s=\n pfpt0220; bh=0TUplLQjiK4JbgZ6lt2SxfmgpCHY1gz2hVnkr5PdDzc=; b=Ym1\n 8LDWfQTDdRY7FBap79YiZ5vaIT7bQfqThAhBR67OHJSqpHm30sFIgbaJVx4eFazd\n btrVJSEwNNwgz98/G+3bgVHpsL1O24w6MAU8KE3GqkGpQEfGPYIlrtc8aYtq1Z56\n Sedrq2W6iiokxgpDFBJqhvgjkPKer6S1InxuaGlNPau/WHcuacnbwQx2Log7RVz2\n LGLWLJ7kgUeZ+7ZfX8Q6sg8NyBE3p7840vDpCihPS5xBgTh8q/04C0STtIfSgG/q\n 1BSNBHQELN+YYV+1p26XGfUsndzpCPv/gfKxXEQgdsrjgoQHhXmrF+GpsdGcJYTM\n rHz3sYM6fYOyJ8ejLKA==",
        "From": "Ankur Dwivedi <adwivedi@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <jerinj@marvell.com>, Ankur Dwivedi\n <adwivedi@marvell.com>",
        "Subject": "[PATCH v6 2/2] devtools: add tracepoint check in checkpatch",
        "Date": "Fri, 15 Dec 2023 12:13:55 +0530",
        "Message-ID": "<20231215064355.1429709-3-adwivedi@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231215064355.1429709-1-adwivedi@marvell.com>",
        "References": "<20230307120514.2774917-1-adwivedi@marvell.com>\n <20231215064355.1429709-1-adwivedi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "3tZY4J03uKl7e9l8ueaUo6VcMnvRmoPU",
        "X-Proofpoint-ORIG-GUID": "3tZY4J03uKl7e9l8ueaUo6VcMnvRmoPU",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "This patch adds a validation in checkpatch tool, to check if a\ntracepoint is present in any new function added in cryptodev, ethdev,\neventdev and mempool library.\n\nIt uses the existing build_map_changes function to create a map of\nfunctions. In the map, the newly added functions, added in the\nexperimental section are identified and their definition are checked\nfor the presence of tracepoint. The checkpatch return error if the\ntracepoint is not present.\n\nFor functions for which trace is not needed, they can be added to\ndevtools/trace-skiplist.txt file. The above tracepoint check will be\nskipped for them.\n\nSigned-off-by: Ankur Dwivedi <adwivedi@marvell.com>\n---\n devtools/check-tracepoint.sh | 148 +++++++++++++++++++++++++++++++++++\n devtools/checkpatches.sh     |   9 +++\n devtools/trace-skiplist.txt  |   0\n 3 files changed, 157 insertions(+)\n create mode 100755 devtools/check-tracepoint.sh\n create mode 100644 devtools/trace-skiplist.txt",
    "diff": "diff --git a/devtools/check-tracepoint.sh b/devtools/check-tracepoint.sh\nnew file mode 100755\nindex 0000000000..f957ff780c\n--- /dev/null\n+++ b/devtools/check-tracepoint.sh\n@@ -0,0 +1,148 @@\n+#!/bin/sh\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(C) 2023 Marvell.\n+\n+selfdir=$(dirname $(readlink -f $0))\n+. $selfdir/symbol-map-util.sh\n+\n+# Library for trace check\n+libdir=\"cryptodev ethdev eventdev mempool\"\n+\n+# Functions for which the trace check can be skipped\n+skiplist=\"$selfdir/trace-skiplist.txt\"\n+\n+find_trace_fn()\n+{\n+\tlocal fname=\"$1\"\n+\n+\tcat \"$fname\" | awk -v symname=\"$2 *\\\\\\(\" '\n+\t\t# Initialize the variables.\n+\t\t# The variable symname provides a pattern to match\n+\t\t# \"function_name(\", zero or more spaces can be present\n+\t\t# between function_name and (.\n+\t\tBEGIN {state=0; ln_pth=0}\n+\n+\t\t# Matches the function name, set state=1.\n+\t\t$0 ~ symname {state=1}\n+\n+\t\t# If closing parentheses with semicolon \");\" is found, then it\n+\t\t# is not the function definition.\n+\t\t/) *;/ {\n+\t\t\tif (state == 1) {\n+\t\t\t\tstate=0\n+\t\t\t}\n+\t\t}\n+\n+\t\t/)/ {\n+\t\t\tif (state == 1) {\n+\t\t\t\tstate=2\n+\t\t\t\tln_pth=NR\n+\t\t\t\tnext\n+\t\t\t}\n+\t\t}\n+\n+\t\t# If closing parentheses and then opening braces is found in\n+\t\t# adjacent line, then this is the start of function\n+\t\t# definition. Check for tracepoint in the function definition.\n+\t\t# The tracepoint has _trace_ in its name.\n+\t\t/{/ {\n+\t\t\tif (state == 2) {\n+\t\t\t\tif (ln_pth != NR - 1) {\n+\t\t\t\t\tstate=0\n+\t\t\t\t\tnext\n+\t\t\t\t}\n+\t\t\t\twhile (index($0, \"}\") != 2) {\n+\t\t\t\t\tif (index($0, \"_trace_\") != 0) {\n+\t\t\t\t\t\texit 0\n+\t\t\t\t\t}\n+\t\t\t\t\tif (getline <= 0) {\n+\t\t\t\t\t\tbreak\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\texit 1\n+\t\t\t}\n+\t\t}\n+\t'\n+}\n+\n+check_for_tracepoint()\n+{\n+\tlocal patch=\"$1\"\n+\tlocal mapdb=\"$2\"\n+\tlocal skip_sym\n+\tlocal libname\n+\tlocal secname\n+\tlocal mname\n+\tlocal ret=0\n+\tlocal pdir\n+\tlocal libp\n+\tlocal libn\n+\tlocal sym\n+\tlocal ar\n+\n+\twhile read -r mname symname secname ar; do\n+\t\tpdir=$(echo $mname | awk 'BEGIN {FS=\"/\"};{print $2}')\n+\t\tlibname=$(echo $mname | awk 'BEGIN {FS=\"/\"};{print $3}')\n+\t\tskip_sym=0\n+\t\tlibp=0\n+\n+\t\tif [ \"$pdir\" != \"lib\" ]; then\n+\t\t\tcontinue\n+\t\tfi\n+\n+\t\tfor libn in $libdir; do\n+\t\t\tif [ $libn = $libname ]; then\n+\t\t\t\tlibp=1\n+\t\t\t\tbreak\n+\t\t\tfi\n+\t\tdone\n+\n+\t\tif [ $libp -eq 0 ]; then\n+\t\t\tcontinue\n+\t\tfi\n+\n+\t\tfor sym in $(cat $skiplist); do\n+\t\t\tif [ $sym = $symname ]; then\n+\t\t\t\tskip_sym=1\n+\t\t\t\tbreak\n+\t\t\tfi\n+\t\tdone\n+\n+\t\tif [ $skip_sym -eq 1 ]; then\n+\t\t\tcontinue\n+\t\tfi\n+\n+\t\tif [ \"$ar\" = \"add\" ] && [ \"$secname\" = \"EXPERIMENTAL\" ]; then\n+\t\t\t# Check if new API is added with tracepoint\n+\t\t\tfind_trace_fn $patch $symname\n+\t\t\tif [ $? -eq 1 ]; then\n+\t\t\t\tret=1\n+\t\t\t\techo -n \"ERROR: New function $symname is added \"\n+\t\t\t\techo -n \"without a tracepoint. Please add a tracepoint \"\n+\t\t\t\techo -n \"or add the function $symname in \"\n+\t\t\t\techo \"devtools/trace-skiplist.txt to skip this error.\"\n+\t\t\tfi\n+\t\tfi\n+\tdone < \"$mapdb\"\n+\n+\treturn $ret\n+}\n+\n+trap clean_and_exit_on_sig EXIT\n+\n+mapfile=`mktemp -t dpdk.mapdb.XXXXXX`\n+patch=$1\n+exit_code=1\n+\n+clean_and_exit_on_sig()\n+{\n+\trm -f \"$mapfile\"\n+\texit $exit_code\n+}\n+\n+build_map_changes \"$patch\" \"$mapfile\"\n+check_for_tracepoint \"$patch\" \"$mapfile\"\n+exit_code=$?\n+rm -f \"$mapfile\"\n+\n+exit $exit_code\ndiff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh\nindex 10b79ca2bc..d74e541c9f 100755\n--- a/devtools/checkpatches.sh\n+++ b/devtools/checkpatches.sh\n@@ -10,6 +10,7 @@\n . $(dirname $(readlink -f $0))/load-devel-config\n \n VALIDATE_NEW_API=$(dirname $(readlink -f $0))/check-symbol-change.sh\n+VALIDATE_TRACEPOINT=$(dirname $(readlink -f $0))/check-tracepoint.sh\n \n # Enable codespell by default. This can be overwritten from a config file.\n # Codespell can also be enabled by setting DPDK_CHECKPATCH_CODESPELL to a valid path\n@@ -413,6 +414,14 @@ check () { # <patch-file> <commit>\n \t\tret=1\n \tfi\n \n+\t! $verbose || printf '\\nChecking API additions with tracepoint:\\n'\n+\treport=$($VALIDATE_TRACEPOINT \"$tmpinput\")\n+\tif [ $? -ne 0 ] ; then\n+\t\t$headline_printed || print_headline \"$subject\"\n+\t\tprintf '%s\\n' \"$report\"\n+\t\tret=1\n+\tfi\n+\n \tif [ \"$tmpinput\" != \"$1\" ]; then\n \t\trm -f \"$tmpinput\"\n \t\ttrap - INT\ndiff --git a/devtools/trace-skiplist.txt b/devtools/trace-skiplist.txt\nnew file mode 100644\nindex 0000000000..e69de29bb2\n",
    "prefixes": [
        "v6",
        "2/2"
    ]
}