From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383433; b=FfVw8bhwDkBLoIsYBRWiM6bK47Ny71MAWw+BDNBVby+aV+xcEuCmxdTvLDyF5lBIOkDV +8OLZUq1ZUt6jkJUUKlsZzCTy55XhQFpI8usaBTdm6zr4PJ72HoSG7Pph0Fi91dYsBLwG 0xRFDF7RyCa05I4XR6TgF99K2zrQXb+T2BqehK3rH1ZAgqJslqdnpZ7ww7qvzH08v5jmV TVrxeRoEpEz0ygzB9rtHx5YhWlxAyGht/MBiSika7afAXt2JgoaHPVb/LHBLIjaMODtAW UAuu9vMlVKVjO7oEZkoSBRJeO/q3Pf40nps5oC335NIEYfKjF/Q+DnVOoFOkZjyXuzg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383433; h=DMARC-Filter:Received:Received:DKIM-Signature:From:Date:Subject: MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id: References:In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature: X-Developer-Key; bh=OnRQE39fCTJrc6iXZCoHjK2g9Og3GsoCuiHTjqLBKpQ=; b=sDcz5XGtCSNR7BR0KKcA8SAUtyScR/y6MkLyZ3OLg8W0yI6t3bCzNGDU20XyjVZC/HYn hyd0zynvYH5sMsIqqtSUEyJHkhfrZQOmBg9swLuvWgTgJczd9CoeZ0L45wFkBk+ZrcxYm jJdn/qCRYiYJ7hJaAWP+Lv/sa43Wt0BUxY4qLoSN16XvdjfFmMxsLBrQcQ9M61jbYAepJ Px5dVtDjv7cmrswy90zHw6FflRPPL7bbElwKjRoAqCbtfhNsJdixaBOl9kv+kxfqSYvVz kJR6BCjvlMFsZbImdDan1P/dRuetV2v9Aqv7aIj4v7ydVXEjg9+zfxN28JxCpcGkZHg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=gcPoRHog; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95F5460A260B; Fri, 4 Dec 2026 11:23:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 95F5460A260B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=gcPoRHog Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4245516A3; Fri, 4 Dec 2026 03:23:49 -0800 (PST) Received: from e132581.arm.com (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BE3853F632; Fri, 4 Dec 2026 03:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796383432; bh=DqjyVq7JakixKqnBXWBvBLDHEFO46I+V1BBsDnCge5Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gcPoRHogMvNEa6xDaLgWrZ47sOHTFDCVR7MnrvBsLZBt/W9tdCA4jfj0ty0DnUEi+ xVCEdFESGxhG0AGWHBZJ6fFeEUEk3S+P9wbyURfR5PZC1Qa4B6RA4mSxF/eYXejH9h Wx2tcRxb5gXhC1245PeW67rPBs1+4JmGHqVZjNzs= From: Leo Yan Date: Fri, 04 Dec 2026 11:23:29 +0000 Subject: [PATCH v2 7/7] perf docs: Describe multi-record thread maps 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-Transfer-Encoding: 7bit Message-Id: <20261204-perf_fix_large_threads-v2-7-a6c077f3037d@arm.com> References: <20261204-perf_fix_large_threads-v2-0-a6c077f3037d@arm.com> In-Reply-To: <20261204-perf_fix_large_threads-v2-0-a6c077f3037d@arm.com> To: Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Suyash Mahar , Amir Ayupov Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Leo Yan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796383419; l=1961; i=leo.yan@arm.com; s=20250604; h=from:subject:message-id; bh=DqjyVq7JakixKqnBXWBvBLDHEFO46I+V1BBsDnCge5Q=; b=EokjswEzEt088XDJTdSib/yIfTxRVmfrFZ/EpAntwggP74/lhhpS6tpdbq/p8DXPtX5JwbfHI kgtaiHAI6QdCTG54Udzwr6roNcxkxmdx8of/fbEazdIfNESH4UXdQdp X-Developer-Key: i=leo.yan@arm.com; a=ed25519; pk=k4BaDbvkCXzBFA7Nw184KHGP5thju8lKqJYIrOWxDhI= Document the PERF_RECORD_THREAD_MAP layout using the structure names and flexible array declaration from the code. Describe the continuation flag and ordered assembly of split maps. Explain that readers must collect the complete map before allocating per-thread counters or processing statistics, and that split maps require updated readers. Signed-off-by: Leo Yan --- tools/perf/Documentation/perf.data-file-format.txt | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt index 359d6ef0c80aac26a02b81ff590c3545daebf40b..4d6e81e65b59587b867b747d821ca2f1f03baf03 100644 --- a/tools/perf/Documentation/perf.data-file-format.txt +++ b/tools/perf/Documentation/perf.data-file-format.txt @@ -656,6 +656,30 @@ struct auxtrace_error_event { char msg[MAX_AUXTRACE_ERROR_MSG]; }; + PERF_RECORD_THREAD_MAP = 73, + +Lists thread IDs and command names. + +struct perf_record_thread_map_entry { + uint64_t pid; + char comm[16]; +}; + +struct perf_record_thread_map { + struct perf_event_header header; + uint64_t nr; + struct perf_record_thread_map_entry entries[]; +}; + +Large maps are split into records that fit in the 16-bit header.size field. +PERF_RECORD_MISC_THREAD_MAP_MORE (1 << 0) in header.misc is set when another +record follows and clear for the final record. Each record's nr counts only +its own entries. Concatenate entries in record order, preserving their +positions, until a record with MORE clear completes the map. Consumers must +assemble the complete map before allocating per-thread counters or processing +statistics. Split maps require readers that support this convention; maps +that fit in one record are unchanged. + PERF_RECORD_HEADER_FEATURE = 80, Describes a header feature. These are records used in pipe-mode that -- 2.34.1