linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,
	Stephane Eranian <eranian@google.com>,
	Stefano Sanfilippo <ssanfilippo@chromium.org>,
	Steve MacLean <Steve.MacLean@Microsoft.com>,
	Pablo Galindo <pablogsal@gmail.com>
Subject: [PATCH 1/2] perf doc: Update jitdump unwind info specification
Date: Tue,  9 Jan 2024 16:54:44 -0800	[thread overview]
Message-ID: <20240110005445.490058-1-namhyung@kernel.org> (raw)

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.

  https://github.com/v8/v8/blob/04f51bc70a38fbea743588e41290bea40830a486/src/diagnostics/eh-frame.cc#L157

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.

Cc: Stephane Eranian <eranian@google.com>
Cc: Stefano Sanfilippo <ssanfilippo@chromium.org>
Cc: Steve MacLean <Steve.MacLean@Microsoft.com>
Reported-by: Pablo Galindo <pablogsal@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/Documentation/jitdump-specification.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/jitdump-specification.txt b/tools/perf/Documentation/jitdump-specification.txt
index 79936355d819..5c3fbbbebf14 100644
--- a/tools/perf/Documentation/jitdump-specification.txt
+++ b/tools/perf/Documentation/jitdump-specification.txt
@@ -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
-- 
2.43.0.472.g3155946c3a-goog


             reply	other threads:[~2024-01-10  0:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  0:54 Namhyung Kim [this message]
2024-01-10  0:54 ` [PATCH 2/2] perf doc: Increase the jitdump version to 2 Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240110005445.490058-1-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=Steve.MacLean@Microsoft.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pablogsal@gmail.com \
    --cc=peterz@infradead.org \
    --cc=ssanfilippo@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).