From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 68A7B3358CA for ; Tue, 17 Feb 2026 11:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771329109; cv=none; b=YkKn8fPEuKg+v1CbCKVCjQAH9oh5wwjJbQKdG0M6vy3o0axvw+/DjA2AGRy+YuvoVJLuNrYeCHSy6vyiahAsf/wZKGf/A6rSYD/OdobNRO+13+24f2iD1t9MMM4vFOEQ2jRGMNf7FuiiuuIHE2hUs4EIq/qT7+2tKAjpj4q76Uw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771329109; c=relaxed/simple; bh=lKNMxEkRN8ssZV3/fpSaReV0VtNJMK+36i5Se75SbFA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aoDCvTehfwO0y8cQLoGyabny5MLf6ufKHfvxp8qdgPBVdK8k6aZ8qhblMX57tinQnFd03yhlmTfM38+DaRYf7QifhfAUOqrstT6h4jH67wyFnGXffnQOicZgnJTWNcQcIp0erDxGCM1IvxKApKe0EFjKSeYU4OkG4+1wP2HHGD4= 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=LahBN3eI; arc=none smtp.client-ip=209.85.128.41 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="LahBN3eI" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4806bf39419so44077495e9.1 for ; Tue, 17 Feb 2026 03:51:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771329105; x=1771933905; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=udmYRegY9iHsKpFnmPtRRfpSD5OYJkQlQt9s34Jgq80=; b=LahBN3eIqYEbyaSuWPBdWKfpFwMJf9WXnv+gie4W0Ab+gD2C1yDiJDUQZkvdP8FmAH Uy8SxxLUyByMccKrM0hzuRutTGOvV//XW8+h1aIPiXZ0CrKrpqxNIzXh1AfJrCUJ8qjG 5+AO9zibhBaamzaP7c3NBT5CgRK7kS5Ms48OmzkgPwgE4eByLzYp1vCVPHBZEs6fEnk7 d/Z7MtQFaLWqfzVWuCuX9ItyejjYdS1jz5QEezKw5cw3Bk4/C4Cym/Dsx3bfmoSZqsNA lCWWmsUbUBF8lFtKQJOthXAr7w0VKfgg4tOxCV0CCgrz/5VSXsR5qciE/+bRFkD78Wr5 XDJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771329105; x=1771933905; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=udmYRegY9iHsKpFnmPtRRfpSD5OYJkQlQt9s34Jgq80=; b=thnzErVSzzDittNdTgL56XW15mHgkBcVJSDUN3VasAttGvh4ujFysooWP8kyedBo0C 9gXHeon0pV7nnyF9HcI9FmDMm81xlR2nuLyirHgkSLwjmT9gq9ovsZ+S6mf1LeP4Aurc i7BEMlRIifVaT3CwC1SXsSC3alD1SoHKUi1emIlkG8hvUPdNrkfuyrghrSqLfusLZaDl MuqcFfNU3kq0BOFVhuCyw4Id6mTIVMcaM1syrOpZi0AOb1KQ4JfW2AH22Rd3oL3vWCFs B2JAfIh1NY6zC9ffJ3d0XrVKuZeCbk13tUmgorCAPvAETghJOoPneQK3qG8XZ6YQMk/Y Apvw== X-Forwarded-Encrypted: i=1; AJvYcCXEaAX8agyZdTi1I7pm5Izcs278ZOZqr9JW/h+iQfPJrapy60rJYmlOZ/Q6fQZNhUqrD/pbHs1IS3DXB8M=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7o+RHwdLnKKfrO3hLLSEZb1cKNuPY8E8o4vqdp/f1zO+kLsJd z1z6QRX2jIEo6xWXts64dP217hIefOPvMKBWu3l23B/hx9X+BsIoC1Ex X-Gm-Gg: AZuq6aJsn2GDI/4apmqvdVQYyFCLUKL+n5OPGwTFhKec6ZBYoKZNSYVWRLkj4yO5ALd QrNFaE/NgokgHBukCVFN/GzJMCVpFCobIxDVjQf5rJtupzwrjVs8t5mCVORZk9vdF8NPpfht+V8 QM70C5Qka8zkVr3AQmASYfLfnQ2NIasIgsEGAioxLGMJo1THSKMELegf3yI7WsHp2f4g81j1r+K h331nOGmRA+PtD2uz/p61P69LlJ9kjSmpJA51LX4Dhsww+87KqxXI8/7hanQHf4JC6jDWiFCH+m qENx795IjWedh0G7NRyfvWnva9sC41WWx/4ti7yeceEh/vf/6K82of+baKw2F5bNvKtLIm7njeT XTGVQMKyyNiRvLuL1wwiJ9rX6k2pngqEXl2gEDc0Xa60TUn8wBpeiOX85zDTE4UTAiqtllamMRD Zos0IGmA8O/anNR3yXUsAXfqgHW7yUpw3yrlT5+rBsT9Pr98gK812iCr8lC5TYwxY7 X-Received: by 2002:a05:600c:4446:b0:47e:e38b:a83 with SMTP id 5b1f17b1804b1-48378d62a9emr177669095e9.7.1771329105120; Tue, 17 Feb 2026 03:51:45 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac8d82sm33787426f8f.31.2026.02.17.03.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Feb 2026 03:51:44 -0800 (PST) Date: Tue, 17 Feb 2026 11:51:43 +0000 From: David Laight To: Thomas =?UTF-8?B?V2Vpw59zY2h1aA==?= Cc: Willy Tarreau , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v2 next 03/11] tools/nolibc/printf: Add buffering to vfprintf() callback. Message-ID: <20260217115143.2fa77a3e@pumpkin> In-Reply-To: References: <20260206191121.3602-1-david.laight.linux@gmail.com> <20260206191121.3602-4-david.laight.linux@gmail.com> <20260207233651.577f0fcb@pumpkin> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: quoted-printable On Mon, 16 Feb 2026 20:07:35 +0100 Thomas Wei=C3=9Fschuh wrote: > On 2026-02-07 23:36:51+0000, David Laight wrote: > > On Sat, 7 Feb 2026 20:29:34 +0100 > > Willy Tarreau wrote: > > =20 > > > On Fri, Feb 06, 2026 at 07:11:13PM +0000, david.laight.linux@gmail.co= m wrote: =20 > > > > From: David Laight > > > >=20 > > > > Add per-call buffering to the vprintf() callback. > > > > While this adds some extra code it will speed things up and > > > > makes a massive difference to anyone looking at strace output. =20 > > >=20 > > > This patch alone adds more than 200 extra bytes to the smallest binary > > > for something that was never expressed as a need by users: > > >=20 > > > $ size hello-patch* > > > text data bss dec hex filename > > > 1859 48 24 1931 78b hello-patch1 > > > 2071 48 24 2143 85f hello-patch2 > > >=20 > > > I doubt it would make sense to have a build option to choose this. > > > Or alternately one could decide do disable it when __OPTIMIZE_SIZE__ > > > is defined. I just tried quickly and it does the job: =20 > >=20 > > That probably makes sense. > > For anything non-trivial the extra size is noise. > > Actually is would be easier to read with a single #if covering the > > whole lot. =20 >=20 > While I like the slimmer strace output, the added complexity, including > a different implementation for __OPTIMIZE_SIZE__ is a bit scary. > Could we leave this out for now and work on it on its own? I might move it later in the patch series. I plan to add a #define that can select some of the extra features. Basically making bits from 'flags' makes the compiler optimise the associated code away - so 0 =3D> no options and -1 =3D> all options. But you also set '-' (with the quotes) to get just left alignment or '-', '.' to get left alignment and zero pad. I can use a character (that misses a flag -eg 'b') to enable buffering. I thought about being able to disable features, but the requirement is only really to make small programs very small (but they may want one extra bit), the 400(ish) bytes that everything adds isn't that significant for anything non-trivial. (Oh and that is 400 for this version, with 'nothing' it is smaller that the old version). David >=20 >=20 > Thomas >=20