get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138778,
    "url": "http://patchwork.dpdk.org/api/patches/138778/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240325205405.669897-9-stephen@networkplumber.org/",
    "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": "<20240325205405.669897-9-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240325205405.669897-9-stephen@networkplumber.org",
    "date": "2024-03-25T20:47:05",
    "name": "[v12,08/14] log: drop syslog support, and make code common",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "03fc9562566323825fdd8463ccb5a8edcfd847c9",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20240325205405.669897-9-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31616,
            "url": "http://patchwork.dpdk.org/api/series/31616/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31616",
            "date": "2024-03-25T20:46:57",
            "name": "Logging unification and enhancements",
            "version": 12,
            "mbox": "http://patchwork.dpdk.org/series/31616/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/138778/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/138778/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 61AF743D49;\n\tMon, 25 Mar 2024 21:55:13 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B393F40E8A;\n\tMon, 25 Mar 2024 21:54:30 +0100 (CET)",
            "from mail-pl1-f177.google.com (mail-pl1-f177.google.com\n [209.85.214.177])\n by mails.dpdk.org (Postfix) with ESMTP id AC80A40DDC\n for <dev@dpdk.org>; Mon, 25 Mar 2024 21:54:25 +0100 (CET)",
            "by mail-pl1-f177.google.com with SMTP id\n d9443c01a7336-1dddbe47ac1so36493175ad.1\n for <dev@dpdk.org>; Mon, 25 Mar 2024 13:54:25 -0700 (PDT)",
            "from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203])\n by smtp.gmail.com with ESMTPSA id\n b18-20020a170903229200b001e0b5eee802sm3164487plh.123.2024.03.25.13.54.23\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 25 Mar 2024 13:54:24 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711400065;\n x=1712004865; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sfqDNKmQuWc9wk5d/DN3Cspo6vZ086ka94ZuCH1RNvE=;\n b=T4gZYzQ/bSo0Mt34pudbbNYob0lWigL5Fx1RuyA+VxvCBqqXheSmfDZKVeWzB+S0on\n b3OBk2YbwRdkbNQ3+6Mw8NADHqpldajNy7gX3uuUxypg78kpkNwL/OaUC3bkVZvx16j4\n gmNjZIVE/wP7YVp62Uzlsrp++ZDicq0/+SXw3agEDsRUKE2XW/n0+jIhwty3rAHFZ5Af\n xTv3z2AXMvjvKEYvtUvksLXgFQeaYaizEyZ01xPjJ31GabZh3sDhUJsqmLXI3iDzz+yC\n sofsKlj9gpSoGD7y2MeraL2j2FfwHqeDJOXm6eBSRIiciyFozxoFAl2qWSBRCRiO5cbg\n WKQA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1711400065; x=1712004865;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=sfqDNKmQuWc9wk5d/DN3Cspo6vZ086ka94ZuCH1RNvE=;\n b=Sd4AFIQAPdjT+fAr8NWe6U/jGy0I9dvsv/KPZjAJ2fDhq8M3j+DihiUOO1RAJ342bQ\n UoV6JY46yVNMGwfU+6kzPu/al2DqLp8Z5LR+lJstsH2jt9ZLD96uU/ctA54OfjWZH169\n J+WSua3xoqgS6azmgRFDpT0M0jquRVx6GNQ+6vkjZFPp3k17QjOwP6OKJJaxW6fbCEFC\n buqnJgUnRSb3NQI9xl5At0i8dj6yciL9Cfp4OEk+g+goVkMMTz6wT/76QC+zslVWnXz3\n ThQn+HoaA6DdCGoKt/bYBasxF5tL8p9EH6We8rIEDpSf+nULSDXqK9b5hf5YMU/Bdz2o\n 5HaQ==",
        "X-Gm-Message-State": "AOJu0Yxvz07Au/oE2daS0L/53OrK/9UFLWODq9cV/Ysk386anrbo4KQY\n LKNs8ZDcZE1i84Fyt1Fc2kAChW7gaA4RBoAJ8adG5RnMHNFmtyQeDC1UTcqVMAYLV9Q3rwyVN6I\n N",
        "X-Google-Smtp-Source": "\n AGHT+IFQ63kLuy1rJMpmnMDjNoEr8fSHrX2qBbGLTzqcCKektkzGXDGlnjFA1P/2RLNATfIZAYWEnA==",
        "X-Received": "by 2002:a17:902:d507:b0:1e0:dc6e:45ed with SMTP id\n b7-20020a170902d50700b001e0dc6e45edmr2042964plg.15.1711400064792;\n Mon, 25 Mar 2024 13:54:24 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v12 08/14] log: drop syslog support, and make code common",
        "Date": "Mon, 25 Mar 2024 13:47:05 -0700",
        "Message-ID": "<20240325205405.669897-9-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240325205405.669897-1-stephen@networkplumber.org>",
        "References": "<20200814173441.23086-1-stephen@networkplumber.org>\n <20240325205405.669897-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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 makes the log setup code common across all platforms.\n\nDrops syslog support for now, will come back in later patch.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/log/log.c          |  29 ++++++++----\n lib/log/log_internal.h |   6 ---\n lib/log/log_linux.c    | 102 -----------------------------------------\n lib/log/log_windows.c  |  22 ---------\n lib/log/meson.build    |   5 +-\n lib/log/version.map    |   1 -\n 6 files changed, 21 insertions(+), 144 deletions(-)\n delete mode 100644 lib/log/log_linux.c\n delete mode 100644 lib/log/log_windows.c",
    "diff": "diff --git a/lib/log/log.c b/lib/log/log.c\nindex 255f757d94..f597da2e39 100644\n--- a/lib/log/log.c\n+++ b/lib/log/log.c\n@@ -70,12 +70,13 @@ struct log_cur_msg {\n  /* per core log */\n static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg);\n \n-/* default logs */\n-\n /* Change the stream that will be used by logging system */\n int\n rte_openlog_stream(FILE *f)\n {\n+\tif (rte_logs.file != NULL)\n+\t\tfclose(rte_logs.file);\n+\n \trte_logs.file = f;\n \treturn 0;\n }\n@@ -505,13 +506,20 @@ rte_log(uint32_t level, uint32_t logtype, const char *format, ...)\n \treturn ret;\n }\n \n+/* Placeholder */\n+int\n+eal_log_syslog(const char *mode __rte_unused)\n+{\n+\treturn -1;\n+}\n+\n /*\n- * Called by environment-specific initialization functions.\n+ * Called by rte_eal_init\n  */\n void\n-eal_log_set_default(FILE *default_log)\n+eal_log_init(const char *id __rte_unused)\n {\n-\tdefault_log_stream = default_log;\n+\tdefault_log_stream = stderr;\n \n #if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG\n \tRTE_LOG(NOTICE, EAL,\n@@ -525,8 +533,11 @@ eal_log_set_default(FILE *default_log)\n void\n rte_eal_log_cleanup(void)\n {\n-\tif (default_log_stream) {\n-\t\tfclose(default_log_stream);\n-\t\tdefault_log_stream = NULL;\n-\t}\n+\tFILE *log_stream = rte_log_get_stream();\n+\n+\t/* don't close stderr on the application */\n+\tif (log_stream != stderr)\n+\t\tfclose(log_stream);\n+\n+\trte_logs.file = NULL;\n }\ndiff --git a/lib/log/log_internal.h b/lib/log/log_internal.h\nindex d5fabd7ef7..3c46328e7b 100644\n--- a/lib/log/log_internal.h\n+++ b/lib/log/log_internal.h\n@@ -16,12 +16,6 @@\n __rte_internal\n void eal_log_init(const char *id);\n \n-/*\n- * Determine where log data is written when no call to rte_openlog_stream.\n- */\n-__rte_internal\n-void eal_log_set_default(FILE *default_log);\n-\n /*\n  * Save a log option for later.\n  */\ndiff --git a/lib/log/log_linux.c b/lib/log/log_linux.c\ndeleted file mode 100644\nindex 6d7dc8f3ab..0000000000\n--- a/lib/log/log_linux.c\n+++ /dev/null\n@@ -1,102 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <stdio.h>\n-#include <string.h>\n-#include <sys/types.h>\n-#include <syslog.h>\n-\n-#include <rte_common.h>\n-#include <rte_log.h>\n-\n-#include \"log_internal.h\"\n-\n-static int log_facility = LOG_DAEMON;\n-\n-static const struct {\n-\tconst char *name;\n-\tint value;\n-} facilitys[] = {\n-\t{ \"auth\", LOG_AUTH },\n-\t{ \"cron\", LOG_CRON },\n-\t{ \"daemon\", LOG_DAEMON },\n-\t{ \"ftp\", LOG_FTP },\n-\t{ \"kern\", LOG_KERN },\n-\t{ \"lpr\", LOG_LPR },\n-\t{ \"mail\", LOG_MAIL },\n-\t{ \"news\", LOG_NEWS },\n-\t{ \"syslog\", LOG_SYSLOG },\n-\t{ \"user\", LOG_USER },\n-\t{ \"uucp\", LOG_UUCP },\n-\t{ \"local0\", LOG_LOCAL0 },\n-\t{ \"local1\", LOG_LOCAL1 },\n-\t{ \"local2\", LOG_LOCAL2 },\n-\t{ \"local3\", LOG_LOCAL3 },\n-\t{ \"local4\", LOG_LOCAL4 },\n-\t{ \"local5\", LOG_LOCAL5 },\n-\t{ \"local6\", LOG_LOCAL6 },\n-\t{ \"local7\", LOG_LOCAL7 },\n-};\n-\n-int\n-eal_log_syslog(const char *name)\n-{\n-\tunsigned int i;\n-\n-\tfor (i = 0; i < RTE_DIM(facilitys); i++) {\n-\t\tif (!strcmp(name, facilitys[i].name)) {\n-\t\t\tlog_facility = facilitys[i].value;\n-\t\t\treturn 0;\n-\t\t}\n-\t}\n-\treturn -1;\n-}\n-\n-/*\n- * default log function\n- */\n-static ssize_t\n-console_log_write(__rte_unused void *c, const char *buf, size_t size)\n-{\n-\tssize_t ret;\n-\n-\t/* write on stderr */\n-\tret = fwrite(buf, 1, size, stderr);\n-\tfflush(stderr);\n-\n-\t/* Syslog error levels are from 0 to 7, so subtract 1 to convert */\n-\tsyslog(rte_log_cur_msg_loglevel() - 1, \"%.*s\", (int)size, buf);\n-\n-\treturn ret;\n-}\n-\n-static int\n-console_log_close(__rte_unused void *c)\n-{\n-\tcloselog();\n-\treturn 0;\n-}\n-\n-static cookie_io_functions_t console_log_func = {\n-\t.write = console_log_write,\n-\t.close = console_log_close,\n-};\n-\n-/*\n- * set the log to default function, called during eal init process,\n- * once memzones are available.\n- */\n-void\n-eal_log_init(const char *id)\n-{\n-\tFILE *log_stream;\n-\n-\topenlog(id, LOG_NDELAY | LOG_PID, log_facility);\n-\n-\tlog_stream = fopencookie(NULL, \"w+\", console_log_func);\n-\tif (log_stream != NULL)\n-\t\teal_log_set_default(log_stream);\n-\telse\n-\t\teal_log_set_default(stderr);\n-}\ndiff --git a/lib/log/log_windows.c b/lib/log/log_windows.c\ndeleted file mode 100644\nindex d7c30e4cfa..0000000000\n--- a/lib/log/log_windows.c\n+++ /dev/null\n@@ -1,22 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2017-2018 Intel Corporation\n- */\n-\n-#include <rte_common.h>\n-#include <rte_log.h>\n-#include \"log_internal.h\"\n-\n-int\n-eal_log_syslog(const char *name __rte_unused)\n-{\n-\treturn -1; /* not used */\n-}\n-\n-/* set the log to default function, called during eal init process. */\n-void\n-eal_log_init(__rte_unused const char *id)\n-{\n-\trte_openlog_stream(stderr);\n-\n-\teal_log_set_default(stderr);\n-}\ndiff --git a/lib/log/meson.build b/lib/log/meson.build\nindex 0d4319b36f..891f77a237 100644\n--- a/lib/log/meson.build\n+++ b/lib/log/meson.build\n@@ -2,8 +2,5 @@\n # Copyright(c) 2023 Intel Corporation\n \n includes += global_inc\n-sources = files(\n-        'log.c',\n-        'log_' + exec_env + '.c',\n-)\n+sources = files('log.c')\n headers = files('rte_log.h')\ndiff --git a/lib/log/version.map b/lib/log/version.map\nindex 9c6c49bf06..32b9680c31 100644\n--- a/lib/log/version.map\n+++ b/lib/log/version.map\n@@ -29,7 +29,6 @@ INTERNAL {\n \teal_log_level2str;\n \teal_log_save_pattern;\n \teal_log_save_regexp;\n-\teal_log_set_default;\n \teal_log_syslog;\n \trte_eal_log_cleanup;\n };\n",
    "prefixes": [
        "v12",
        "08/14"
    ]
}