Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/123622/?format=api
http://patches.dpdk.org/api/patches/123622/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230210002222.812379-4-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": "<20230210002222.812379-4-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20230210002222.812379-4-stephen@networkplumber.org", "date": "2023-02-10T00:22:20", "name": "[v3,3/5] latencystats: use dynamic logtype", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "efe4e355b218e447490d6105e01a54a195159b83", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "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/20230210002222.812379-4-stephen@networkplumber.org/mbox/", "series": [ { "id": 26934, "url": "http://patches.dpdk.org/api/series/26934/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26934", "date": "2023-02-10T00:22:17", "name": "Replace use of RTE_LOGTYPE_USER1 in library", "version": 3, "mbox": "http://patches.dpdk.org/series/26934/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/123622/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/123622/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 BF90A41C56;\n\tFri, 10 Feb 2023 01:22:46 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B1DDA42D12;\n\tFri, 10 Feb 2023 01:22:33 +0100 (CET)", "from mail-pg1-f174.google.com (mail-pg1-f174.google.com\n [209.85.215.174])\n by mails.dpdk.org (Postfix) with ESMTP id C0D8542B8C\n for <dev@dpdk.org>; Fri, 10 Feb 2023 01:22:29 +0100 (CET)", "by mail-pg1-f174.google.com with SMTP id x31so2689877pgl.6\n for <dev@dpdk.org>; Thu, 09 Feb 2023 16:22:29 -0800 (PST)", "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n g9-20020aa78749000000b005907664a3eesm1986639pfo.125.2023.02.09.16.22.27\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Feb 2023 16:22:28 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\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=gvTgzcLHWczeKJnkpsC+rJhEoBxEk1W8Qv+jCAnORCk=;\n b=1dZnn9oos+M0um08IJoWkSVN1gBPebN8Of5Bq9hL7WlV3ktpHmUSxwFrOqCskh7ZGh\n QbslLobSbbCqMVr+QGamP05ZPC/I8KjxCB+g2m9VQR7JT1uJ/xIHSR4z2R2hZN93XdXY\n RiO0bLMaZwta/cBSKHN3lz0Y6JNDhx/SPc4K3/ppTlQkHdAl5KtOriOiTIngzZIlt/z6\n xY4Z7tWRayWf4bQ+C0KtudjyKuzyhphxYirnbJl1IEZ4lj0pqu0QlCcInWr+0AD+KYjN\n BHcOeLbLVqWzcc8UgjJBqU8LaNW/jTeo5qu7Ru3mxOH05W0C5b1354duVKDoMZst/ITW\n xHIQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\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=gvTgzcLHWczeKJnkpsC+rJhEoBxEk1W8Qv+jCAnORCk=;\n b=YvzxhBpDY8/dKMjoPvUKxbgtESGg071mxXNpMQ8f8Z0WGbkgbjAU5VUZN/yKvUyrFr\n W5iWT4vPiATrBcrLvwgSMX3IHyf3B18+sncwRot9xACj1SzWsaXHpe2feK9Mt+6TtrBa\n 8+5mGSUzxPo8uDDelN3VdST2pi7EFVdkNjmwz69fMEny7Bacm3S7VtZlSNuQ3nU9IDXK\n 6UMX4nEUsbZqbP+WlHHG3tpcYlfTNelzC/934J5BE4mtq4BNxzKi4RWmvvGjLlKl9iq8\n Zb/WeGHqEFNcc9B4Vv81DDv26Kbfp6VqBB/nVJd16NaCInboCkFku0zFyWFoHhhIK/nN\n FIIA==", "X-Gm-Message-State": "AO0yUKXPlLxNFFDVCYNAhKYt6cM14iXjKLAinUPaFzfSF1HfGyqftECH\n L83v4I2UpVtmwlCbchRC2NByajAv/5LMPTBERdw=", "X-Google-Smtp-Source": "\n AK7set8tOeG/AquduPCiAvCJFzxBoAkvRFYFVH6B+Dq0VYPrlFiKHE1eHF45i81qfO/hhR1qnXCnOg==", "X-Received": "by 2002:a05:6a00:b41:b0:5a8:445d:d352 with SMTP id\n p1-20020a056a000b4100b005a8445dd352mr6317007pfo.11.1675988548654;\n Thu, 09 Feb 2023 16:22:28 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>, reshma.pattan@intel.com,\n Remy Horton <remy.horton@intel.com>,\n Harry van Haaren <harry.van.haaren@intel.com>", "Subject": "[PATCH v3 3/5] latencystats: use dynamic logtype", "Date": "Thu, 9 Feb 2023 16:22:20 -0800", "Message-Id": "<20230210002222.812379-4-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.39.1", "In-Reply-To": "<20230210002222.812379-1-stephen@networkplumber.org>", "References": "<20230208044825.1682620-1-stephen@networkplumber.org>\n <20230210002222.812379-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": "Libraries should not reuse RTE_LOGTYPE_USER1 for their\nlogging. Instead they should register their own type.\n\nFixes: 5cd3cac9ed22 (\"latency: added new library for latency stats\")\nCc: reshma.pattan@intel.com\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/latencystats/rte_latencystats.c | 55 +++++++++++++++--------------\n 1 file changed, 28 insertions(+), 27 deletions(-)", "diff": "diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c\nindex 8985a377db4e..3a4c47e2b34a 100644\n--- a/lib/latencystats/rte_latencystats.c\n+++ b/lib/latencystats/rte_latencystats.c\n@@ -26,7 +26,10 @@ latencystat_cycles_per_ns(void)\n }\n \n /* Macros for printing using RTE_LOG */\n-#define RTE_LOGTYPE_LATENCY_STATS RTE_LOGTYPE_USER1\n+RTE_LOG_REGISTER_DEFAULT(latencystat_logtype, INFO);\n+#define LATENCYSTATS_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, latencystat_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ## args)\n \n static uint64_t timestamp_dynflag;\n static int timestamp_dynfield_offset = -1;\n@@ -95,7 +98,7 @@ rte_latencystats_update(void)\n \t\t\t\t\tlatency_stats_index,\n \t\t\t\t\tvalues, NUM_LATENCY_STATS);\n \tif (ret < 0)\n-\t\tRTE_LOG(INFO, LATENCY_STATS, \"Failed to push the stats\\n\");\n+\t\tLATENCYSTATS_LOG(INFO, \"Failed to push the stats\");\n \n \treturn ret;\n }\n@@ -227,8 +230,7 @@ rte_latencystats_init(uint64_t app_samp_intvl,\n \tmz = rte_memzone_reserve(MZ_RTE_LATENCY_STATS, sizeof(*glob_stats),\n \t\t\t\t\trte_socket_id(), flags);\n \tif (mz == NULL) {\n-\t\tRTE_LOG(ERR, LATENCY_STATS, \"Cannot reserve memory: %s:%d\\n\",\n-\t\t\t__func__, __LINE__);\n+\t\tLATENCYSTATS_LOG(ERR, \"Cannot reserve memory\");\n \t\treturn -ENOMEM;\n \t}\n \n@@ -243,8 +245,7 @@ rte_latencystats_init(uint64_t app_samp_intvl,\n \tlatency_stats_index = rte_metrics_reg_names(ptr_strings,\n \t\t\t\t\t\t\tNUM_LATENCY_STATS);\n \tif (latency_stats_index < 0) {\n-\t\tRTE_LOG(DEBUG, LATENCY_STATS,\n-\t\t\t\"Failed to register latency stats names\\n\");\n+\t\tLATENCYSTATS_LOG(ERR, \"Failed to register latency stats names\");\n \t\treturn -1;\n \t}\n \n@@ -252,8 +253,8 @@ rte_latencystats_init(uint64_t app_samp_intvl,\n \tret = rte_mbuf_dyn_rx_timestamp_register(×tamp_dynfield_offset,\n \t\t\t×tamp_dynflag);\n \tif (ret != 0) {\n-\t\tRTE_LOG(ERR, LATENCY_STATS,\n-\t\t\t\"Cannot register mbuf field/flag for timestamp\\n\");\n+\t\tLATENCYSTATS_LOG(ERR,\n+\t\t\t\t \"Cannot register mbuf field/flag for timestamp\");\n \t\treturn -rte_errno;\n \t}\n \n@@ -263,9 +264,9 @@ rte_latencystats_init(uint64_t app_samp_intvl,\n \n \t\tret = rte_eth_dev_info_get(pid, &dev_info);\n \t\tif (ret != 0) {\n-\t\t\tRTE_LOG(INFO, LATENCY_STATS,\n-\t\t\t\t\"Error during getting device (port %u) info: %s\\n\",\n-\t\t\t\tpid, strerror(-ret));\n+\t\t\tLATENCYSTATS_LOG(INFO,\n+\t\t\t\t\t \"Error during getting device (port %u) info: %s\",\n+\t\t\t\t\t pid, strerror(-ret));\n \n \t\t\tcontinue;\n \t\t}\n@@ -275,18 +276,18 @@ rte_latencystats_init(uint64_t app_samp_intvl,\n \t\t\tcbs->cb = rte_eth_add_first_rx_callback(pid, qid,\n \t\t\t\t\tadd_time_stamps, user_cb);\n \t\t\tif (!cbs->cb)\n-\t\t\t\tRTE_LOG(INFO, LATENCY_STATS, \"Failed to \"\n-\t\t\t\t\t\"register Rx callback for pid=%d, \"\n-\t\t\t\t\t\"qid=%d\\n\", pid, qid);\n+\t\t\t\tLATENCYSTATS_LOG(INFO,\n+\t\t\t\t\t\t \"Failed to register Rx callback for pid=%d, qid=%d\",\n+\t\t\t\t\t\t pid, qid);\n \t\t}\n \t\tfor (qid = 0; qid < dev_info.nb_tx_queues; qid++) {\n \t\t\tcbs = &tx_cbs[pid][qid];\n \t\t\tcbs->cb = rte_eth_add_tx_callback(pid, qid,\n \t\t\t\t\tcalc_latency, user_cb);\n \t\t\tif (!cbs->cb)\n-\t\t\t\tRTE_LOG(INFO, LATENCY_STATS, \"Failed to \"\n-\t\t\t\t\t\"register Tx callback for pid=%d, \"\n-\t\t\t\t\t\"qid=%d\\n\", pid, qid);\n+\t\t\t\tLATENCYSTATS_LOG(INFO,\n+\t\t\t\t\t\t \"Failed to register Tx callback for pid=%d, qid=%d\",\n+\t\t\t\t\t\t pid, qid);\n \t\t}\n \t}\n \treturn 0;\n@@ -307,8 +308,8 @@ rte_latencystats_uninit(void)\n \n \t\tret = rte_eth_dev_info_get(pid, &dev_info);\n \t\tif (ret != 0) {\n-\t\t\tRTE_LOG(INFO, LATENCY_STATS,\n-\t\t\t\t\"Error during getting device (port %u) info: %s\\n\",\n+\t\t\tLATENCYSTATS_LOG(INFO,\n+\t\t\t\t\"Error during getting device (port %u) info: %s\",\n \t\t\t\tpid, strerror(-ret));\n \n \t\t\tcontinue;\n@@ -318,17 +319,17 @@ rte_latencystats_uninit(void)\n \t\t\tcbs = &rx_cbs[pid][qid];\n \t\t\tret = rte_eth_remove_rx_callback(pid, qid, cbs->cb);\n \t\t\tif (ret)\n-\t\t\t\tRTE_LOG(INFO, LATENCY_STATS, \"failed to \"\n-\t\t\t\t\t\"remove Rx callback for pid=%d, \"\n-\t\t\t\t\t\"qid=%d\\n\", pid, qid);\n+\t\t\t\tLATENCYSTATS_LOG(INFO,\n+\t\t\t\t\t\t \"failed to remove Rx callback for pid=%d, qid=%d\",\n+\t\t\t\t\t\t pid, qid);\n \t\t}\n \t\tfor (qid = 0; qid < dev_info.nb_tx_queues; qid++) {\n \t\t\tcbs = &tx_cbs[pid][qid];\n \t\t\tret = rte_eth_remove_tx_callback(pid, qid, cbs->cb);\n \t\t\tif (ret)\n-\t\t\t\tRTE_LOG(INFO, LATENCY_STATS, \"failed to \"\n-\t\t\t\t\t\"remove Tx callback for pid=%d, \"\n-\t\t\t\t\t\"qid=%d\\n\", pid, qid);\n+\t\t\t\tLATENCYSTATS_LOG(INFO,\n+\t\t\t\t\t\t \"failed to remove Tx callback for pid=%d, qid=%d\",\n+\t\t\t\t\t\t pid, qid);\n \t\t}\n \t}\n \n@@ -365,8 +366,8 @@ rte_latencystats_get(struct rte_metric_value *values, uint16_t size)\n \t\tconst struct rte_memzone *mz;\n \t\tmz = rte_memzone_lookup(MZ_RTE_LATENCY_STATS);\n \t\tif (mz == NULL) {\n-\t\t\tRTE_LOG(ERR, LATENCY_STATS,\n-\t\t\t\t\"Latency stats memzone not found\\n\");\n+\t\t\tLATENCYSTATS_LOG(ERR,\n+\t\t\t\t\t \"Latency stats memzone not found\");\n \t\t\treturn -ENOMEM;\n \t\t}\n \t\tglob_stats = mz->addr;\n", "prefixes": [ "v3", "3/5" ] }{ "id": 123622, "url": "