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 7DA4C43354; Fri, 17 Nov 2023 15:10:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F805410FB; Fri, 17 Nov 2023 15:10:12 +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 1F2C040ED1 for ; Fri, 17 Nov 2023 15:10:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700230210; 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: in-reply-to:in-reply-to:references:references; bh=uUYB+J9Cg/UaeUjnzVwwfY9wmAJqSJRNwVzH46PVT7g=; b=TzaTjdMROisGzv4zHieM2nLsnNavjkNEMAxLMKsOYc3SL7KFqKeqCWgUT1QQQJ7z33ljyr WuOyyZoUE1TppuYB/+qnWRbug4hMlTUvDQTUQfTo/GXHlE8/WSH3bgRCKodvqvdAYR8YNL OZhJsycJdZx0LD3nt0E8hSKbvQBjgMI= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-tzlhvj_2NwemqNUfDTZW1w-1; Fri, 17 Nov 2023 09:10:09 -0500 X-MC-Unique: tzlhvj_2NwemqNUfDTZW1w-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2c83421c6e8so20379461fa.2 for ; Fri, 17 Nov 2023 06:10:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700230208; x=1700835008; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uUYB+J9Cg/UaeUjnzVwwfY9wmAJqSJRNwVzH46PVT7g=; b=sPdcWTEP95RitOh9AKKEFtXMUUeCnjH7AZICRuNjUADEkKR0ahYZJgUJen+OZIVv9A qEq2gdLeH9n0I4fxEKvrC2YIOj/JBnTgT1y7SVH+Vc0egvyGk5PCuOvxsC3krB44CD77 tPprtbEOgMiWaib/kMfGFn88uRsLL6HUY1lfCS0gPUM3/f1gXKpBSrZ8xvE94qLlZZw6 l1+ftyZ0x5jGHjaF8i/V3ccLiUxhdniF67yTI2AnG8H7wOAMEfNNyL6YXgEnr8Zku2OP EQYGGk0vBcQ4WbIpB5o6k+LeDsBiYpwh9+Un423avYb5LnoKdO1s3GmB4xDOZnlD5QG3 VRZA== X-Gm-Message-State: AOJu0Yw9oJd1YT1HyfvTYTE/bNHJudbawzci9a/+ixXGKEjwJdeNJ18E f4ifRpbmxK/F/8xKguyCvcDM+BgeJ/PdkSAZg9Rh/k0HGA7nK3MrcJDn9qU7LRq7SUL9AbCd3Vp FBD+CEUpnf8CQjGGwkIo= X-Received: by 2002:a2e:7008:0:b0:2bf:fa62:5ceb with SMTP id l8-20020a2e7008000000b002bffa625cebmr8767207ljc.11.1700230207805; Fri, 17 Nov 2023 06:10:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGytZhfbAOZ3qUUvjJwa5Z1/yy31KRO+dipZYZc5V/+7F/4ng3PUv0v1CoAaFg09Cb00DBTSA4gJTFco5UIMmY= X-Received: by 2002:a2e:7008:0:b0:2bf:fa62:5ceb with SMTP id l8-20020a2e7008000000b002bffa625cebmr8767187ljc.11.1700230207503; Fri, 17 Nov 2023 06:10:07 -0800 (PST) MIME-Version: 1.0 References: <20231117131824.1977792-1-david.marchand@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35E9F03C@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F03C@smartserver.smartshare.dk> From: David Marchand Date: Fri, 17 Nov 2023 15:09:56 +0100 Message-ID: Subject: Re: [RFC 0/3] Detect superfluous newline in logs To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@amd.com, bruce.richardson@intel.com, stephen@networkplumber.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Nov 17, 2023 at 2:47=E2=80=AFPM Morten Br=C3=B8rup wrote: > > > From: David Marchand [mailto:david.marchand@redhat.com] > > Sent: Friday, 17 November 2023 14.18 > > > > Getting readable and consistent logs is important when running a DPDK > > application, especially when troubleshooting. > > A common issue with logs is when a DPDK change do not add (or on the > > contrary add too many \n) in the format string. > > > > This issue would only get noticed when actually hitting this log (which > > may be something difficult to do). > > > > This series proposes to introduce a new RTE_LOG helper that is > > responsible for logging a one line message and spews a build error > > (with gcc) if any \n is part of the format string. > > > > The new helper's name is RTE_LOG_LINE, not RTE_LOG. Sorry, wrong completion. > > As far as I can see, RTE_LOG continues working as before - allowing one l= ine of log message to span multiple lines of RTE_LOG() calls with \n in the= last of them. Which is good. Indeed, we can't break / change RTE_LOG api. This API is too old, that would be a nightmare. > > Anyway, I like the concept. And it solves a real problem. > > If you want other names, e.g. RTE_LOG for a complete line (appending \n i= n the macro itself), and RTE_LOG_PART (or similar) for an incomplete line, = I wouldn't object. But that would probably break the API. No API breaking allowed :-). --=20 David Marchand