From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796067531; b=3m3C3Qn5MAjOAPv+xyjyfHYit+apSxBZ3h9WM/SxJqwipBvFtb5X540VX9LB2S5CP+I0 hLkJFNkbMx1BB732rmkuXnLT6buzVDlbfd4jQDBTpkTGU/3/hVhpg0HCLcxt0Ep509mKp BORZV7yDg95nhM5HoDlL/kkMudy6KqYDmoQ44Jnq22qSdtXm+Ta9NVGTuOsmL6cPwpWxR /NitKlsE9wapKg75VpVF22iCgPJYWnRojifRDkVyUPyBH4K7XDo89swWVGwFrd+ywHlwL ssoRWbRUJ7gEYM03z8JDzjiFDhFI6VwRN0n/GK2oZ5AY9Y1aWc7aX1+dwphLzLJEqIQ== 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=k4FhBWbEeRFXY0T8dcmAIJ2XbfCCnEKH1tiWgFMrUyx4jTO8RHif5wPxzIizGGWMy7cM +Fbxj2Bjyk9lcAa2ytx7RJo4S1jn79mtmknJ7IScURW1yjwlOUGLXR7SLb8Zfof1GQ5TX JJnVpeJGZcAuMqgXVvGvLdfeVhgOp8aocgFtTUk5tIel8O3TxLnEaHGtMfqTpP5fC0fkU puB1F8Monp/CMKGrNkCoVZfUzYvyPuEEL2wkRJYZ8R6CG36xUvI+wIDLOHHjpuzsrAQJ9 7cR/aMI+FWYWe2ZVJ2yMbGXa35SJAWZmEXUDUKrZKormz3TdXXQ7HN5QpPIIOt+moLA== 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.197 Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) (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 0B52F606A325 for ; Mon, 30 Nov 2026 19:38:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0B52F606A325 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-f197.google.com with SMTP id 5a478bee46e88-30bcb065bfdso10762015eec.0 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=Oo8aHY5dKKn3Xyf3gqh1FCQXqyeillUjqyVE7/pIciszj8+2H6ftzVJrm3vt4+aEQu juNQzLXPpc1KvOopAQw1hdbrLb2bWwCxqwx3OqFISDQ953YzTld+Ct5WuSDTbh16QUBO XNFKSflwaSxSI5dzM3RDY453XQ+MqhY4ce5MNp6q8QDbLPJwESAwpN5sE1gql+65mR3q UfqKvfUYiHuoaTyo2OOW/AVVw7kyLzgNUxWkKaiTEHheM7Y6ErTHDIbFP2EIQ0tPC05c 4BDc7NSgEF0CnVJVkCDQxugCIWUvmr8xq3RMduCAoNbLagwkoHakePutMYc0K4vvW7IX lVRQ== X-Forwarded-Encrypted: i=1; AL+hErF3wBqGyT0de55CPCe+HelDXPqTa/Y9HJ9YVmeJOaV0sc6uB9SeMEtN/lvCavPGriLnJPNtV9GfFeD4mAZBooP7@vger.kernel.org X-Gm-Message-State: APuU4Z8aimHPbxgVEiTezeUPR7lPxEx5oQyj/6klo/UzxlBmsB3RA0Hi DjSK8mUzhhH8Uu3MVL3lmuI7wLpK/wbaZXyw/HLUMF3ynO+dQLc/Iq97dFyk9FNh9syg9d8L1qF PFID/X6dv1w== 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-perf-users@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