[RFC,v2,08/14] lib: simplify multilines log messages

Message ID 20231208145950.2184940-9-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Detect superfluous newline in logs |

Commit Message

David Marchand Dec. 8, 2023, 2:59 p.m. UTC
  Those error log messages don't need to span on multiple lines.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/acl/tb_mem.c                |  2 +-
 lib/bpf/bpf_stub.c              |  4 ++--
 lib/eal/windows/eal_hugepages.c |  4 ++--
 lib/ethdev/rte_ethdev.c         | 14 +++++++-------
 4 files changed, 12 insertions(+), 12 deletions(-)
  

Comments

Stephen Hemminger Dec. 8, 2023, 5:05 p.m. UTC | #1
On Fri,  8 Dec 2023 15:59:42 +0100
David Marchand <david.marchand@redhat.com> wrote:

> Those error log messages don't need to span on multiple lines.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/acl/tb_mem.c                |  2 +-
>  lib/bpf/bpf_stub.c              |  4 ++--
>  lib/eal/windows/eal_hugepages.c |  4 ++--
>  lib/ethdev/rte_ethdev.c         | 14 +++++++-------
>  4 files changed, 12 insertions(+), 12 deletions(-)

Could you fix these messages to not cross source lines as well?
Feel free to shorten the wording as necessary.
  
Tyler Retzlaff Dec. 8, 2023, 9:03 p.m. UTC | #2
On Fri, Dec 08, 2023 at 03:59:42PM +0100, David Marchand wrote:
> Those error log messages don't need to span on multiple lines.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  
Andrew Rybchenko Dec. 16, 2023, 9:26 a.m. UTC | #3
On 12/8/23 20:05, Stephen Hemminger wrote:
> On Fri,  8 Dec 2023 15:59:42 +0100
> David Marchand <david.marchand@redhat.com> wrote:
> 
>> Those error log messages don't need to span on multiple lines.
>>
>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>> ---
>>   lib/acl/tb_mem.c                |  2 +-
>>   lib/bpf/bpf_stub.c              |  4 ++--
>>   lib/eal/windows/eal_hugepages.c |  4 ++--
>>   lib/ethdev/rte_ethdev.c         | 14 +++++++-------
>>   4 files changed, 12 insertions(+), 12 deletions(-)
> 
> Could you fix these messages to not cross source lines as well?

+1

> Feel free to shorten the wording as necessary.
  

Patch

diff --git a/lib/acl/tb_mem.c b/lib/acl/tb_mem.c
index 6a9d96aaed..238d65692a 100644
--- a/lib/acl/tb_mem.c
+++ b/lib/acl/tb_mem.c
@@ -26,7 +26,7 @@  tb_pool(struct tb_mem_pool *pool, size_t sz)
 	size = sz + pool->alignment - 1;
 	block = calloc(1, size + sizeof(*pool->block));
 	if (block == NULL) {
-		RTE_LOG(ERR, ACL, "%s(%zu)\n failed, currently allocated "
+		RTE_LOG(ERR, ACL, "%s(%zu) failed, currently allocated "
 			"by pool: %zu bytes\n", __func__, sz, pool->alloc);
 		siglongjmp(pool->fail, -ENOMEM);
 		return NULL;
diff --git a/lib/bpf/bpf_stub.c b/lib/bpf/bpf_stub.c
index ebc5343896..e9f23304bc 100644
--- a/lib/bpf/bpf_stub.c
+++ b/lib/bpf/bpf_stub.c
@@ -19,7 +19,7 @@  rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname,
 		return NULL;
 	}
 
-	RTE_BPF_LOG(ERR, "%s() is not supported with current config\n"
+	RTE_BPF_LOG(ERR, "%s() is not supported with current config, "
 		"rebuild with libelf installed\n",
 		__func__);
 	rte_errno = ENOTSUP;
@@ -36,7 +36,7 @@  rte_bpf_convert(const struct bpf_program *prog)
 		return NULL;
 	}
 
-	RTE_BPF_LOG(ERR, "%s() is not supported with current config\n"
+	RTE_BPF_LOG(ERR, "%s() is not supported with current config, "
 		"rebuild with libpcap installed\n",
 		__func__);
 	rte_errno = ENOTSUP;
diff --git a/lib/eal/windows/eal_hugepages.c b/lib/eal/windows/eal_hugepages.c
index b007dceb39..701cd0cb08 100644
--- a/lib/eal/windows/eal_hugepages.c
+++ b/lib/eal/windows/eal_hugepages.c
@@ -105,8 +105,8 @@  int
 eal_hugepage_info_init(void)
 {
 	if (hugepage_claim_privilege() < 0) {
-		RTE_LOG(ERR, EAL, "Cannot claim hugepage privilege\n"
-		"Verify that large-page support privilege is assigned to the current user\n");
+		RTE_LOG(ERR, EAL, "Cannot claim hugepage privilege, "
+		"verify that large-page support privilege is assigned to the current user\n");
 		return -1;
 	}
 
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index b9d99ece15..b21764e6fa 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6709,8 +6709,8 @@  rte_eth_ip_reassembly_capability_get(uint16_t port_id,
 
 	if (dev->data->dev_configured == 0) {
 		RTE_ETHDEV_LOG(ERR,
-			"Device with port_id=%u is not configured.\n"
-			"Cannot get IP reassembly capability\n",
+			"Device with port_id=%u is not configured, "
+			"cannot get IP reassembly capability\n",
 			port_id);
 		return -EINVAL;
 	}
@@ -6745,8 +6745,8 @@  rte_eth_ip_reassembly_conf_get(uint16_t port_id,
 
 	if (dev->data->dev_configured == 0) {
 		RTE_ETHDEV_LOG(ERR,
-			"Device with port_id=%u is not configured.\n"
-			"Cannot get IP reassembly configuration\n",
+			"Device with port_id=%u is not configured, "
+			"cannot get IP reassembly configuration\n",
 			port_id);
 		return -EINVAL;
 	}
@@ -6779,15 +6779,15 @@  rte_eth_ip_reassembly_conf_set(uint16_t port_id,
 
 	if (dev->data->dev_configured == 0) {
 		RTE_ETHDEV_LOG(ERR,
-			"Device with port_id=%u is not configured.\n"
-			"Cannot set IP reassembly configuration\n",
+			"Device with port_id=%u is not configured, "
+			"cannot set IP reassembly configuration\n",
 			port_id);
 		return -EINVAL;
 	}
 
 	if (dev->data->dev_started != 0) {
 		RTE_ETHDEV_LOG(ERR,
-			"Device with port_id=%u started,\n"
+			"Device with port_id=%u started, "
 			"cannot configure IP reassembly params.\n",
 			port_id);
 		return -EINVAL;