get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124809,
    "url": "http://patchwork.dpdk.org/api/patches/124809/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230303095435.555-1-luzhipeng@cestc.cn/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230303095435.555-1-luzhipeng@cestc.cn>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230303095435.555-1-luzhipeng@cestc.cn",
    "date": "2023-03-03T09:54:35",
    "name": "log: add timestamp for log",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9a328efd76e82f18cd3182ecf23951a605c462b2",
    "submitter": {
        "id": 2733,
        "url": "http://patchwork.dpdk.org/api/people/2733/?format=api",
        "name": "luzhipeng",
        "email": "luzhipeng@cestc.cn"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230303095435.555-1-luzhipeng@cestc.cn/mbox/",
    "series": [
        {
            "id": 27255,
            "url": "http://patchwork.dpdk.org/api/series/27255/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27255",
            "date": "2023-03-03T09:54:35",
            "name": "log: add timestamp for log",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/27255/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/124809/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/124809/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 8AF6C41DF3;\n\tMon,  6 Mar 2023 08:38:39 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 793C840A8A;\n\tMon,  6 Mar 2023 08:38:39 +0100 (CET)",
            "from smtp.cecloud.com (unknown [1.203.97.246])\n by mails.dpdk.org (Postfix) with ESMTP id 13A2F400D6\n for <dev@dpdk.org>; Fri,  3 Mar 2023 10:55:12 +0100 (CET)",
            "from localhost (localhost [127.0.0.1])\n by smtp.cecloud.com (Postfix) with ESMTP id 969197C0112;\n Fri,  3 Mar 2023 17:55:10 +0800 (CST)",
            "from localhost.localdomain (unknown [118.113.15.169])\n by smtp.cecloud.com (postfix) whith ESMTP id\n P250386T281460271411568S1677837307980071_;\n Fri, 03 Mar 2023 17:55:10 +0800 (CST)"
        ],
        "X-MAIL-GRAY": "0",
        "X-MAIL-DELIVERY": "1",
        "X-ANTISPAM-LEVEL": "2",
        "X-ABS-CHECKED": "0",
        "X-UNIQUE-TAG": "<2aa172bd6a6dc40a9b8c3af685c7b4a2>",
        "X-RL-SENDER": "luzhipeng@cestc.cn",
        "X-SENDER": "luzhipeng@cestc.cn",
        "X-LOGIN-NAME": "luzhipeng@cestc.cn",
        "X-FST-TO": "dev@dpdk.org",
        "X-RCPT-COUNT": "3",
        "X-SENDER-IP": "118.113.15.169",
        "X-ATTACHMENT-NUM": "0",
        "X-System-Flag": "0",
        "From": "luzhipeng <luzhipeng@cestc.cn>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net,\n\tzhipeng Lu <luzhipeng@cestc.cn>",
        "Subject": "[PATCH] log: add timestamp for log",
        "Date": "Fri,  3 Mar 2023 17:54:35 +0800",
        "Message-Id": "<20230303095435.555-1-luzhipeng@cestc.cn>",
        "X-Mailer": "git-send-email 2.34.0.windows.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Mon, 06 Mar 2023 08:38:38 +0100",
        "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": "From: zhipeng Lu <luzhipeng@cestc.cn>\n\nadd timestamp for log\n\nSigned-off-by: zhipeng Lu <luzhipeng@cestc.cn>\n---\n lib/eal/common/eal_common_log.c | 25 ++++++++++++++++++++++++-\n 1 file changed, 24 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex bd7b188ceb..2b481116b6 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -480,6 +480,27 @@ rte_log_dump(FILE *f)\n \t}\n }\n \n+/* get timestamp*/\n+void\n+rte_log_get_timestamp_prefix(char *buf, int buf_size)\n+{\n+    struct tm *info;\n+    char date[24];\n+    struct timespec ts;\n+    long usec;\n+\n+    clock_gettime(CLOCK_REALTIME, &ts);\n+    info = localtime(&ts.tv_sec);\n+    usec = ts.tv_nsec / 1000;\n+    if (info == NULL) {\n+        snprintf(buf, buf_size, \"[%s.%06ld] \", \"unknown date\", usec);\n+        return;\n+    }\n+\n+    strftime(date, sizeof(date), \"%Y-%m-%d %H:%M:%S\", info);\n+    snprintf(buf, buf_size, \"[%s.%06ld] \", date, usec);\n+}\n+\n /*\n  * Generates a log message The message will be sent in the stream\n  * defined by the previous call to rte_openlog_stream().\n@@ -489,6 +510,7 @@ rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)\n {\n \tFILE *f = rte_log_get_stream();\n \tint ret;\n+\tchar timestamp[64];\n \n \tif (logtype >= rte_logs.dynamic_types_len)\n \t\treturn -1;\n@@ -498,7 +520,8 @@ rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)\n \t/* save loglevel and logtype in a global per-lcore variable */\n \tRTE_PER_LCORE(log_cur_msg).loglevel = level;\n \tRTE_PER_LCORE(log_cur_msg).logtype = logtype;\n-\n+\trte_log_get_timestamp_prefix(timestamp, sizeof(timestamp));\n+\tfprintf(f,\"%s \",timestamp);\n \tret = vfprintf(f, format, ap);\n \tfflush(f);\n \treturn ret;\n",
    "prefixes": []
}