From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796067531; b=LcVRT6+jkjEXbdNL0jYiqefKITxeMJDgJfoyAf52WMkxokJFQKjoRKPMcqb50RWH3A7G sMVTSwA7+9gCbJTP4nNm7rS31Y1hk+2TIRq21olJlDOmWWGGm6Fuu+qP6DXU8svLL6Ytb qPy8J4Ce7Y2eFaquwGIvwahZBJ4trwo/xbLvZQs1RKwQKrqziuzPGHFFos8wQhljnGHKF bzFmt9snsK+k+LDv+HKXJRnkIhu3TIbPQ30H71MbHvFkJEMc0goX9UckMEWT/flond0/y TmiLImQws8Ny+YkBq4XHSD9mRiwF5gDUWJmASiM1a/CjxF6uZ6HqMD+3geWhox139pw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796067531; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=OgyKRdew/anBh22YiyV6T+R0i8x8rXm/Lcs3lpd7X20=; b=p1nocvCZQZh5iPDZ+5MALSG3TvLU0m3zu8lDkYG8UeM2kAw5Yj4WxyZ2CJIqTt6eKBJS 4RTE0Gvm9gecYwmGuoOtXJJxTeryp96J/eQTBMNdoFvhXYSkDzNqrNPWLEmxUBtf6rdx3 qNE7PdjtWWLwMDytgRqum7AZWkI6A4kexMXuaTLQLxA5ISDZFiQ0APDNGDeaTbr9eRGR1 P61861rhpruvFTrdKK2X36YQQCh7BHpoaR2tiy4s9oSwOJbSs7UUrF8ZdyyX1/7ggdnuO RiKXdq88SfC88GQFhYG/PbI+QM1VFDOPZA38jaYt22CKIHVqjJBET1xO5tPn72UDsQA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=mdrhfiDs; arc=none smtp.remote-ip=74.125.82.200 Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16C97606A327 for ; Mon, 30 Nov 2026 19:38:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 16C97606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=mdrhfiDs Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-33c35f5ca6cso12812134eec.1 for ; Mon, 30 Nov 2026 11:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796067530; x=1796672330; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=OgyKRdew/anBh22YiyV6T+R0i8x8rXm/Lcs3lpd7X20=; b=mdrhfiDsE1G9li5sVJhqE1YJtD6QGuF1qwbdskHxQ35kpSaDl7XbwSIgQ8jGV6Sws4 b8k5YAK2NFBEIoUI2CVTfjmOce5CgLTGW60vFsw/Hj+ciwHm+FeRAA6+Yu6xEkvFHX6e rYuaUqJKDQnt7csfm9+fYwwW1B9vbYp+NDMMgpSWGUX1Ykf4cFgZ/Dl/mh1jrO24c/1T L7Q4oC+q9FoVTqpAKtGU+tQZfLHoUMwqBV+L3yO5uNx+ykq39veW5fcfNvDK8UqCOSIE 3oxTcRopurzQSOm5X+cdcRv1q++bgcMC50h7A6nVwH2DiAMCA9qrSspynhRytOB6mBhq /XVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796067530; x=1796672330; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OgyKRdew/anBh22YiyV6T+R0i8x8rXm/Lcs3lpd7X20=; b=FYh9NMt7zBuwCi4n9AlEj/EHDimmP9KxnOOBAJPt9CrYlM/L3NQb06qZpWZUIi9iib YZ1+XCpnvAcQn0MkmPPAdY7dT9I3pSKY3ItYmJ9yIM6WNZaynqWQTDpGOHeOXItlDFhW At4XoOESp8we96xQD/t2SIo/cunidVHwDuHVp6BD0q4PV/uaAufHW+s5n6QRyfADGyCO Wi9ZFz27khs2MJ4XKm9BbPIF4vm4ocII30m/4kJBOkZBosF5tjIDaQWtiYc4+lg4/2E7 UnAsArHpGTmZ0l7/BoLTysUf76LjsGy/pH4z+JRGyukwGQaXLDHtZUwma0PvQYaEO5G+ 7rxQ== X-Forwarded-Encrypted: i=1; AL+hErFD1cPpplmBtxA3P22Scx8iab1KLTmWMGZHEDQdR8kHbQj7nWgSG79k+aQxmiia9sx7pyngfl7xekxiRZk=@vger.kernel.org X-Gm-Message-State: APuU4Z94+ZbDqbCT6dCLgKbZ7uicAcCSxvEDx+u+VGeYVDCUQ48nCEwu Yhr1jwpqnwk3aOAjZD2uL/ZdiDhYEh246fgTQu30TM78S0IT6E9FGQdXtzRaq5QLnDbsUMevVhE 2Bt/FbA87nw== X-Received: from dycmb10-n1.prod.google.com ([2002:a05:693c:20ca:10b0:386:c377:5335]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:6da7:b0:384:5885:2f81 with SMTP id 5a478bee46e88-3856c0c7c06mr22811180eec.5.1796067529563; Mon, 30 Nov 2026 11:38:49 -0800 (PST) Date: Mon, 30 Nov 2026 11:38:46 -0800 In-Reply-To: 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 References: <20261125005108.1020003-1-irogers@google.com> <20261125005108.1020003-4-irogers@google.com> <20261125132512.GB2668804@noisy.programming.kicks-ass.net> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130193846.3582553-1-irogers@google.com> Subject: Re: [PATCH v4 03/19] perf/uapi: Add BUILD_ID_OFFSET sample types to UAPI From: Ian Rogers To: Peter Zijlstra , Namhyung Kim 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 Content-Type: text/plain; charset="UTF-8" On Wed, Nov 25, 2026 at 01:45:32PM -0800, Namhyung Kim wrote: > On Wed, Nov 25, 2026 at 02:25:12PM +0100, Peter Zijlstra wrote: > > > 64-bit offsets whose top 8 bits encode the 1-based build ID index (or > > > 0x00 for unresolved user addresses and 0xff for kernel/context entries). > > > In common cases where multiple callchain frames belong to the same > > > binary, each unique build ID is encoded only once. > > > > Why ?!? This is insane > > This is basically to save space for callchains. When multiple entries > fall into the same binary, it can have a table of binaries/build-ids > and use indices instead of repeating full build-id for each entry. > > It'd be great if it could have a global (or per-session) table. This is > a per-sample table. Please let us know if you have a better idea. For context on how we arrived here: in v1/v2 each callchain frame was simply a fixed 32-byte { struct perf_build_id bid; u64 offset; } entry (4x larger than raw u64 IPs, ~4 KiB for a 127-frame stack). The per-sample table + 8-bit index in v3/v4 was an attempt to cut that size overhead while keeping each sample self-contained. Fair enough if the bit-packing / per-sample table complexity is too ugly for UAPI. Before spinning v5, what direction would you prefer? Some alternatives: 1. Simple fixed-size entries per frame (no table, no bit-packing): back to { struct perf_build_id bid; u64 offset; } per entry, trading extra ring-buffer bytes for a trivial UAPI and kernel path. 2. Per-sample table without bit-packing into offsets: e.g. fixed struct perf_build_id build_ids[nr_build_ids] plus explicit { u64 offset; u32 bid_idx; u32 reserved; } (or separate u8/u16 index array) so 64-bit offsets/addresses stay untouched. 3. A session/ring-buffer sideband record (e.g. assigning a monotonic ID per build ID when first encountered, or emitting a build-ID table record) so samples only carry { id, offset } instead of repeating 20-byte build IDs across samples. 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? Thanks, Ian