From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 6BD5F375ACB for ; Wed, 8 Apr 2026 07:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775632568; cv=none; b=o457+YF4ttxrfmVUHOk/rIuEySzpeltWnvAe+bb5EHxsKchzciVw2HEwJ+gFH8Pppzd9uPgC8TBmDoHg5yVe4+QcvkbyXhFWGRHHjXLoUBSPzlDg5YF03R0UneNWCtKCNujzbyyUBivKu/nhi+WmAjwOoqUGOKiE5Jni9KUPGDE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775632568; c=relaxed/simple; bh=9mLuglNH3FKPjdhxyVkeCI6+TVHmop8uBQ9paa7GcNA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sGbTaByRvNOJjsroGxHlJop4OlBlTW/M18KiiPwwmtaxmWND9BfGb67m68q8/XOTyZG6JO0ViGEogqvHFYaNUUmxv6XzDP+7XSxFmZEV7OO6pfLlptQhCW24fh04KKYtigpzsRqtXROpBaYlh0dZpqhDH7aNP2W4l2oI81uwtgo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=anHkQLDv; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="anHkQLDv" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso37038175e9.2 for ; Wed, 08 Apr 2026 00:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1775632565; x=1776237365; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=+JSJPVJheZs+jLQNjabV2nmmAY4UsDd6PMBO0XLhv9Q=; b=anHkQLDvjlHd3vo6UVxRmhwMrwCO0zmvea4NFq6mCzyqkk6KbY6jUByGU4MsDXWU0J 1uMbWzAD2ekurp6Lk8RD+zdRhp2RueLg3FU7akoHKQB4RHNnT0AlCoc7RjkjTvjR+uus Cyug1yvRzu/U7xChVSPavun9AETIsLgXKQk0CE/f42S9sqL8mvPDb3dZrVW4NkK3fctx J/D1rDG6Mmot9alBeBSObJtPrKFR7Iy3gIUM+vWhf03fNHQvNba4U+Bs2DqvNg6DIf7s oRgt3jNTuteGtNT9YuvcdaMUtuNyizftwBtMPoc33cU9X87vQhUsKiQbBZM8mXm0H/Pj u4nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775632565; x=1776237365; h=in-reply-to:content-transfer-encoding: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=+JSJPVJheZs+jLQNjabV2nmmAY4UsDd6PMBO0XLhv9Q=; b=jgrOsA2GHH6k09A3CpmyW8ACCro/MIbK1K7ooM4rFyCWwSBIHHKq/wEG6PX4yXI23r PMDQmJWBIQ/wC5EQcu1+a0ciliVovHx67Izo0moYDE1Ue2G4+pGCPzlcCUQ4PuyCx8gM AnQY+UZykWtUSNoLrojUCJMPaj4zuwNpBh9G5AwTJXSnu0EAlQHV3yARsWIWvYRVccBM Dvdz9O63usZh8P9AXSWGan9iweiLNqg8FsRSfBA7rgwiyErcdwMP6OS46cl2G+Ad066H p+gju8+CfBMkIIFSw+N1Wun5IJs0VHU7wO/H6pCyviMIZLb5oMmW7Qar8O4RAJZCI+/H UDFg== X-Forwarded-Encrypted: i=1; AJvYcCUx4lie1BBkdSco/RMZEgQ034ZfE86iTx5abFtKc4NtcXTpqvkbPc9by4BLaKVsn480QkdIRBLNS842QUA=@vger.kernel.org X-Gm-Message-State: AOJu0YwgujAuFgZAefB27W013LtsN66MpYBTIi8GybnoYC/fIOx5kTos +R89X4jO4HwvKTw2N/l56v28pXLFhtMEEOv+rohVR/6vzMYSSkkMBrtjmH2JSlCXR8g= X-Gm-Gg: AeBDietSaqix2Ts8Gp60FMhF4itfyBonbKpJQc8xbo/OUf3VrNojFnI0pe9ouJXRZNB HeHH/a44nK9+8PJtlrZYoC4xCdj4RE0363hx7NVK0OQ560ifWEjnrnbQmVD0IDW/gdhAw/OYabT Cn8Azy4e3ujXoGTaq4T7ERsRJ18aQayagi/mY1y4dN+f6YmkUB2elmu/2FF3HjO3c/KWHGhop6q R3GSPoV2cK/TJLpJdQi8Hjf9u6EELPCwrHOgEkuvj/74ThjSptfUb9yJ1ikuMraMRNXbDeyf7l0 /X9xm7MyixMBQUJA+spKHhtZmHoUNDZSr0V9kgSrmAoyQ84C6Ti8oCPMp5OZy/Kp2q7FTDCtBY8 PqqVNuRyD0++5ekPeX1sNsj1btCmu29oS1Et3ClK1xledrjkk0vO1VzE6u7aLwNdIDQvDGuEYIg 68kpgBx+a42Fxm0aKv26daW5KJk7BpF7hbox4P X-Received: by 2002:a05:600c:4688:b0:488:b187:d8ed with SMTP id 5b1f17b1804b1-488b187e4admr133921165e9.2.1775632565324; Wed, 08 Apr 2026 00:16:05 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4888a72baa8sm475257995e9.15.2026.04.08.00.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 00:16:04 -0700 (PDT) Date: Wed, 8 Apr 2026 09:16:02 +0200 From: Petr Mladek To: Tamir Duberstein Cc: Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel test robot Subject: Re: [PATCH] printf: mark errptr() noinline Message-ID: References: <20260405-printf-test-old-gcc-v1-1-76d24d9bb60e@kernel.org> <20260406111531.779571d7@gandalf.local.home> <20260406123232.3dacbe94@gandalf.local.home> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue 2026-04-07 09:34:57, Tamir Duberstein wrote: > On Tue, Apr 7, 2026 at 7:27 AM Petr Mladek wrote: > > > > On Mon 2026-04-06 12:32:32, Steven Rostedt wrote: > > > On Mon, 6 Apr 2026 11:21:39 -0400 > > > Tamir Duberstein wrote: > > > > > > > Thanks Steve. IMO that is a very big hammer and not warranted in this > > > > case. There's been talk of encouraging distros to enable CONFIG_KUNIT > > > > by default [0], which would probably interact poorly with the change > > > > you propose. > > > > > > > > > > Branch profiling is really just a niche that is enabled specifically for > > > seeing all branches taken in the kernel. It hooks to all "if" statements! > > > As you can imagine, it causes a rather large overhead in performance. > > > > > > This option is only used by developers doing special analysis of their code > > > (namely me ;-). > > > > > > The only real concern I would have is if the kunit test developers would > > > want to use the branch profiling on their code, in which case my suggestion > > > would prevent that. > > > > I wonder if it might be possible to disable the branch profiling just > > for the printf_kunit.c as a compromise. > > > > Would "#undef if" in printf_kunit.c help? > > > > Or I see that DISABLE_BRANCH_PROFILING is an official > > way to disable the feature. > > > > I wonder if the following change would solve the problem. > > I am sorry, I could not test it easily. > > Yes, we can disable it for the whole file. I decided against that > because narrow workarounds are better than broad ones IMO, but it is > ultimately up to your preference. I might be wrong but I think that nobody would want to profile/optimize this kunit test. So, this looks like the best solution because it is straightforward. The variant adding "noinline" looks too hacky to me. > FWIW I did test that this patch fixes the problem in GCC 8.5.0. Thanks for testing. Would you like to prepare a proper patch or should I do so? Best Regards, Petr