From: Indu Bhagat <indu.bhagat@oracle.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Steven Rostedt <rostedt@goodmis.org>
Cc: "Jose E. Marchesi" <jemarch@gnu.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
bpf@vger.kernel.org, x86@kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Andrii Nakryiko <andrii@kernel.org>,
Beau Belgrave <beaub@linux.microsoft.com>,
Jens Remus <jremus@linux.ibm.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jens Axboe <axboe@kernel.dk>, Florian Weimer <fweimer@redhat.com>,
Sam James <sam@gentoo.org>,
Brian Robbins <brianrob@microsoft.com>,
Elena Zannoni <elena.zannoni@oracle.com>
Subject: Re: [RFC] New codectl(2) system call for sframe registration
Date: Wed, 23 Jul 2025 09:29:32 -0700 [thread overview]
Message-ID: <46d727ee-3675-4f99-92b3-3d9a8d54acaa@oracle.com> (raw)
In-Reply-To: <9aabd05c-5769-41fc-a825-e6c6866d9fe4@efficios.com>
On 7/23/25 8:09 AM, Mathieu Desnoyers wrote:
> On 2025-07-22 17:13, Steven Rostedt wrote:
>> On Tue, 22 Jul 2025 14:04:37 -0700
>> Indu Bhagat <indu.bhagat@oracle.com> wrote:
>>
>>> Yes and No. The offset at which the text is loaded is _one_ part of the
>>> information to "fill in the blanks". The other part is what to do with
>>> that information (text_vma) or how to relocate the SFrame section itself
>>> a.k.a. the relocation entries. To know the relocations, one will need
>>> to get access to the respective relocation section, and hence access to
>>> the ELF section headers.
>>
>> You mean to find where in the sframe section itself that needs to be
>> update?
>>
>> OK, that makes sense. So sframes does need to still be in an ELF file for
>> its own relocations and such.
>>
>> It will be interesting on how to do compression and on-demand page
>> loading.
>>
>> There would need to be a table as well that will denote where in the
>> decompressed pages that relocations need to be performed.
>
> If we can find a way to express all sframe "pointers" as offsets from a
> text_vma base, then there is no need for relocations. This would
> minimize complexity.
>
(So we got into the topic of relocation in the context of compressing
SFrame sections, the details of which are not chalked out yet. As I
mentioned SHF_ALLOC|SHF_COMPRESSED usecase needs to be discussed
further. But stating the following in case there has been a
misunderstanding.)
The SFrame FDE func start addr field is indeed an offset from the field
itself to the start PC of the function in the text section. So in
relocatable files (object files, or ld -r i.e. ET_REL), we see the
relocations.
These relocations can be resolved at link time by the linker. So for
shared libraries and executables (ET_DYN, ET_EXEC), once the SFrame
section in placed in the PT_LOAD segment, there are no relocations for
readers/consumers. These relocations remain for relocatable objects.
A consumer of relocatable object, e.g., in case of kernel modules, will
need to take care of the relocations when adding the module.
next prev parent reply other threads:[~2025-07-23 16:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 15:20 [RFC] New codectl(2) system call for sframe registration Mathieu Desnoyers
2025-07-21 18:53 ` Steven Rostedt
2025-07-21 20:58 ` Mathieu Desnoyers
2025-07-21 21:15 ` Steven Rostedt
2025-07-22 13:51 ` Mathieu Desnoyers
2025-07-22 16:25 ` Steven Rostedt
2025-07-22 18:26 ` Mathieu Desnoyers
2025-07-22 19:11 ` Steven Rostedt
2025-07-22 18:56 ` Jose E. Marchesi
2025-07-22 19:17 ` Steven Rostedt
2025-07-22 21:04 ` Indu Bhagat
2025-07-22 21:13 ` Steven Rostedt
2025-07-22 21:57 ` Indu Bhagat
2025-07-23 15:09 ` Mathieu Desnoyers
2025-07-23 16:29 ` Indu Bhagat [this message]
2025-07-23 15:07 ` Mathieu Desnoyers
2025-07-22 18:21 ` Indu Bhagat
2025-07-22 18:49 ` Mathieu Desnoyers
2025-07-23 8:16 ` Indu Bhagat
2025-07-23 14:32 ` Mathieu Desnoyers
2025-07-23 0:26 ` Masami Hiramatsu
2025-07-23 15:15 ` Mathieu Desnoyers
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=46d727ee-3675-4f99-92b3-3d9a8d54acaa@oracle.com \
--to=indu.bhagat@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=axboe@kernel.dk \
--cc=beaub@linux.microsoft.com \
--cc=bpf@vger.kernel.org \
--cc=brianrob@microsoft.com \
--cc=elena.zannoni@oracle.com \
--cc=fweimer@redhat.com \
--cc=jemarch@gnu.org \
--cc=jolsa@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=jremus@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sam@gentoo.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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