From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABC4931158A for ; Thu, 18 Dec 2025 05:42:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766036574; cv=none; b=c6i1Gxp6y/aXaCXwba0j2afbzzJwE2cOB/SXXPkoi1NXBbxqXazk2wueMy4T+2rCwuDMM3Skv5EsO1TLctRwXAHQ6e1Mv8FCDIPYeCIci9+W/a0H9D6g0eCHI9qWzBY0wF2JXJTY4xOorr+h00AQ5da6gydpsL2kMz08gv4rCtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766036574; c=relaxed/simple; bh=1WKmwxIykHwtmPt6271x4VTejLBDKzjIsnD15tHvQrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fETNtEN/OoQsZqKeFseZyV5wwhino5kD25SF3/CSBfiBqEv+r9hikp0jwivi82yyuHGaJnze4ROUyyUr0MV56KSXtzPWkg9fbh6mH60MFOZmIOdVkQipAA2QIhCtRa6SJ+d1aHCL+bB1R8k9r9fuSryvGQbzP2MOc4rvFE5UbiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N9BDO9t7; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N9BDO9t7" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-34c3cb504efso282173a91.2 for ; Wed, 17 Dec 2025 21:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766036571; x=1766641371; darn=vger.kernel.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=yaGJpOKqg8zQltJlD/AWg9VGkTrfZMf+YGQyTVj+MTg=; b=N9BDO9t7sSryMKcUoFh8Kax8ccoWkOv50F+aF/twxNOCQgdPuCzCV0tP00FIIzP4JD g3QQ6Mb6GrU7bytZASqSuIKc688bcbP1ASc+rAn9gy1zmPh2vKvHAgM687Kg0q88RMTi s1dMHskBneS7w6LlaFgyfUf+SJdqWZyhKAjciMo0hPDRfUuyHK0TP14qHDC5/IoYgcdd 1AlSxoiVX5RvpsQYGzS2QNAnFHkgOP5ShFnZMqX4HvvlSwzdJm0sKHczNFIU2kyRYzSv /JGQ87JuyaBLZs1RCiAVCXAGSifjsRvL1oIi2HKWcYjRdO6YiH6P8scdsQKNAdQZ5afN DONA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766036571; x=1766641371; 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=yaGJpOKqg8zQltJlD/AWg9VGkTrfZMf+YGQyTVj+MTg=; b=Y3+FCylXKs+tF/jpvQ+j/lkEhkKclcPoNjqNvtB7eGmHPFqSgyEGQINydGPXYKEGGN UFnAdl9ruR4sOncEx+dwaNkWmVu5tnhG49PIAFNCXQdyeDnkHqnUZlreNxx4wfXkElmn eGcQhBPEjEGjPlxRKmlfqiIlllYz5LklRzkEspr88l38NENQLLN4NTLRhiKLbduKpfqM 5J1fVP3wE9avVAt6FlLh+uEvgHbkcFYD9k96p49JyFLSQgZJ4pMMxrN4aQXv3kQfxoBr yWEJbTB/OY+JqYJypYoS9PuCn/8u8+ooSuqCT0c/AM3dXKqBMhxzNCAVmcE7vqxTVXvI oHNg== X-Forwarded-Encrypted: i=1; AJvYcCXHnWQmShAIN9DdvRPf4Kq+LcHmD4O0FLn+9b2/8WDgDbfs0YJNfBoTheUAH27iccavR86/X2vn4lime98=@vger.kernel.org X-Gm-Message-State: AOJu0YziD71QhEOaKpvmtD8u+Oyh28kRhfnjSBkUMxkvIjK806zCBWJY Fz6dsOxlFTJyQFMolQ3fttEOGPSlRxMKfcibbydQUb4sUnUv1K6026VUJkLfVw== X-Gm-Gg: AY/fxX5udSDxFehK5Fp+bIQw8+7i6mrx8Mdmpj4P2GtQmybu1N/ZoIY5wHqgV2JlJaH BsO8onjbnqfmDbjTEW7S4C2yvjPx1fK3kOoOirog7ZvZT7RX9TdkeijVgSWmrIscaPFMXKrjCHv xXLjowuUvsrZYzPkYTMBoHHU4EgIfByp+y/iVDCELZY1QQSWI8gQ6h8N3z3dNlQJkt1kIIHF6lC SPBLgxUBMzm5y5pjbCdq2kXRrMsnnSdIwTyE/827cS0ePt6xiVqLCm1rLVDWe7tBQRzI49g3uZg bfzBMgB7dGon93ErRxBgD2BGB4sHQ9nR28rrObaAZvvlMYEafcmVNMctskJWnlvOpNnQCu0Uaiu 3LURkttSQcR4cBVM0xwKQltlbqExshse2lgqRtwxorebPQWizQvefksnSTCM+ooQC5WSIv6jk7X CALcqzDNo= X-Google-Smtp-Source: AGHT+IHIeJZ6pUO0IWI3BZr8YKRR4WYcObEmm4ye3CL4DoHkOxJXpQslAZeBIjOMe9+OleYRLYL1Lg== X-Received: by 2002:a53:a090:0:b0:63f:bd67:7c52 with SMTP id 956f58d0204a3-645555e7c66mr12186194d50.29.1766030374328; Wed, 17 Dec 2025 19:59:34 -0800 (PST) Received: from localhost ([2601:346:0:79bd:52c0:aec0:bf15:a891]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-646636e8a2csm581612d50.4.2025.12.17.19.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 19:59:33 -0800 (PST) Date: Wed, 17 Dec 2025 22:59:33 -0500 From: Yury Norov To: Randy Dunlap Cc: Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , 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, Kees Cook Subject: Re: [PATCH v3 4/4] tracing: move tracing declarations from kernel.h to a dedicated header Message-ID: References: <20251205175237.242022-1-yury.norov@gmail.com> <20251205175237.242022-5-yury.norov@gmail.com> <20251216161316.45b3f19ff0ad482018137189@linux-foundation.org> <55ceb7bf-0fe9-4edc-81c2-d51366847eec@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55ceb7bf-0fe9-4edc-81c2-d51366847eec@infradead.org> On Tue, Dec 16, 2025 at 09:24:55PM -0800, Randy Dunlap wrote: > [adding Kees] > > On 12/16/25 4:13 PM, Andrew Morton wrote: > > On Fri, 5 Dec 2025 12:52:35 -0500 "Yury Norov (NVIDIA)" wrote: > > > >> Tracing is a half of the kernel.h in terms of LOCs, although it's > >> a self-consistent part. It is intended for quick debugging purposes > >> and isn't used by the normal tracing utilities. > >> > >> Move it to a separate header. If someone needs to just throw a > >> trace_printk() in their driver, they will not have to pull all > >> the heavy tracing machinery. > >> > >> This is a pure move, except for removing a few 'extern's. > >> > > Hm, for a pure move, this shouldn't be necessary. Anyway, not using > FORTIFY in purgatory.o fixes this build error. > Or maybe there's a better answer. > > --- > arch/x86/purgatory/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/arch/x86/purgatory/Makefile > +++ b/arch/x86/purgatory/Makefile > @@ -62,7 +62,7 @@ PURGATORY_CFLAGS_REMOVE += $(CC_FLAGS_C > endif > > CFLAGS_REMOVE_purgatory.o += $(PURGATORY_CFLAGS_REMOVE) > -CFLAGS_purgatory.o += $(PURGATORY_CFLAGS) > +CFLAGS_purgatory.o += $(PURGATORY_CFLAGS) -D__NO_FORTIFY > > CFLAGS_REMOVE_sha256.o += $(PURGATORY_CFLAGS_REMOVE) > CFLAGS_sha256.o += $(PURGATORY_CFLAGS) That happened because the new trace_printk.h includes string.h for strlen(), so all kernel.h users now indirectly include it, and it causes, seemingly, a circular dependency if FORTIFY is enabled. A fix would be dropping trace_printk.h from kernel.h, or switching the only user of string.h, trace_puts(), to __builtin_strlen(). Notice, Andy has concerned about this on the previous round, and also suggested __builtin_strlen(): https://lkml.org/lkml/2025/12/3/910 I deem to drop trace_printk.h from kernel.h - it is more aligned with the idea of unloading the header. The original motivation to keep trace_printk.h in kernel.h was just because a similar printk.h is living there. But after all, this is a purely debugging header, so no need for almost every C file to bear debugging stuff. I can actually do both - switch to an intrinsic and drop the header. Guys, please let me know what do you thing. Thanks, Yury