Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/135263/?format=api
http://patches.dpdk.org/api/patches/135263/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231218092738.749604-12-david.marchand@redhat.com/", "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": "<20231218092738.749604-12-david.marchand@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20231218092738.749604-12-david.marchand@redhat.com", "date": "2023-12-18T09:27:33", "name": "[v3,11/14] log: add a per line log helper", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1cc2db0a60c855a0767f9ba4f3409237601791e6", "submitter": { "id": 1173, "url": "http://patches.dpdk.org/api/people/1173/?format=api", "name": "David Marchand", "email": "david.marchand@redhat.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231218092738.749604-12-david.marchand@redhat.com/mbox/", "series": [ { "id": 30587, "url": "http://patches.dpdk.org/api/series/30587/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30587", "date": "2023-12-18T09:27:22", "name": "Detect superfluous newline in logs", "version": 3, "mbox": "http://patches.dpdk.org/series/30587/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/135263/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/135263/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 784E043733;\n\tMon, 18 Dec 2023 10:29:53 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7E9BE40FDE;\n\tMon, 18 Dec 2023 10:29:24 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 9A7BA40ED0\n for <dev@dpdk.org>; Mon, 18 Dec 2023 10:29:22 +0100 (CET)", "from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73])\n by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-ssT6yT6MOSCzaicka28XWw-1; Mon,\n 18 Dec 2023 04:28:29 -0500", "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com\n [10.11.54.3])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BC121C0635D;\n Mon, 18 Dec 2023 09:28:29 +0000 (UTC)", "from dmarchan.redhat.com (unknown [10.45.224.218])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 066901121313;\n Mon, 18 Dec 2023 09:28:27 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1702891762;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=507G0wzqPe6iLgGSQTKU5GLN/snpKc1Rf9N+qS2rdZg=;\n b=Zgrpw90Eh6AR6DAA+SCpN3qcj9LVk9zBDLdlT6l6f1Bx0hfRvCDzzS/NectucAmlEqROAb\n 7yq9Z38/i4AjklxZsWpnwB6XDwclM1qrRrRbapRvanNemYzn8SJ69Pfe8zVAJP8zzzKGkO\n O7GAuRvt+nKMXmyao3cJdFiw6RSb1C4=", "X-MC-Unique": "ssT6yT6MOSCzaicka28XWw-1", "From": "David Marchand <david.marchand@redhat.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, ferruh.yigit@amd.com, bruce.richardson@intel.com,\n stephen@networkplumber.org, mb@smartsharesystems.com,\n Chengwen Feng <fengchengwen@huawei.com>", "Subject": "[PATCH v3 11/14] log: add a per line log helper", "Date": "Mon, 18 Dec 2023 10:27:33 +0100", "Message-ID": "<20231218092738.749604-12-david.marchand@redhat.com>", "In-Reply-To": "<20231218092738.749604-1-david.marchand@redhat.com>", "References": "<20231117131824.1977792-1-david.marchand@redhat.com>\n <20231218092738.749604-1-david.marchand@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.3", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "gcc builtin __builtin_strchr can be used as a static assertion to check\nwhether passed format strings contain a \\n.\nThis can be useful to detect double \\n in log messages.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nAcked-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Chengwen Feng <fengchengwen@huawei.com>\n---\nChanges since RFC v1:\n- added a check in checkpatches.sh,\n\n---\n devtools/checkpatches.sh | 8 ++++++++\n lib/log/rte_log.h | 21 +++++++++++++++++++++\n 2 files changed, 29 insertions(+)", "diff": "diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh\nindex 10b79ca2bc..10d1bf490b 100755\n--- a/devtools/checkpatches.sh\n+++ b/devtools/checkpatches.sh\n@@ -53,6 +53,14 @@ print_usage () {\n check_forbidden_additions() { # <patch>\n \tres=0\n \n+\t# refrain from new calls to RTE_LOG\n+\tawk -v FOLDERS=\"lib\" \\\n+\t\t-v EXPRESSIONS=\"RTE_LOG\\\\\\(\" \\\n+\t\t-v RET_ON_FAIL=1 \\\n+\t\t-v MESSAGE='Prefer RTE_LOG_LINE' \\\n+\t\t-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \\\n+\t\t\"$1\" || res=1\n+\n \t# refrain from new additions of rte_panic() and rte_exit()\n \t# multiple folders and expressions are separated by spaces\n \tawk -v FOLDERS=\"lib drivers\" \\\ndiff --git a/lib/log/rte_log.h b/lib/log/rte_log.h\nindex 3394746103..7dae74d849 100644\n--- a/lib/log/rte_log.h\n+++ b/lib/log/rte_log.h\n@@ -17,6 +17,7 @@\n extern \"C\" {\n #endif\n \n+#include <assert.h>\n #include <stdint.h>\n #include <stdio.h>\n #include <stdarg.h>\n@@ -358,6 +359,26 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)\n \t\t RTE_LOGTYPE_ ## t, # t \": \" __VA_ARGS__) :\t\\\n \t 0)\n \n+#ifdef RTE_TOOLCHAIN_GCC\n+#define RTE_LOG_CHECK_NO_NEWLINE(fmt) \\\n+\tstatic_assert(!__builtin_strchr(fmt, '\\n'), \\\n+\t\t\"This log format string contains a \\\\n\")\n+#else\n+#define RTE_LOG_CHECK_NO_NEWLINE(...)\n+#endif\n+\n+#define RTE_LOG_LINE(l, t, ...) do { \\\n+\tRTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__,)); \\\n+\tRTE_LOG(l, t, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) \"\\n\", \\\n+\t\tRTE_FMT_TAIL(__VA_ARGS__ ,))); \\\n+} while (0)\n+\n+#define RTE_LOG_DP_LINE(l, t, ...) do { \\\n+\tRTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__,)); \\\n+\tRTE_LOG_DP(l, t, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) \"\\n\", \\\n+\t\tRTE_FMT_TAIL(__VA_ARGS__ ,))); \\\n+} while (0)\n+\n #define RTE_LOG_REGISTER_IMPL(type, name, level)\t\t\t \\\n int type;\t\t\t\t\t\t\t\t \\\n RTE_INIT(__##type)\t\t\t\t\t\t\t \\\n", "prefixes": [ "v3", "11/14" ] }{ "id": 135263, "url": "