[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6zqHY0a5CPEaTCN@arm.com>
Date: Wed, 12 Feb 2025 18:36:13 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Will Deacon <will@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-arm-kernel@...ts.infradead.org,
Mark Rutland <mark.rutland@....com>,
Linux Trace Kernel <linux-trace-kernel@...r.kernel.org>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
linux-s390@...r.kernel.org
Subject: Re: [PATCH v2] arm64: scripts/sorttable: Implement sorting
mcount_loc at boot for arm64
On Tue, Feb 11, 2025 at 02:11:39PM -0500, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@...dmis.org>
>
> The mcount_loc section holds the addresses of the functions that get
> patched by ftrace when enabling function callbacks. It can contain tens of
> thousands of entries. These addresses must be sorted. If they are not
> sorted at compile time, they are sorted at boot. Sorting at boot does take
> some time and does have a small impact on boot performance.
>
> x86 and arm32 have the addresses in the mcount_loc section of the ELF
> file. But for arm64, the section just contains zeros. The .rela.dyn
> Elf_Rela section holds the addresses and they get patched at boot during
> the relocation phase.
>
> In order to sort these addresses, the Elf_Rela needs to be updated instead
> of the location in the binary that holds the mcount_loc section. Have the
> sorttable code, allocate an array to hold the functions, load the
> addresses from the Elf_Rela entries, sort them, then put them back in
> order into the Elf_rela entries so that they will be sorted at boot up
> without having to sort them during boot up.
>
> Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>
Acked-by: Catalin Marinas <catalin.marinas@....com>
(unless you want this to go in via the arm64 tree)
Powered by blists - more mailing lists