get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138670,
    "url": "http://patches.dpdk.org/api/patches/138670/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240321161146.340421-3-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://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": "<20240321161146.340421-3-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240321161146.340421-3-stephen@networkplumber.org",
    "date": "2024-03-21T16:00:18",
    "name": "[v10,02/10] log: unify logging code",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f7f05a78832637062f61211ff4c3f94524773d8b",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240321161146.340421-3-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31589,
            "url": "http://patches.dpdk.org/api/series/31589/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31589",
            "date": "2024-03-21T16:00:17",
            "name": "Logging enhancements.",
            "version": 10,
            "mbox": "http://patches.dpdk.org/series/31589/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/138670/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/138670/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 C653143D17;\n\tThu, 21 Mar 2024 17:19:04 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AC74742E39;\n\tThu, 21 Mar 2024 17:18:54 +0100 (CET)",
            "from mail-qk1-f178.google.com (mail-qk1-f178.google.com\n [209.85.222.178])\n by mails.dpdk.org (Postfix) with ESMTP id 7CA8B42E09\n for <dev@dpdk.org>; Thu, 21 Mar 2024 17:18:52 +0100 (CET)",
            "by mail-qk1-f178.google.com with SMTP id\n af79cd13be357-78a2093cd44so93349985a.0\n for <dev@dpdk.org>; Thu, 21 Mar 2024 09:18:52 -0700 (PDT)",
            "from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203])\n by smtp.gmail.com with ESMTPSA id\n w62-20020a638241000000b005e485fbd455sm41815pgd.45.2024.03.21.09.11.57\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 21 Mar 2024 09:11:57 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711037932;\n x=1711642732; 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=va7MWJRuAR3nLxH5zGMYb78QbpeyFQrBUnnO1GsDymY=;\n b=gS0nZDxZWq6ZrPbrWvP3FpE3zskM8o2jntgoJZHyiyb9QzBOi13u2mQHijXMk5VgOW\n 84W8kii6J9x0IcYSiahdqnyJYINZAv7F2evxC0YDCPLnl67ylhSQffNxL5Ph3HR+MEDv\n kJXmkzr7UhFc2+rht4l7rGFaqCArb9qb0WYs1vYBJt0/K5ygJNvZH4fr/3vo08kcYPgE\n hs3GiXFD/MvKjqcXfJFPay+drNfrLVQUfuosemEQzJPRwOzSJmc8YjFnihX7b/AHuxZH\n eSiX+4KwxLfFUI2C3wLKM8soTQZpPA5Tfcz73kSrLGzqLntrdRzhxDERCgInuUb4wHP4\n Jwvg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1711037932; x=1711642732;\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=va7MWJRuAR3nLxH5zGMYb78QbpeyFQrBUnnO1GsDymY=;\n b=UYLEuiewFHOV87sys+yfsCbe7BKtANMZ+RBxdEaURfJ90WbluKTh/F3m+ElOmQegJX\n e8MAnI6+wNAtHZj471CK63YanwWhekTiCpQ5y2Xh4im7Sn5YcPMtevV6wQ2qohG2vm71\n szCVbvjr2DpvijhuXkmz2GqZOzUYgWPNz/ATyBgBmI+NxiCMPSTviok9P/o/LoturIXV\n p6VV0eq8WWRwtGL17QO0oWBYTlz3KNPmKhsXLB0lyVvIEyhqyIs0ZNM2kKkc01gUDCwq\n ePDRA035N3DAmvrvN7bc/7IGuGpchM/KtKkp9B53slmFobm9b9Z5zKOeDRtDDsJ9o1H5\n 3C5Q==",
        "X-Gm-Message-State": "AOJu0YwVuOJUUx3ZedOunJJj+AWTZz8Oy9I00wSB6ftr725SUCh3NLXT\n sB8Zl4vCJTHBF9017SOq1ySUOb0wXVJBGzAGdMppthEqczTfgESp09ImVq1/cXDalwpHjJqQC8t\n u",
        "X-Google-Smtp-Source": "\n AGHT+IH+RCR8/OOEPPLFLO6+5PUXkSJAY31XYdim4DQOqOtkOc3ZjoSYxJ3K+G6mWmsn/IMlR1E6/A==",
        "X-Received": "by 2002:a05:6a20:2d95:b0:1a3:7f25:fb4c with SMTP id\n bf21-20020a056a202d9500b001a37f25fb4cmr2001636pzb.51.1711037518079;\n Thu, 21 Mar 2024 09:11:58 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v10 02/10] log: unify logging code",
        "Date": "Thu, 21 Mar 2024 09:00:18 -0700",
        "Message-ID": "<20240321161146.340421-3-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240321161146.340421-1-stephen@networkplumber.org>",
        "References": "<20200814173441.23086-1-stephen@networkplumber.org>\n <20240321161146.340421-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": "FreeBSD and Linux logging code can use common code. This also\nfixes FreeBSD not using syslog.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n doc/guides/linux_gsg/linux_eal_parameters.rst | 27 -------------------\n doc/guides/prog_guide/log_lib.rst             | 18 +++++++++++--\n lib/eal/freebsd/eal.c                         |  8 ++++++\n lib/log/log_freebsd.c                         | 12 ---------\n lib/log/{log_linux.c => log_unix.c}           |  0\n lib/log/meson.build                           | 12 ++++++---\n 6 files changed, 32 insertions(+), 45 deletions(-)\n delete mode 100644 lib/log/log_freebsd.c\n rename lib/log/{log_linux.c => log_unix.c} (100%)",
    "diff": "diff --git a/doc/guides/linux_gsg/linux_eal_parameters.rst b/doc/guides/linux_gsg/linux_eal_parameters.rst\nindex ea8f38139119..d86f94d8a85d 100644\n--- a/doc/guides/linux_gsg/linux_eal_parameters.rst\n+++ b/doc/guides/linux_gsg/linux_eal_parameters.rst\n@@ -108,30 +108,3 @@ Memory-related options\n *   ``--match-allocations``\n \n     Free hugepages back to system exactly as they were originally allocated.\n-\n-Other options\n-~~~~~~~~~~~~~\n-\n-*   ``--syslog <syslog facility>``\n-\n-    Set syslog facility. Valid syslog facilities are::\n-\n-        auth\n-        cron\n-        daemon\n-        ftp\n-        kern\n-        lpr\n-        mail\n-        news\n-        syslog\n-        user\n-        uucp\n-        local0\n-        local1\n-        local2\n-        local3\n-        local4\n-        local5\n-        local6\n-        local7\ndiff --git a/doc/guides/prog_guide/log_lib.rst b/doc/guides/prog_guide/log_lib.rst\nindex ff9d1b54a2c8..aacb36c36ce0 100644\n--- a/doc/guides/prog_guide/log_lib.rst\n+++ b/doc/guides/prog_guide/log_lib.rst\n@@ -5,8 +5,8 @@ Log Library\n ===========\n \n The DPDK Log library provides the logging functionality for other DPDK libraries and drivers.\n-By default, in a Linux application, logs are sent to syslog and also to the console.\n-On FreeBSD and Windows applications, logs are sent only to the console.\n+By default, in a Linux (or FreeBSD) application, logs are sent to syslog and also to the console.\n+In Windows applications, logs are sent only to the console.\n However, the log function can be overridden by the user to use a different logging mechanism.\n \n Log Levels\n@@ -29,6 +29,7 @@ will be emitted by the application to the log output.\n That level can be configured either by the application calling the relevant APIs from the logging library,\n or by the user passing the ``--log-level`` parameter to the EAL via the application.\n \n+\n Setting Global Log Level\n ~~~~~~~~~~~~~~~~~~~~~~~~\n \n@@ -59,6 +60,19 @@ For example::\n \n Within an application, the same result can be got using the ``rte_log_set_level_pattern()`` or ``rte_log_set_level_regex()`` APIs.\n \n+\n+Setting syslog facility\n+~~~~~~~~~~~~~~~~~~~~~~~\n+\n+On Linux and FreeBSD, where syslog is used a ``facility`` argument can be\n+used to specify what type of program is logging.\n+The default facility is ``daemon`` but it can be overridden\n+by the ``--syslog`` EAL parameter. See ``syslog.3`` man page for full values.\n+For example::\n+\n+\t/path/to/app --syslog local0\n+\n+\n Using Logging APIs to Generate Log Messages\n -------------------------------------------\n \ndiff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c\nindex bab77118e967..a57ee8406f0c 100644\n--- a/lib/eal/freebsd/eal.c\n+++ b/lib/eal/freebsd/eal.c\n@@ -53,6 +53,7 @@\n #include \"eal_options.h\"\n #include \"eal_memcfg.h\"\n #include \"eal_trace.h\"\n+#include \"log_internal.h\"\n \n #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)\n \n@@ -760,6 +761,13 @@ rte_eal_init(int argc, char **argv)\n #endif\n \t}\n \n+\tif (eal_log_init(getprogname(), internal_conf->syslog_facility) < 0) {\n+\t\trte_eal_init_alert(\"Cannot init logging.\");\n+\t\trte_errno = ENOMEM;\n+\t\trte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed);\n+\t\treturn -1;\n+\t}\n+\n \t/* in secondary processes, memory init may allocate additional fbarrays\n \t * not present in primary processes, so to avoid any potential issues,\n \t * initialize memzones first.\ndiff --git a/lib/log/log_freebsd.c b/lib/log/log_freebsd.c\ndeleted file mode 100644\nindex 698d3c542337..000000000000\n--- a/lib/log/log_freebsd.c\n+++ /dev/null\n@@ -1,12 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2023 Intel Corporation\n- */\n-\n-#include <rte_common.h>\n-#include \"log_internal.h\"\n-\n-int\n-eal_log_init(__rte_unused const char *id, __rte_unused int facility)\n-{\n-\treturn 0;\n-}\ndiff --git a/lib/log/log_linux.c b/lib/log/log_unix.c\nsimilarity index 100%\nrename from lib/log/log_linux.c\nrename to lib/log/log_unix.c\ndiff --git a/lib/log/meson.build b/lib/log/meson.build\nindex 0d4319b36f77..60516a0b2a2d 100644\n--- a/lib/log/meson.build\n+++ b/lib/log/meson.build\n@@ -2,8 +2,12 @@\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+\n+if is_windows\n+    sources += files('log_windows.c')\n+else\n+    sources += files('log_unix.c')\n+endif\n+\n headers = files('rte_log.h')\n",
    "prefixes": [
        "v10",
        "02/10"
    ]
}