From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC0F4EE4982 for ; Tue, 30 Dec 2025 16:18:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5344C10E92A; Tue, 30 Dec 2025 16:18:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cCJXCvE2"; dkim-atps=neutral Received: from mail-yx1-f41.google.com (mail-yx1-f41.google.com [74.125.224.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51EF410E92A for ; Tue, 30 Dec 2025 16:18:40 +0000 (UTC) Received: by mail-yx1-f41.google.com with SMTP id 956f58d0204a3-64472c71fc0so8308546d50.0 for ; Tue, 30 Dec 2025 08:18:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767111519; x=1767716319; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MPsyxbejDKzht/HLlmTw2OYeWbm6m6QfdKcYrQLdRPs=; b=cCJXCvE2PNoQLR1evpX/U3Nenyr5aEkanSYn7XVEAqkmD/bKJboHcsV4INE/t5B9/g 6vRDL2YFWWBfGRn4tY1TsBqBS/5fWHAFVYqr7PdpMHVsQywpV4O0LWwVWlSUJHhOnrKi ywm1vmEiSCfmT5bmxTGQLmXa9xNnhXTUcOpbm7IIk/KjGMWbc8DS6aVW/18sIWRCyMk5 x6/dhxYVAvP+aybtpY1lcq38OO6IKrYeSHpOJX9omWO8b9lkEAYbyDbjm7mGc6MrcNuN Nw2pyJFAr8v+d5MMO//2HW4AZc8MQJz7FQuUgE6U6f6NXJ0qz8WWGhv9kU6ryYEY5mMx qpig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767111519; x=1767716319; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MPsyxbejDKzht/HLlmTw2OYeWbm6m6QfdKcYrQLdRPs=; b=aPxBRUcmtD5JWxrdzao6PxvnAvMZpoYlcuiVmX6lsYoqdW6vzcsXe+4F1JbI6m6O3U odyoE+NPaD1i6aas1Zgqo8zz+8KFmbC6z6YRxYuDvDFDCzP6Wh0QzNjE7+Ltz8N9Q2fM +eqd/jYraogaXe+GdfuYWO7ixhzZCgwF9jpi1BRROHh4jLkRHRSI1Db4FqJ1vrZVuk6R F0KNHy/GyhlT5IGMYvZ7VAP8DsUbWafxzMabYnFWyjdhO8hjbvRb4CFDD07McJHWvlI0 8o1yzHaTV+SiHwan+uAHkBEuVIBv6mOgSenhncGRTrN+O8LJCp9pkN6KoXNSLdwhkbD0 +MKg== X-Forwarded-Encrypted: i=1; AJvYcCVMArLpvaT1791dNHC9iSLoeIRBXclDSVJtL7AmyiW9THxSYmAU+SfKMzxckvM1mWXfAmHMf6CP5Hg=@lists.freedesktop.org X-Gm-Message-State: AOJu0YyuXll/iUeiBFmRtIFKk9eoI6z2+0S84ozxvOl7vV1VCu+8WKwZ 6Wv3g4xt70rcaQT3n8P5qqsX0ll1vYktyK9Zoz7Ip5JaqHXRzu+r0gA8 X-Gm-Gg: AY/fxX5/gHD32cMWZzbm9SAXGLYYxKtq+WUIlcD8phgVfMkaJYujcAN8gaVh1dYYksS gF42FfUsnuAYJ3PhqcsilFv2bqJRvodtxVivUwXZ3iE9YURW1qspsxS6agKZSfvwBcdP7t42IM1 xpWDeoXdiGVOD8A1SyphZGxbFiJlXa2ZkNu2HOLMK8LKoikARd19uHKrKYJ8t9mweZSU4MODLL3 4jdNUo7JiIshybEdKs0ucAF4TxTBecdRXVcpZvhNQLz5HGN0j4U/H+M752mB7McWGGSrT1L+M4J qorO2SfUqweZpiESiSxMkKfirVVNrclxjo0HBHui4rIo0IL8gKeQrFg/xpJ+YDN/fYS0+FsRL8+ ESakUQ1vElu08mQiNmEFAgXVhWGyaGx0JdofOE3aBGvOQmO6gKMEZqvY/IuKANU1vl5CaGelS1H 8G3FqOrwA= X-Google-Smtp-Source: AGHT+IEgiqEBna6+E3gk4ji1N98UDvQ4ZQ6HTSlvv4L7zUJHLtl+Nax+qoAvUGugh8jqgLuKhXifXA== X-Received: by 2002:a05:690e:11c7:b0:644:6adf:cbf0 with SMTP id 956f58d0204a3-6466a8e6db0mr24510128d50.92.1767111518890; Tue, 30 Dec 2025 08:18:38 -0800 (PST) Received: from localhost ([2601:346:0:79bd:79bc:cbcc:ae9e:6e4e]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78fb44f0670sm126746507b3.26.2025.12.30.08.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Dec 2025 08:18:38 -0800 (PST) Date: Tue, 30 Dec 2025 11:18:37 -0500 From: Yury Norov To: Mathieu Desnoyers Cc: Andy Shevchenko , Steven Rostedt , Andrew Morton , Masami Hiramatsu , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH v4 7/7] kernel.h: drop trace_printk.h Message-ID: References: <20251225170930.1151781-1-yury.norov@gmail.com> <20251225170930.1151781-8-yury.norov@gmail.com> <20251226115848.298465d4@gandalf.local.home> <20251228133150.1d5731d04bc1b685b0fe81c1@linux-foundation.org> <20251229111748.3ba66311@gandalf.local.home> <9833cb61-1ec5-4cc1-ad9d-3e07f3deff80@efficios.com> <71767aa7-0247-4bcc-8746-3338905197b3@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71767aa7-0247-4bcc-8746-3338905197b3@efficios.com> X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Dec 30, 2025 at 09:21:00AM -0500, Mathieu Desnoyers wrote: > On 2025-12-30 03:55, Andy Shevchenko wrote: > > On Mon, Dec 29, 2025 at 05:25:08PM -0500, Mathieu Desnoyers wrote: > > > > ... > > > > > One possible compromise would be to move it to its own header file, > > > and introduce a CONFIG_TRACE_PRINTK Kconfig option (default Y) that > > > would surround an include from linux/kernel.h with a preprocessor > > > conditional. We already have CONFIG_TRACING, and everything in the new trace_printk.h is conditional on it. We can protect the header in kernel.h with the same config. > > > But please make sure the default stays as it is today: > > > include the trace printk header by default. > > > > "by default" where exactly? Seemingly nowhere. > > The problem is that kernel.h is a total mess and > > it's included in a lot of mysterious ways (indirectly), Yes! > > and in C you _must_ > > include a header anyway for a custom API, just define *which* one. > > This patch series moves the guts of trace_printk into its own header > file, which reduces clutter. So that's already progress. :) > > > > > Based on the Steven's first replies I see a compromise in having it inside > > printk.h. If you want to debug something with printf() (in general) the same > > header should provide all species. Do you agree? It may sound logical, but I don't like this idea. Printk() is used for debugging by everyone, but its main goal is to communicate to userspace and between different parts of the kernel. Notice how all debugging and development API in linux/pritnk.h is protected with the corresponding ifdefery. Contrary to that, trace_printk() is a purely debugging feature. There's no use for it after the debugging is done. (Or I missed something?) Everyone admits that kernel.h is a mess. Particularly, it's a mess of development and production features. So, moving trace_printk() from an already messy kernel.h to a less messy printk.h - to me it looks like spreading the mess. > I don't have a strong opinion about including trace_printk.h from either > kernel.h or printk.h. As long as it's still included by a default kernel > config the same way it has been documented/used since 2009. Can you please point to the documentation and quote the exact piece stating that? Git history points to the commit 40ada30f9621f from Ingo that decouples tracers from DEBUG_KERNEL, and the following 422d3c7a577 from Kosaki that force-enables the new TRACING_SUPPORT regardless of the DEBUG_KERNEL state. To me, decoupling tracing from DEBUG_KERNEL looks accidental rather than intentional. So maybe simply restore that dependency? Currently, even with tinyconfig, DEBUG_KERNEL is enabled (via EXPERT). And even if EXPERT and DEBUG_KERNEL are off, tracers are still enabled. This doesn't look right... Thanks, Yury