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=1796067173; b=yihGhMaGg7QFU5HjIBdWk/JMXHXjl1oI8hRdsDpbwMmngMoSr8PAlzzok9uS6aS0K+mJ V6XYpjUStq7/HdeqTphp4LkiC8mvCfCRCnbbirbG2eljs+/Mx6YhUSit5K8mwx9jWI5ct Jdl2HYN3kupickTMijx+4gHJvwbogatnD3wzr6SM6xmk89L8tAxdMH61k7Se2o10hw92R s2pONrWPTQlGTEhnXnE2nrOsQkrT+3wBCfSi41UEas2kcxTZtWeSJj95tCfSfrzoGBZAD f65qf92hMT8xCF0tHSsTf5CMJtlMMmPneo7hu2BeqAxzrpy6qzLNVFKBIQbwAM3s53w== 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=KokCsO4MjiJy4gNOL+iqxA3Dpx7KpXU1N+4IVwGP9icXk7BNqIccTwDbEzK5UmeOwzx0 5jEzI0RGN4sugR9Gq5qq8w0L2XhUq0PJHH52Yia0GofGDlP6/4Md5FF/Vn9jmPm3elILf JrjVocgoGoWAy2Cq//R7f2Tc3Q1LTiedo5ywaFZ6i/6joglVdBFWmwnMFHnXWIuis+rPU KxmrOmGl8aSgVVzisyfBLN31eXKrDyTPl3OOjUl2Wl2juS60vmNoVv+pYCNJ+TgsSSTiL X8fqIsCeOdMx0ruOgURDUqZY0K2PcEbvZmVzizesb2lr4nd3pXkHmEaDhqfIOlSGRaA== 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.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 13753606A32D for ; Mon, 30 Nov 2026 19:32:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 13753606A32D 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-f197.google.com with SMTP id 5a478bee46e88-386ad819860so5231457eec.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=G7HNvKqSPXdrlPN5h6a6FeN0H0Z0wRuBEwOsHaFQfPY0zH5fPNThXePBLz5xz/1dJH uF6qsb9DX9B5gfGpKHzUzfDYDRGRxxa/35S0usPYv7qEx69qkVxt0S1bXPb4Yutl1R7a h0xOr1I74HA4Zu1xbvPGma5Wh2/HMQAXmOHpr+VmF1y3sSSMFd4n7tnpiCu2t4zE22TD n2jb3s3D/5jOsbK3F95/coA3/BfwmOWaK7KtY2bYfYmBwF9Z4Vdiw/SpN9n2G30wcWQr FtgONVnnr04XUGzGdga0G5+Zd83/c207/0pZY7TymgzuDnL88uUbXHjtfwz+kfm2/uDn Tg2w== X-Forwarded-Encrypted: i=1; AL+hErFhbDXiOxUu2Azer35oDsrfXy1blDE8Dy5nAxoLEstsrJYfK5QcZsAN3kBD7PENU4GFaJo=@vger.kernel.org X-Gm-Message-State: APuU4Z/cgVZRl0NLqkO76oNTHxK6nPPhMUkp20jyIHutvsNoAQg5ACjo edoiCfl29ee8fY1ovb+bhG8ISl+rdTyT+IGqXYTLT85XtcpkmI0ceuCchJG8c1Lgcjdxt493V0H Q/ZIAThg5Eg== 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: bpf@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