From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5EA79439B5; Wed, 24 Jan 2024 13:05:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FFE740294; Wed, 24 Jan 2024 13:05:19 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 15E9E4026F for ; Wed, 24 Jan 2024 13:05:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706097917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaTG9ryOr/oDh+MISFmDLQOgcgs/czTAe92m9N5cgxI=; b=c8Udknztc1gEnnB4DbUtT9fX88gj4we0hpqr7BbeMm7k3/1NV3xzhvNfQMoJbSIVW84noM lQquOJbzq+oGMGuxrGCH9P9yCOfvtHbpqtypK7bZkirkv1YUlfhrijm/223IlJyuoRmNDl QR9+bOucmWkGFZOFkWDMva+ZKvSERZ8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-kubC0j6APb68P4KvboVHzw-1; Wed, 24 Jan 2024 07:05:12 -0500 X-MC-Unique: kubC0j6APb68P4KvboVHzw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8799E29AB3FD; Wed, 24 Jan 2024 12:05:11 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id A26DF1C060AF; Wed, 24 Jan 2024 12:05:08 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Thomas Monjalon , Chengwen Feng , Kevin Laatz , Bruce Richardson , Elena Agostini , Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan , Pavan Nikhilesh , Ciara Power , Maxime Coquelin , Chenbo Xia , Andrew Rybchenko Subject: [PATCH] lib: remove duplicate prefix in logs Date: Wed, 24 Jan 2024 13:04:49 +0100 Message-ID: <20240124120450.546364-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org RTE_LOG() macros prefixe the log messages based on the logtype. This results in logs like: TMTY: TELEMETRY: Attempting socket bind to path '/run/user/...' TMTY: TELEMETRY: Socket creation and binding ok TMTY: TELEMETRY: Telemetry initialized ok Remove redundancy in some libraries following their conversion to RTE_LOG/RTE_LOG_LINE. Fixes: 97433132c2ed ("lib: use per line logging in helpers") Fixes: 0e21c7c07d62 ("lib: replace logging helpers") Reported-by: Thomas Monjalon Signed-off-by: David Marchand --- lib/dmadev/rte_dmadev.c | 3 +-- lib/gpudev/gpudev.c | 3 +-- lib/graph/graph_private.h | 2 +- lib/node/node_private.h | 2 +- lib/telemetry/telemetry.c | 4 ++-- lib/vhost/vhost.h | 6 +++--- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 5953a77bd6..dbaa14f262 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -35,8 +35,7 @@ RTE_LOG_REGISTER_DEFAULT(rte_dma_logtype, INFO); #define RTE_LOGTYPE_DMA rte_dma_logtype #define RTE_DMA_LOG(level, ...) \ - RTE_LOG_LINE(level, DMA, RTE_FMT("dma: " RTE_FMT_HEAD(__VA_ARGS__ ,), \ - RTE_FMT_TAIL(__VA_ARGS__ ,))) + RTE_LOG_LINE(level, DMA, "" __VA_ARGS__) int rte_dma_dev_max(size_t dev_max) diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c index de8291151f..1c2011b856 100644 --- a/lib/gpudev/gpudev.c +++ b/lib/gpudev/gpudev.c @@ -20,8 +20,7 @@ RTE_LOG_REGISTER_DEFAULT(gpu_logtype, NOTICE); #define RTE_LOGTYPE_GPUDEV gpu_logtype #define GPU_LOG(level, ...) \ - RTE_LOG_LINE(level, GPUDEV, RTE_FMT("gpu: " RTE_FMT_HEAD(__VA_ARGS__ ,), \ - RTE_FMT_TAIL(__VA_ARGS__ ,))) + RTE_LOG_LINE(level, GPUDEV, "" __VA_ARGS__) /* Set any driver error as EPERM */ #define GPU_DRV_RET(function) \ diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h index f9274ce96c..fb88d4bc84 100644 --- a/lib/graph/graph_private.h +++ b/lib/graph/graph_private.h @@ -22,7 +22,7 @@ extern int rte_graph_logtype; #define GRAPH_LOG(level, ...) \ RTE_LOG_LINE(level, GRAPH, \ - RTE_FMT("GRAPH: %s():%u " RTE_FMT_HEAD(__VA_ARGS__ ,), \ + RTE_FMT("%s():%u " RTE_FMT_HEAD(__VA_ARGS__ ,), \ __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,))) #define graph_err(...) GRAPH_LOG(ERR, __VA_ARGS__) diff --git a/lib/node/node_private.h b/lib/node/node_private.h index 845fdaa12e..73563e4cd2 100644 --- a/lib/node/node_private.h +++ b/lib/node/node_private.h @@ -15,7 +15,7 @@ extern int rte_node_logtype; #define NODE_LOG(level, node_name, ...) \ RTE_LOG_LINE(level, NODE, \ - RTE_FMT("NODE %s: %s():%u " RTE_FMT_HEAD(__VA_ARGS__ ,), \ + RTE_FMT("%s: %s():%u " RTE_FMT_HEAD(__VA_ARGS__ ,), \ node_name, __func__, __LINE__, \ RTE_FMT_TAIL(__VA_ARGS__ ,))) diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index 31e2391867..47846ef868 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -56,8 +56,8 @@ static const char *socket_dir; /* runtime directory */ static rte_cpuset_t *thread_cpuset; RTE_LOG_REGISTER_DEFAULT(logtype, WARNING); -#define RTE_LOGTYPE_TMTY logtype -#define TMTY_LOG_LINE(l, ...) RTE_LOG_LINE(l, TMTY, "TELEMETRY: " __VA_ARGS__) +#define RTE_LOGTYPE_TELEMETRY logtype +#define TMTY_LOG_LINE(l, ...) RTE_LOG_LINE(l, TELEMETRY, "" __VA_ARGS__) /* list of command callbacks, with one command registered by default */ static struct cmd_callback *callbacks; diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h index 470dadbba6..0b13374980 100644 --- a/lib/vhost/vhost.h +++ b/lib/vhost/vhost.h @@ -678,10 +678,10 @@ extern int vhost_data_log_level; #define RTE_LOGTYPE_VHOST_DATA vhost_data_log_level #define VHOST_CONFIG_LOG(prefix, level, fmt, args...) \ - RTE_LOG_LINE(level, VHOST_CONFIG, "VHOST_CONFIG: (%s) " fmt, prefix, ##args) + RTE_LOG_LINE(level, VHOST_CONFIG, "(%s) " fmt, prefix, ##args) #define VHOST_DATA_LOG(prefix, level, fmt, args...) \ - RTE_LOG_DP_LINE(level, VHOST_DATA, "VHOST_DATA: (%s) " fmt, prefix, ##args) + RTE_LOG_DP_LINE(level, VHOST_DATA, "(%s) " fmt, prefix, ##args) #ifdef RTE_LIBRTE_VHOST_DEBUG #define VHOST_MAX_PRINT_BUFF 6072 @@ -700,7 +700,7 @@ extern int vhost_data_log_level; } \ snprintf(packet + strnlen(packet, VHOST_MAX_PRINT_BUFF), VHOST_MAX_PRINT_BUFF - strnlen(packet, VHOST_MAX_PRINT_BUFF), "\n"); \ \ - RTE_LOG_DP(DEBUG, VHOST_DATA, "VHOST_DATA: (%s) %s", dev->ifname, packet); \ + RTE_LOG_DP(DEBUG, VHOST_DATA, "(%s) %s", dev->ifname, packet); \ } while (0) #else #define PRINT_PACKET(device, addr, size, header) do {} while (0) -- 2.43.0