From patchwork Wed May 29 22:54:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 140404 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 0104444107; Thu, 30 May 2024 00:58:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9728540A6D; Thu, 30 May 2024 00:57:41 +0200 (CEST) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 7A2344067E for ; Thu, 30 May 2024 00:57:38 +0200 (CEST) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2c1a9b151bcso194488a91.3 for ; Wed, 29 May 2024 15:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1717023458; x=1717628258; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i3+egRrx4JI9E2plWMu17CiEVJ7H/AoXfNFkJLwKwko=; b=JdF3JugePehMjIQ4AtJqE4V6gbdjDx0qvZBbACXPetPiNpbp5oCa0KDuehF9L/S5Dh zh69A6EmMI0Y33mVIiJurrW6seYzVJ1ZJXVRk5HOE+NUQTsKCZ6jYK8kt54hxdu2ZZC9 tZ5PdygPlUpFEien/gtsGvrh+ttv9/CRG4tRcG1PGkwVb79rmnPvx1yQyjQP67GXEau7 GkEH3xLoGLZl/MKKJZIC8qIauxvRlg/GU/9682XL+hjCSS0h1FrK6Zyg53uTrQNH0YEj W4MkEyAq/ncc0oz5B0zmnFKxzbZ6Xjyil51GmiqblYQ1kWi4xaiHXW7qc+0lQZmYiu3f WZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717023458; x=1717628258; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i3+egRrx4JI9E2plWMu17CiEVJ7H/AoXfNFkJLwKwko=; b=uUGsHIqHh3GRx24WYSSvx0gEAT0veipvGDeQWUTyLQ1LDQPpax+YA3+A9m5JJW4ZWD Yc2okn6SZV1QdCp54QM+psmVuOiK1u5Cz+TT/p+o69nFrnsS+XtAGTnpoeI72Ljd9/rv kN+U0DYxnrXwoSrN6aHVIfhxEuKvUXESnAM/bocu4l6t+MBNzmg2hq+z4SjaiwyliLoD Y/AJlbPVW/he0cQlq66j5hLGMzLLZZdu3AznAGVuHW0BqWucYiT0q4S+pJziRWwfye3R qHLedpiJTmNSrLkeqaI9mhfpDVyRZQ4DaGtso01G4YVgXOR7dhxbew4uA/4vljjrDqHT u9IA== X-Gm-Message-State: AOJu0YwD/XF5RjJi68/jLk9syQwJQZHHBGtziqFy6b02tdUx3jjCDcDd YCwO9d95jUTBjRv9pRYfYEjPKLzUrFvgZk1xUmnLrVFwZ8xdB13rKw6wW5fr9RWp1uNxHP/L1I4 e X-Google-Smtp-Source: AGHT+IHzv0QWsW9URg9qOqe5bn0PTgUUHw08GnEtsZ7po7QJC6hA3MEalzzH9qJauLVSzISag/dEPQ== X-Received: by 2002:a17:90a:7d0b:b0:2bf:8f9f:4adb with SMTP id 98e67ed59e1d1-2c1abc0653cmr493700a91.1.1717023457651; Wed, 29 May 2024 15:57:37 -0700 (PDT) Received: from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c1a77baebcsm351762a91.53.2024.05.29.15.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 15:57:37 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Reshma Pattan Subject: [PATCH v6 4/8] latencystats: fix log messages Date: Wed, 29 May 2024 15:54:41 -0700 Message-ID: <20240529225732.442539-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240529225732.442539-1-stephen@networkplumber.org> References: <20240408195036.182545-1-stephen@networkplumber.org> <20240529225732.442539-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org All messages that because of an error should be at log level NOTICE or above. Do not break log messages across lines. Reword message for the case where getting info about a port fails and it is skipped. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- lib/latencystats/rte_latencystats.c | 35 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c index 2140ab87c4..c0ac60134f 100644 --- a/lib/latencystats/rte_latencystats.c +++ b/lib/latencystats/rte_latencystats.c @@ -259,7 +259,7 @@ rte_latencystats_init(uint64_t app_samp_intvl, latency_stats_index = rte_metrics_reg_names(ptr_strings, NUM_LATENCY_STATS); if (latency_stats_index < 0) { - LATENCY_STATS_LOG(DEBUG, + LATENCY_STATS_LOG(ERR, "Failed to register latency stats names"); return -1; } @@ -279,8 +279,8 @@ rte_latencystats_init(uint64_t app_samp_intvl, ret = rte_eth_dev_info_get(pid, &dev_info); if (ret != 0) { - LATENCY_STATS_LOG(INFO, - "Error during getting device (port %u) info: %s", + LATENCY_STATS_LOG(NOTICE, + "Can not get info for device (port %u): %s", pid, strerror(-ret)); continue; @@ -291,18 +291,18 @@ rte_latencystats_init(uint64_t app_samp_intvl, cbs->cb = rte_eth_add_first_rx_callback(pid, qid, add_time_stamps, user_cb); if (!cbs->cb) - LATENCY_STATS_LOG(INFO, "Failed to " - "register Rx callback for pid=%d, " - "qid=%d", pid, qid); + LATENCY_STATS_LOG(NOTICE, + "Failed to register Rx callback for pid=%u, qid=%u", + pid, qid); } for (qid = 0; qid < dev_info.nb_tx_queues; qid++) { cbs = &tx_cbs[pid][qid]; cbs->cb = rte_eth_add_tx_callback(pid, qid, calc_latency, user_cb); if (!cbs->cb) - LATENCY_STATS_LOG(INFO, "Failed to " - "register Tx callback for pid=%d, " - "qid=%d", pid, qid); + LATENCY_STATS_LOG(NOTICE, + "Failed to register Tx callback for pid=%u, qid=%u", + pid, qid); } } return 0; @@ -323,10 +323,9 @@ rte_latencystats_uninit(void) ret = rte_eth_dev_info_get(pid, &dev_info); if (ret != 0) { - LATENCY_STATS_LOG(INFO, - "Error during getting device (port %u) info: %s", + LATENCY_STATS_LOG(NOTICE, + "Can not get info for device (port %u): %s", pid, strerror(-ret)); - continue; } @@ -334,17 +333,17 @@ rte_latencystats_uninit(void) cbs = &rx_cbs[pid][qid]; ret = rte_eth_remove_rx_callback(pid, qid, cbs->cb); if (ret) - LATENCY_STATS_LOG(INFO, "failed to " - "remove Rx callback for pid=%d, " - "qid=%d", pid, qid); + LATENCY_STATS_LOG(NOTICE, + "Failed to remove Rx callback for pid=%u, qid=%u", + pid, qid); } for (qid = 0; qid < dev_info.nb_tx_queues; qid++) { cbs = &tx_cbs[pid][qid]; ret = rte_eth_remove_tx_callback(pid, qid, cbs->cb); if (ret) - LATENCY_STATS_LOG(INFO, "failed to " - "remove Tx callback for pid=%d, " - "qid=%d", pid, qid); + LATENCY_STATS_LOG(NOTICE, + "Failed to remove Tx callback for pid=%u, qid=%u", + pid, qid); } }