perf doc: Update jitdump unwind info specification
Namhyung Kim
maintainerPATCH 1/2 perf doc: Update jitdump unwind info specification
Currently the jitdump spec says the EH frame header is followed by the actual EH frame data. But in fact, it's the opposite way.
I've checked this with the v8 javascript engine which, I believe, is the actual user of this feature.
Also, the unwind_data_size field should have the size of both unwind table and the header sections. The jit_add_eh_frame_info() in genelf.c calculates the table size by subtracting the header size from it.
--- tools/perf/Documentation/jitdump-specification.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/Documentation/jitdump-specification.txt +3 -3
@@ -155,10 +155,10 @@ The record is used to describe the unwinding information for a jitted function. 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 unwind_data_size : the size in bytes of the unwinding data (EH Frame table and EH Frame Header) 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 record 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 actual 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
Signature · 1 line
2.43.0.472.g3155946c3a-goog
Namhyung Kim
maintainerPATCH 2/2 perf doc: Increase the jitdump version to 2
The specification says it's in version 2. Previously it changed to 1 due to the mismatch with the code. But I think it's better to use the version 2 to indicate it supports the unwind info.
The version check code in jitdump.c only checks if it's greater than the current version so old data with version number 1 should work too.
--- tools/perf/Documentation/jitdump-specification.txt | 2 +- tools/perf/util/jitdump.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/Documentation/jitdump-specification.txt +1 -1
@@ -37,7 +37,7 @@ III/ Jitdump file header format * uint32_t magic : a magic number tagging the file type. The value is 4-byte long and represents the string "JiTD" in ASCII form. It written is as 0x4A695444. The reader will detect an endian mismatch when it reads 0x4454694a. -* uint32_t version : a 4-byte value representing the format version. It is currently set to 1 +* uint32_t version : a 4-byte value representing the format version. It is currently set to 2 * uint32_t total_size: size in bytes of file header * uint32_t elf_mach : ELF architecture encoding (ELF e_machine value as specified in /usr/include/elf.h) * uint32_t pad1 : padding. Reserved for future use
tools/perf/util/jitdump.h +1 -1
@@ -22,7 +22,7 @@#define PADDING_8ALIGNED (x) ((((x) + 7) & 7) ^ 7)#define ALIGN_8 (x) (((x) + 7) & (~7)) -#define JITHEADER_VERSION 1 +#define JITHEADER_VERSION 2enum jitdump_flags_bits {JITDUMP_FLAGS_ARCH_TIMESTAMP_BIT ,
Signature · 1 line
2.43.0.472.g3155946c3a-goog