From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796330550; b=OB+7WNCYSFLyRfkdlrsQb9AzsRYNTQnCIZpWGIJcU/p/fGCg6gYB9jgZPUMbWPBi4N78 2km7RikdBBdJmqD2xODc76fDVjQOuEIV6ykzo6+iRqCFehpM6yV7E42TaCqeBjAH0ILOm TsfVII++nEEujz+Xj3j6yavuzIQiY+e4KJu1UtFXnMOKcwrwjycGIzZqfHdi9JoBfkHzl SJGcNVFpwhSIv2dJzHKeXY2C34xS7jNRWQ6UE7vMDCcVQz7sBgVllNkkgOCg1YvYfBF9W IlqC6cN5R+TP4GBH8QHyqVZRhIe8snJyBctVJ73hzFqtWlVgpkW2AnwhJ6kQIS3EB/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796330550; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=nW+oPv79LyuSUNsVUpGa9A9XEmaa4m+b47jHT1EKBmI=; b=ewXLEKmZ4KW8SjwKDmzINiqTVlCCe4NGD6Q5p940fa/Yf9DCQCe3wpGkFXWBYOWNPjNF 4jbFGsVJjMgpaLdj2nySWQ49nXVCOljVMCA8rjtBMKSENi2uEaqNX3srRQMNak79R9wE2 Q9EaCzSEamhxug2Y06O5KO2/fhoFaYwgt0vtwSUOdiWBnPLvXKB4NSQCFnH0i3fQEcKtU E01YfTtA6RfaRhQ58GEU753YhlaWcbcEocWu3cKmLvOxZ21ldAo9UiRZLWHByZuarrzD4 Hy5sl1BYqRoBYVg0/qQAtzAOGB5G42lpwif2YyISU92cmgSRWYAY/6G/OSJf56dP6ug== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F2vGT5G4; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 246C7606A338; Thu, 3 Dec 2026 20:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F2vGT5G4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED1631F00935; Thu, 3 Dec 2026 20:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796330549; bh=nW+oPv79LyuSUNsVUpGa9A9XEmaa4m+b47jHT1EKBmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=F2vGT5G42YM9GkD+0XAqYCrGriJLlAWq3GTF5Q16zMwT8pEEGMwGv1zMPNTYm5XKv Rx1tRnvHB7dWFdZzsftJ/VJqVdPz6HnU1cy9nOxsSbYpD4+XNdXWP2JnAcUnSiGiH8 JhFKz1f8ZZAGiWuvCWZ3sbMyFdVE3dA+YWegMOWd/TSess0EKe2y7RKDtq7bXGQMCl wlgsN7bqn4xKAVcrkfJ20IUfJKO5HTnSxiJvqfr8AAWhWT/tDQk6Pf1/Rcg3SAS+s5 lFv+befY3acj9IygMOFHDua8AKbomw5u2UHvNQZC/xX4n6WcUSMXUmybLRYf0nI9LT PHboci6d5Z/rA== Date: Thu, 3 Dec 2026 12:42:27 -0800 From: Namhyung Kim To: Peter Zijlstra Cc: Ian Rogers , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , James Clark , Athira Rajeev , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , Ihor Solodrai , Leo Yan , Dmitry Vyukov , "Steinar H . Gunderson" , Stephen Brennan , Thomas Falcon , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 03/19] perf/uapi: Add BUILD_ID_OFFSET sample types to UAPI Message-ID: References: <20261125005108.1020003-1-irogers@google.com> <20261125005108.1020003-4-irogers@google.com> <20261125132512.GB2668804@noisy.programming.kicks-ass.net> <20261130193846.3582553-1-irogers@google.com> <20261201081435.GD2883950@noisy.programming.kicks-ass.net> <20261202103327.GG2883950@noisy.programming.kicks-ass.net> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261202103327.GG2883950@noisy.programming.kicks-ass.net> On Wed, Dec 02, 2026 at 11:33:27AM +0100, Peter Zijlstra wrote: > On Tue, Dec 01, 2026 at 09:10:49AM -0800, Ian Rogers wrote: > > > > > Which aspect is the main objection here -- the 8-bit/56-bit packing, > > > > the per-sample deduplication in the kernel, or repeating build IDs per > > > > sample instead of a sideband mapping? > > > > > > Like I just replied; I don't see why we need it at all; we already have > > > buildid in the mmap sideband data. That is sufficient to reconstruct at > > > post processing. > > > > The point of having build ID + offset in samples is to avoid needing > > MMAP2 sideband and /proc synthesis altogether -- with a symbol server / > > debuginfod, samples carry everything needed to symbolize without > > tracking every process's address space. > > > > Relying on MMAP2 sideband only gives new mappings; for system-wide > > profiling, perf still has to crawl /proc//maps for every existing > > task at startup and record every subsequent mmap/fork across the > > machine, even for processes that are never sampled. On large > > consolidated servers that overhead is substantial: > > > > - For infrequent system-wide events (e.g. bus lock), synthesizing and > > recording all system-wide mmaps dwarfs the cost and size of the > > actual samples. > > - Even for high-frequency events like cycles, on a large server with > > lots of consolidated work we see over half of perf.data consisting of > > mmap events, and that share keeps growing as more work (including > > guest VMs / containers) is consolidated onto larger machines. > > - On a loaded machine, just allocating the procfs inodes to scan > > /proc//maps at perf startup can trigger memory reclaim and > > latency spikes -- worst when you are profiling a machine because it > > is already under stress. > > > > So build ID + offset samples make sense today for infrequent > > system-wide events (like bus lock) and for profiling machines under > > stress without an upfront synthesis storm (reusing the kernel's > > existing stack_map_get_build_id_offset() helper via defer_callchain). > > > > Longer term, for general profiling this also lets us optimize sideband > > overhead by running two events -- one with build ID + offset and one > > with raw virtual addresses -- starting with build-ID samples while > > lazily synthesizing mappings in the background, then switching over to > > compact virtual-address samples once mappings are ready. > > > > Given those use cases, is your objection specifically to the packed > > table encoding in v4 (where a simpler UAPI layout could work), or to > > having build-ID + offset samples in perf at all? > > Bah. So realistically buildid *never* changes vs the frequency of > samples. Adding buildid into samples is utterly insane from that > perspective. > > Additionally, the whole buildid thing is an utter shitshow when trying > to do it from sample context. > > So I really don't want buildid from sample context. It doesn't make > sense on so many levels. Right, that's why this patchset tries to do it in the deferred context. Having build-id in sample may be inefficient, agreed. But it could open new opportunities too. I'm thinking of paravirt KVM profiling where guest samples come with build-ID. Of course there will be many other issues but I think this could help much. > > I would much rather invest in better means of doing that initial setup. > Eg. would it help to have UNMAP events for executable mappings (that > contain the buildid of what was)? I'm not sure.. but it won't be useful for long running processes not calling munmap. Thanks, Namhyung