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 0178543354; Fri, 17 Nov 2023 15:11:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E56C6410FB; Fri, 17 Nov 2023 15:11:24 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 51DB840ED1 for ; Fri, 17 Nov 2023 15:11:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700230283; x=1731766283; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=cLnoZGTNfbEABdtqQsapQselxzK1gbllUOiNaPJwKlg=; b=JJBBQT4SuLrWVUuzWE7OF9rFOm2iEd12TccZtC7MIiK5fk1jUpBFpy4I aE6eH5d9iM+HkhYIdn+NorzCvpR5SlgY7WUII8BtrTl882t08AiVSrtkx lNE5ZaAAps5YBVPXNG9yrkKgtvs/r1ceXlHFL6l/GfRRJxu2coA+2YLeo IMc+veanbihUjz6bQGi5/+Vol4GCKNM165+4lXU1No+R1Wl0VhrUOqRzi 0128jSJ1xYxmQqR/VxZCsXGxKx3Yx+a6GHKiqu5i/Ggo4wup5vbnRGSth 40WdElhhyLyqZHwIwkRgw05lK+zqNq1VF9F/EQrMAau2gVc6uCrFSHRf+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10897"; a="381692657" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="381692657" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2023 06:11:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10897"; a="759187883" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="759187883" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Nov 2023 06:11:22 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 17 Nov 2023 06:11:21 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 17 Nov 2023 06:11:21 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 17 Nov 2023 06:11:21 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 17 Nov 2023 06:11:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dI6S0kcNZY1+tC/VXlSQhESf/Y4szt/uqSIFFRm0mENV54aL4rjNSdExLspKkdz1Hzv2kvJ84oHC6ABjzqYZhwlZPKChvpn7iCw0ARVaJQRv78AaDgHRKETDcC8sEMkSHHH4Ej58zl3gVft/Xc5FTsanuvpPDFRP5S5B6ZUGvZmUZNNnBEWhfVFYPMyic5xyR4TsLN7pkW7+eDeyxEzGe2bYe0bp8LUduhZFlPxQSyEyyOsBjg8DXGRkyhsU8byQ1PUf0oqgrgS2OOnh1A5j2lImA5q3CHP9ceEqRPMoag4R8FI7v8izezbaF/c2G8wf0ezs0Sd0w1cKdYZe9XgO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=08uA6YjL7W65nS41wOsD9sgJsPEnUUG34BQJN9+L3WU=; b=mXJ+uZfr2CoBU0atlCAqcnemt5/7i6qsLEx37euwr+8Pe7rmaL8Zd3UYCt3F1PsmkvAuK1EVD4GC2EDiNcMiaGtkYqzzTMERzogLMXpA2J18E148MfaQiz3PzZbYpVa6cmi5d53K53B+dqtxHgnbEZkdJH292I5p5Y+FBAVw4BM9JuFmyfhJ+WqdLZvgGVRbXR8AaJ2YodeGOIOnnkQ0Uu+Ih6i3pYaDaRi7JXKfejoqdkActN6fHhu6wJkYe5XyDK6Wzm5Pm36re9wYxPKrxAjfE1DjSlO6fQngg3OejJM6au4IP9QpGS9o2mET8TAFtPLRnLkznE4khCE0H5lMYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SJ2PR11MB7599.namprd11.prod.outlook.com (2603:10b6:a03:4c6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.18; Fri, 17 Nov 2023 14:11:18 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49%7]) with mapi id 15.20.7002.021; Fri, 17 Nov 2023 14:11:18 +0000 Date: Fri, 17 Nov 2023 14:11:11 +0000 From: Bruce Richardson To: David Marchand CC: , , , Subject: Re: [RFC 0/3] Detect superfluous newline in logs Message-ID: References: <20231117131824.1977792-1-david.marchand@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DUZPR01CA0061.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c2::19) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ2PR11MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: c276086f-fd55-47c5-28e7-08dbe77710df X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hYdEgh4027qtxaXTxBVXYifL9ursgXqu+fwtMtWEWCo9u5WlSf32fqkNv3M5jB/63u4acSiGVrjpODufNdIkGVRqqy9bQ8Rm/MZX1xonJjvoHHkFWZtHI5uzT+oplRCRfuzKeqTDCEckTO4SJzqbNBF5QYyc9CPr+0gDocFuVzliAfhs9t12GXbhr/3g+8BCP+/oQsknPnIo1eTErRG+GP/EBnYMuh7DM0f1AeP//R5aqRWJX8yxs1x/3Z50ZDocCCh/d4j/KgRf0A7DyvKicck2zYNbHfWyQDMN337i4nn9bS/R7o2s5mtHuMQZyFd9pDKiVTunY28XDNG+0mepnxl6e4UEzxMLAzfilOyM+JM0gQa9ClZfDctaBAOutl5HiCPAhtmeFTKjSPDyPyAFdWZdaU0T6+SrSbaDcclgB3+bm1D37Vmbqs7JTY7StXs9u/VwLDSCcEpWvNcCfE4ix9pjc1InvcqCpxN0IBm1ESbjMPD1V4oTwkQ4KjfYHfrJYlxGECnt5PbXUEaKZUPO4B4vab4MIH5kiooEY3/CDMACYsX31760DTQ9eu6r/h0I2Ew/yMRp8IHZVpn14CzqDxln6lLqNj79sx/dctEGlSbMzbdXEDQAuxs1FgWiuM2a X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(376002)(39860400002)(346002)(396003)(230922051799003)(230173577357003)(230273577357003)(451199024)(64100799003)(186009)(1800799009)(66556008)(38100700002)(316002)(6512007)(5660300002)(4326008)(66946007)(478600001)(6916009)(8936002)(8676002)(53546011)(2906002)(6506007)(6666004)(66476007)(44832011)(86362001)(41300700001)(6486002)(82960400001)(66899024)(26005)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?akJveHZZMkJaZE44ald0UndraDRlU1hvZ2pSOVlDWW5iejdSUDdQT1FobWMy?= =?utf-8?B?RjdQcTQyenNycVRoNVlRVDNXcUtkbk5wN3RlbjViZjdQWGhzRk1qbHRsWndX?= =?utf-8?B?UE1GL3VlUVVieGs4MUNEM2pXSWJuT2tzNis3OHg1U3hBRUlkS3BORUdsMjFT?= =?utf-8?B?WnRZUjZ0NFFNdjRhRE8zSFd5MzZ0bnljbGxVRjJ3cXNsQUxmSDZvVEpTV3dr?= =?utf-8?B?dUoxOURUbmwrY2czeFNNVTVRZjhINDRhL214QnR6SXBsMzlEZzRLOVNkcHkw?= =?utf-8?B?c0tsU2QvTU5jSzc5ekRmWG9haTdNYS8rSnNEMjB4aUZidEY0VkJCMjdPSFo1?= =?utf-8?B?V3pHaVBxMElPVXRON29aL2ZUMHhZak1sdE5ZUHJGdXlaK0RUalBUMm41Z0Yv?= =?utf-8?B?cGp4QjA4WTlkVFBk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c5-28e7-08dbe77710df X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 14:11:17.5788 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MFManI/fOuBsOCBHCjD35Bps6JyLl+CM2ra09SG6Qqwdv2efnx1tDbffUWuJW6Hn3tc3HWB5yzFffOXlnk9cLd5Ay9g+tlehi0TTRn/5NLE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB7599 X-OriginatorOrg: intel.com 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 02:48:25PM +0100, David Marchand wrote: > On Fri, Nov 17, 2023 at 2:27 PM Bruce Richardson > wrote: > > > > On Fri, Nov 17, 2023 at 02:18:21PM +0100, David Marchand wrote: > > > 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. > > > > > > > > > Note: > > > - the first patch is intentionnally sent as a single block: splitting it > > > into per library commits with correct Fixes: tags is a tedious work. > > > I would split it for a non RFC series. For now, it is enough to show > > > case the idea. > > > - the last patch shows how an existing log macro is converted, > > > > > > > > very nice. I definitely think this should be implemented for 24.03 > > I am still wondering how this idea should evolve... > > Some points I have in mind but for which I am not sure what is the best. > > Some log helpers were exposed to applications and had no explicit > requirement wrt \n. > Applications may have used those helpers with multiline messages. > So maybe existing *exposed* helpers should be left untouched... and a > new helper would need to be introduced. And the existing helpers deprecated. Internal log helpers should not be exposed to apps. > IOW with an example, cryptodev (missing a RTE_ prefix) CDEV_LOG_ERR > macro is publicly exposed. > A CDEV_LOG_LINE_ERR may be needed to avoid breaking external users. > RTE_CDEV_LOG_ERR should be available, though, right? :-) > > There are a lot of other log macros that let it to the callers to add > a trailing \n. > Should we convert them? I would think that, ideally, yes we should. > Converting the *whole* DPDK code to the new helper (with some > exceptions for people who like multiline logs..) would be nice to > close this topic once and for all. > But it would likely be a nightmare for later fixes that contain logs > and which could introduce regressions in such logs if the backport > does not take care of re-adding a \n. Good point. I wonder how many backports add new logs, or modify existing ones? Are there any automated checks, or a checklist for backports to enable us to catch these sort of things? Naming could be a problem, but we could look to move over existing logs by using new log macro names, which should help us to catch these. Even if the log names are a bit awkward, if they are kept internal-only, it shouldn't matter much. [Plus we would always be free to do a mass-rename back to the original name in future, once the backport issues are reduced]. /Bruce