From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796067173; b=iQe84zbh/rl3jUOM1zTedEztd4gX0EQJlIRgbFsJr3TlImygK9lNrZzFsa551ymtcjmG cEWWD3hVLDx9d16Th6yZO17ZAkMUBTzR3UqCn8PCxAeMPrFt8sz8WkHZRHQc8gpakKlgl b+I10L78Lc3nbAdrNECKYVrS9kEi5U+L26Km7qg7NMHv2yVvVPqbCOFEgelZcNgWKw4vb DXEHNa6yc/cJSJYrbJSjXcTKzU3aYrw+GrYfLlbc887dXxehE6ngB6DLIeNfGV+NjRo6J lcS15q74xa0DFMonHEVOp5wm5QEu8Oxo17s78VUfWcTWECIjw2+Hrdwb1OZm8tfS9Ow== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796067173; 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=bIkf2a1YClCjVcNrv0nJWlD1UQVq2Lnt/JFCet4xaj0=; b=gk3U+dcdQZe76cec+KX4KFXeLsVHeb/7z8Gfdn3ot7WFOsbYeZ2r9FXTw/BtGSDpfJza GReKOx6ZcJ0JYCNj2sEbruqPtlmPOxXkpqliHe2Z7KiZIqSbCmn/Anghh5nLZDok1YGOX 8rhPrHMRAsHS+BU33r2RZQ8eHGUEJAHUVIkSDrZ1zlfwgXS+kdnss2tKH14/yj6IQQjHT 1JaPQrYql5aB4vnyK3grH9nhma5oNL07FEpkrwNeVDH/A2kwj7aQJD42dVsPXhuSv7KYG B+Zk39p0qfsX1deglsCaGiCSj19O1aTdQkD3XjZDaji5YVm9nlWjE3fDHbh3ySVftHg== 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=OGxlrLI4; arc=none smtp.remote-ip=74.125.82.198 Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) (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 08724606A320 for ; Mon, 30 Nov 2026 19:32:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 08724606A320 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=OGxlrLI4 Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-386ad819860so5231455eec.0 for ; Mon, 30 Nov 2026 11:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796067172; x=1796671972; 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=bIkf2a1YClCjVcNrv0nJWlD1UQVq2Lnt/JFCet4xaj0=; b=OGxlrLI4sHyXtKCzxrd0TRSFvYZJWLnan2MGsbmtYgiWzNarOu9g0fWGvtkZlylJFb 175IaHzkoJ6lAg3qp3KAUuR/e+awu6vw8KaxC5nDhLnakKZY8x8C19ubDm29h2rramKi KFtzVIUOMHvOZh5lASisbi24NPXPyAhHc6hR/NmqWM0C6PdaupNlWjM3xxo+x3Y12+hb bPgKZ/Gj7I5eFsbTndMBTQg2GcafYPmRBPQd+g5Bu/z5res66V/lGsb5SEWVPQpny7ZF Qb/H10sv9Ryjh/aEr1v1M8YRibkhxpb3k8zV9u+M2zIqK8XUCUZdYPbPHlQye32FR5GZ tgnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796067172; x=1796671972; 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=bIkf2a1YClCjVcNrv0nJWlD1UQVq2Lnt/JFCet4xaj0=; b=ybDlK2yB8kk5c2Ow1gb2MBeNwCQX8Uy7iP2W8WtN3oFmSLjUJ+KNXXZgdMrxeabjY4 Kx0HsQnDq0ktXnSUDCwe/iPqQHjqU38LKByRH1JbEFEJLD3l6SwBAF9NJ8UlYaYBs0OQ 6U2GzmP04b8gGMwa1Rp7MMW76vxrHfS1Y5FVXZYSTfRDOoJ1ahaXJvuvWS3utj416ESU PzQ9k2A7bZUVIXB596e+TpiDcz2AUXTGkl1Ix7oSRrR0xv1I8EBJcVp0LgTTEG2dr15Z llOymYy7dAFkbt9C5FfHsVUKer0U1dKAQnkBeVkHLwOx02PuzoZXmqOnmWZgvwBAYbt/ E8Ag== X-Forwarded-Encrypted: i=1; AL+hErH+A+syZZ6LvQ75Oi6FFkTySPCAvnWpxL0g8x6q0t3/miN7SKizsCMJAeEb33xAMNihjgDo3itiHt1uiNw=@vger.kernel.org X-Gm-Message-State: APuU4Z8s6aa+thPqitPCf7SwDNxa2EjWHfJyNhyIg/SXHBaQJqMb/Raj FTkIzmx/i2I0fhLiKoAC5iKhec/5vEe9pSnwjrY0FM4hYQwuXn0eCJ6oqjekwktTHAoCUaYYkPx LVX+/fJrruw== X-Received: from dybou2.prod.google.com ([2002:a05:7300:e5c2:b0:384:c70c:3c65]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:269e:b0:376:5b99:a816 with SMTP id 5a478bee46e88-3856c2c3fb4mr33170224eec.3.1796067171665; Mon, 30 Nov 2026 11:32:51 -0800 (PST) Date: Mon, 30 Nov 2026 11:32:48 -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: <20261116074414.3174737-1-irogers@google.com> <20261116074414.3174737-4-irogers@google.com> <6F41ABBE-16A3-4B1F-96C0-D6369D5A5A55@linux.ibm.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130193248.3573249-1-irogers@google.com> Subject: Re: [PATCH v3 03/19] perf/uapi: Add BUILD_ID_OFFSET sample types to UAPI From: Ian Rogers To: Athira Rajeev , Namhyung Kim Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , James Clark , 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 Thu, Nov 26, 2026 at 02:06:57PM +0530, Athira Rajeev wrote: > Thanks Ian, Namhyung, that clears up the non-resolved cases. One follow-up on the callchain form: > > Where does the build-ID table live: per sample, or per event? > > * If it is per sample, the same binary appearing in many samples gets a table entry in each one. > Is that duplication acceptable, and is it how the format is meant to work? > > * If it is per event, so that common addresses and binaries across samples share one table, > how does a reader find the table for a given sample? Does the 8-bit index mean at most 255 distinct build-IDs per event? What happens when the table exceeds 255 entries, or when a file offset needs more than 56 bits? > Do those entries fall back to the unresolved form (raw IP, 0x00 top byte), or does the event fail? In v3/v4 the build-ID table is per sample (or per PERF_RECORD_CALLCHAIN_DEFERRED record), so each record is completely self-contained and can be decoded independently without cross-sample state. Within a single sample it deduplicates frames from the same binary, while separate samples do repeat the build IDs they reference. Because it is per sample, the limit is 254 distinct build IDs per sample (indices 1..254; 0x00 is unresolved user IP and 0xff is reserved for PERF_CONTEXT_* markers), which is well above the default perf_event_max_stack of 127. If a sample exceeds 254 unique build IDs (or a file offset exceeds 56 bits), the frame falls back to the unresolved raw user virtual address (0x00 top byte) rather than failing the event (note: perf inject currently checks offset >> 56 == 0, and the kernel path should do the same rather than masking). That said, Peter Zijlstra just pushed back on the per-sample bit-packed table on the v4 03/19 thread, and Namhyung also raised the idea of a global/per-session table there -- so this callchain encoding is actively under discussion on v4 and may change for v5 depending on where that lands. Thanks, Ian