[PATCH] perf docs: Correct JIT_CODE_UNWINDING_INFO specification

From: Letian Jiang

Date: Fri Oct 30 2026 - 11:40:59 EST


The JIT_CODE_UNWINDING_INFO description places the EH Frame Header before
the EH Frame. However, jit_add_eh_frame_info() uses the beginning of the
unwinding data for .eh_frame and the trailing eh_frame_hdr_size bytes for
.eh_frame_hdr.

Correct the unwinding_data description and the eh_frame_hdr_size field
description to match the layout consumed by perf.

Also document that an unwinding record precedes and applies to the next
JIT_CODE_LOAD record. perf caches the unwinding data and uses it when
processing that load record.

Keep the first sentence of the mapped_size note unchanged and remove the
second sentence, which claims that only the EH Frame Header is read when
the unwinding data is not mapped and associates this with FP-based
unwinding. perf copies the entire unwinding payload regardless of
mapped_size; the field affects the length of the synthesized MMAP event,
not which unwinding data is read.

Signed-off-by: Letian Jiang <letian.jiang@xxxxxxxxxxx>
---
tools/perf/Documentation/jitdump-specification.txt | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/jitdump-specification.txt b/tools/perf/Documentation/jitdump-specification.txt
index 7993635..c813c6e 100644
--- a/tools/perf/Documentation/jitdump-specification.txt
+++ b/tools/perf/Documentation/jitdump-specification.txt
@@ -153,12 +153,15 @@ The record type is optional.

The record is used to describe the unwinding information for a jitted function.

+The record must precede the corresponding JIT_CODE_LOAD record. It applies to
+the next JIT_CODE_LOAD record in the file.
+
The record has the following fields following the fixed-size record header in order:

uint64_t unwind_data_size : the size in bytes of the unwinding data table at the end of the record
-uint64_t eh_frame_hdr_size : the size in bytes of the DWARF EH Frame Header at the start of the unwinding data table at the end of the record
+uint64_t eh_frame_hdr_size : the size in bytes of the DWARF EH Frame Header at the end of the unwinding data table
uint64_t mapped_size : the size of the unwinding data mapped in memory
-const char unwinding_data[n]: an array of unwinding data, consisting of the EH Frame Header, followed by the actual EH Frame
+const char unwinding_data[n]: an array of unwinding data, consisting of the EH Frame, followed by the EH Frame Header


The EH Frame header follows the Linux Standard Base (LSB) specification as described in the document at https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html
@@ -167,4 +170,4 @@ The EH Frame header follows the Linux Standard Base (LSB) specification as descr
The EH Frame follows the LSB specification as described in the document at https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html


-NOTE: The mapped_size is generally either the same as unwind_data_size (if the unwinding data was mapped in memory by the running process) or zero (if the unwinding data is not mapped by the process). If the unwinding data was not mapped, then only the EH Frame Header will be read, which can be used to specify FP based unwinding for a function which does not have unwinding information.
+NOTE: The mapped_size is generally either the same as unwind_data_size (if the unwinding data was mapped in memory by the running process) or zero (if the unwinding data is not mapped by the process).