linux-toolchains.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Indu Bhagat <indu.bhagat@oracle.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-toolchains@vger.kernel.org
Subject: Re: [PATCH RFC 09/10] unwind: Introduce SFrame user space unwinding
Date: Thu, 9 Nov 2023 11:53:04 -0800	[thread overview]
Message-ID: <20231109195304.m4sghaxx66al4wlt@treble> (raw)
In-Reply-To: <20231109144956.0c20fd98@gandalf.local.home>

On Thu, Nov 09, 2023 at 02:49:56PM -0500, Steven Rostedt wrote:
> On Thu, 9 Nov 2023 11:37:59 -0800
> Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> 
> > > The structure SFrame FDE in SFRAME_VERSION_1 was unaligned on-disk.  We
> > > fixed that in SFRAME_VERSION_2 (Binutils 2.41) by adding some padding as you
> > > have already noted. For x86_64, its not an issue though, yes.  
> > 
> > Agreed.  I actually had v2 implemented but then realized my binutils was
> > older so I changed to v1 for testing.  But yeah, we can make v2 the
> > minimum.
> 
> Cool, my test box has binutils 2.41, so it should be good to go ;-)

You'll need something like this (untested!)

diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c
index b167c19497e5..f8b2a520a689 100644
--- a/kernel/unwind/sframe.c
+++ b/kernel/unwind/sframe.c
@@ -142,10 +142,8 @@ static int find_fre(struct sframe_section *sec, struct sframe_fde *fde,
 				break;
 		} else {
 			/* SFRAME_FDE_TYPE_PCMASK */
-#if 0 /* sframe v2 */
 			if (ip_off % fde->rep_size < fre_ip_off)
 				break;
-#endif
 		}
 
 		SFRAME_GET_USER_UNSIGNED(fre_info, f, 1);
@@ -304,7 +302,7 @@ int __sframe_add_section(struct sframe_file *file)
 		return -EFAULT;
 
 	if (shdr.preamble.magic != SFRAME_MAGIC ||
-	    shdr.preamble.version != SFRAME_VERSION_1 ||
+	    shdr.preamble.version != SFRAME_VERSION_2 ||
 	    (!shdr.preamble.flags & SFRAME_F_FDE_SORTED) ||
 	    shdr.auxhdr_len || !shdr.num_fdes || !shdr.num_fres ||
 	    shdr.fdes_off > shdr.fres_off) {
diff --git a/kernel/unwind/sframe.h b/kernel/unwind/sframe.h
index 1f91b696daf5..1adfc88b784d 100644
--- a/kernel/unwind/sframe.h
+++ b/kernel/unwind/sframe.h
@@ -125,10 +125,8 @@ struct sframe_fde {
 	u32 fres_off;
 	u32 fres_num;
 	u8  info;
-#if 0 /* TODO sframe v2 */
 	u8  rep_size;
 	u16 padding;
-#endif
 } __packed;
 
 /*

  reply	other threads:[~2023-11-09 19:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  0:41 [PATCH RFC 00/10] perf: user space sframe unwinding Josh Poimboeuf
2023-11-09  0:41 ` [PATCH RFC 01/10] perf: Remove get_perf_callchain() 'init_nr' argument Josh Poimboeuf
2023-11-11  6:09   ` Namhyung Kim
2023-11-09  0:41 ` [PATCH RFC 02/10] perf: Remove get_perf_callchain() 'crosstask' argument Josh Poimboeuf
2023-11-11  6:11   ` Namhyung Kim
2023-11-11 20:53     ` Jordan Rome
2023-11-09  0:41 ` [PATCH RFC 03/10] perf: Simplify get_perf_callchain() user logic Josh Poimboeuf
2023-11-11  6:11   ` Namhyung Kim
2023-11-09  0:41 ` [PATCH RFC 04/10] perf: Introduce deferred user callchains Josh Poimboeuf
2023-11-11  6:57   ` Namhyung Kim
2023-11-11 18:49     ` Josh Poimboeuf
2023-11-11 18:54       ` Josh Poimboeuf
2023-11-13 16:56       ` Namhyung Kim
2023-11-13 17:21         ` Peter Zijlstra
2023-11-13 17:48           ` Namhyung Kim
2023-11-13 18:49             ` Peter Zijlstra
2023-11-13 19:16               ` Namhyung Kim
2023-11-15 16:13         ` Namhyung Kim
2023-11-20 14:03           ` Peter Zijlstra
2023-11-09  0:41 ` [PATCH RFC 05/10] perf/x86: Add HAVE_PERF_CALLCHAIN_DEFERRED Josh Poimboeuf
2023-11-09  0:41 ` [PATCH RFC 06/10] unwind: Introduce generic user space unwinding interfaces Josh Poimboeuf
2023-11-09  0:41 ` [PATCH RFC 07/10] unwind/x86: Add HAVE_USER_UNWIND Josh Poimboeuf
2023-11-09  0:41 ` [PATCH RFC 08/10] perf/x86: Use user_unwind interface Josh Poimboeuf
2023-11-09  0:41 ` [PATCH RFC 09/10] unwind: Introduce SFrame user space unwinding Josh Poimboeuf
2023-11-09 19:31   ` Indu Bhagat
2023-11-09 19:37     ` Josh Poimboeuf
2023-11-09 19:49       ` Steven Rostedt
2023-11-09 19:53         ` Josh Poimboeuf [this message]
2023-11-09  0:41 ` [PATCH RFC 10/10] unwind/x86/64: Add HAVE_USER_UNWIND_SFRAME Josh Poimboeuf
2023-11-09  0:45 ` [PATCH RFC 00/10] perf: user space sframe unwinding Josh Poimboeuf

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=20231109195304.m4sghaxx66al4wlt@treble \
    --to=jpoimboe@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=indu.bhagat@oracle.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=x86@kernel.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).