From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94C182BE02A; Thu, 12 Mar 2026 15:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773330813; cv=none; b=isfAZ/e1wsUr9EKAdIijQW+bfWF/GAOurjrukC7vsBBJciL5XKulxL+4VBGKJOH6bS7qw5Ep1PHqm+XW+52+7ZNFPUcoYPgs3VPN/xKnv4PvVgOZVdPM2cmnWgQthajX2uI+ise3sf2EunA07QBDxrX6xIu/GS+r8PkuNSZkIXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773330813; c=relaxed/simple; bh=PkJcY5jw3a/IMyywYskRQhFWglzwewQyVwQJhJNMB14=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uEwStlk8ZgB5bu8LSqakDOgX/qOmA+iY6iZX88eV2sHAlem4qEVZnL+6cCZAvbR8PVpUq/isakLMPxTTTT23XNGU4W6ZF1gaPkn+u+GinJ3m+wNwZuUZ094x7LudMyZCe1RqDphca2exTIKS2QLzcDFnIafWr2Hfrjz27KJ2P+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=P6jfkVRh; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="P6jfkVRh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=5pK/vbHjomF7ZCz8kPkvw2tTjUJzJ46B59krQRBArKA=; b=P6jfkVRhJlvjsFD7S+pYuzAuv4 MLDDYDxGdAfivMXXxo/ZUVApw1nd+jENAw0Lyqc4uWfI7XnqjHOAqA7ttXYJsxG4TAasEr7BjpDWo aIeA1snKPi45aV1ULkpxeeIBktxDuhCSFmRpLsMt1+ttYrsG44v3EOWhuPyWXdpRzlHxyEOn74GDA Z1CGVzkjGPeaU2YAiJd8rj+ihgYeubYRKoTBEzXo+qEnQBbcOv9+Up7MVLIY/DcZTAGZThMyG8xOO o5W6SO+boLGEUOkS89Aq38o86dricntUVfJsA834gNk6HDFKQEuSPpArtEtoOedubfSWkO9Rzjeky ZIr57Svw==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0iLn-00000001W9W-22gb; Thu, 12 Mar 2026 15:53:27 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6325030049C; Thu, 12 Mar 2026 16:53:26 +0100 (CET) Date: Thu, 12 Mar 2026 16:53:26 +0100 From: Peter Zijlstra To: Vineeth Remanan Pillai Cc: Steven Rostedt , Dmitry Ilvokhin , Masami Hiramatsu , Mathieu Desnoyers , Ingo Molnar , Jens Axboe , io-uring@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Marcelo Ricardo Leitner , Xin Long , Jon Maloy , Aaron Conole , Eelco Chaudron , Ilya Maximets , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-sctp@vger.kernel.org, tipc-discussion@lists.sourceforge.net, dev@openvswitch.org, Oded Gabbay , Koby Elbaz , dri-devel@lists.freedesktop.org, "Rafael J. Wysocki" , Viresh Kumar , "Gautham R. Shenoy" , Huang Rui , Mario Limonciello , Len Brown , Srinivas Pandruvada , linux-pm@vger.kernel.org, MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Christian =?iso-8859-1?Q?K=F6nig?= , Sumit Semwal , linaro-mm-sig@lists.linaro.org, Eddie James , Andrew Jeffery , Joel Stanley , linux-fsi@lists.ozlabs.org, David Airlie , Simona Vetter , Alex Deucher , Danilo Krummrich , Matthew Brost , Philipp Stanner , Harry Wentland , Leo Li , amd-gfx@lists.freedesktop.org, Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Wolfram Sang , linux-i2c@vger.kernel.org, Mark Brown , Michael Hennerich , Nuno =?iso-8859-1?Q?S=E1?= , linux-spi@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Chris Mason , David Sterba , linux-btrfs@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/15] tracepoint: Add trace_invoke_##name() API Message-ID: <20260312155326.GB1282955@noisy.programming.kicks-ass.net> References: <20260312150523.2054552-1-vineeth@bitbyteword.org> <20260312150523.2054552-2-vineeth@bitbyteword.org> <20260312111255.7925b4e2@gandalf.local.home> Precedence: bulk X-Mailing-List: io-uring@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 Thu, Mar 12, 2026 at 11:39:06AM -0400, Vineeth Remanan Pillai wrote: > On Thu, Mar 12, 2026 at 11:13 AM Steven Rostedt wrote: > > > > On Thu, 12 Mar 2026 11:04:56 -0400 > > "Vineeth Pillai (Google)" wrote: > > > > > Add trace_invoke_##name() as a companion to trace_##name(). When a > > > caller already guards a tracepoint with an explicit enabled check: > > > > > > if (trace_foo_enabled() && cond) > > > trace_foo(args); > > > > > > trace_foo() internally repeats the static_branch_unlikely() test, which > > > the compiler cannot fold since static branches are patched binary > > > instructions. This results in two static-branch evaluations for every > > > guarded call site. > > > > > > trace_invoke_##name() calls __do_trace_##name() directly, skipping the > > > redundant static-branch re-check. This avoids leaking the internal > > > __do_trace_##name() symbol into call sites while still eliminating the > > > double evaluation: > > > > > > if (trace_foo_enabled() && cond) > > > trace_invoke_foo(args); /* calls __do_trace_foo() directly */ > > > > > > Three locations are updated: > > > - __DECLARE_TRACE: invoke form omits static_branch_unlikely, retains > > > the LOCKDEP RCU-watching assertion. > > > - __DECLARE_TRACE_SYSCALL: same, plus retains might_fault(). > > > - !TRACEPOINTS_ENABLED stub: empty no-op so callers compile cleanly > > > when tracepoints are compiled out. > > > > > > Suggested-by: Steven Rostedt > > > Suggested-by: Peter Zijlstra > > > Signed-off-by: Vineeth Pillai (Google) > > > Assisted-by: Claude:claude-sonnet-4-6 > > > > I'm guessing Claude helped with the other patches. Did it really help with this one? > > > > Claude wrote and build tested the whole series based on my guidance > and prompt :-). I verified the series before sending it out, but > claude did the initial work. That seems like an unreasonable waste of energy. You could've had claude write a Coccinelle script for you and saved a ton of tokens.