tracing: scripts/sorttable: Updates for v6.15
Linus,
tracing and sorttable updates for 6.15:
- Implement arm64 build time sorting of the mcount location table
When gcc is used to build arm64, the mcount_loc section is all zeros in the vmlinux elf file. The addresses are stored in the Elf_Rela location. To sort at build time, an array is allocated and the addresses are added to it via the content of the mcount_loc section as well as he Elf_Rela data. After sorting, the information is put back into the Elf_Rela which now has the section sorted.
- Make sorting of mcount location table for arm64 work with clang as well
When clang is used, the mcount_loc section contains the addresses, unlike the gcc build. An array is still created and the sorting works for both methods.
- Remove weak functions from the mcount_loc section
Have the sorttable code pass in the data of functions defined via nm -S which shows the functions as well as their sizes. Using this information the sorttable code can determine if a function in the mcount_loc section was weak and overridden. If the function is not found, it is set to be zero. On boot, when the mcount_loc section is read and the ftrace table is created, if the address in the mcount_loc is not in the kernel core text then it is removed and not added to the ftrace_filter_functions (the functions that can be attached by ftrace callbacks).
- Update and fix the reporting of how much data is used for ftrace functions
On boot, a report of how many pages were used by the ftrace table as well as how they were grouped (the table holds a list of sections that are groups of pages that were able to be allocated). The removing of the weak functions required the accounting to be updated.
Please pull the latest trace-sorttable-v6.15 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-sorttable-v6.15
Tag SHA1: 77e26125a028422c57c40da1c29b4bea889a21f2 Head SHA1: dc208c69c033d3caba0509da1ae065d2b5ff165f
Steven Rostedt (10):
arm64: scripts/sorttable: Implement sorting mcount_loc at boot for arm64 scripts/sorttable: Have mcount rela sort use direct values scripts/sorttable: Always use an array for the mcount_loc sorting scripts/sorttable: Zero out weak functions in mcount_loc table
ftrace: Update the mcount_loc check of skipped entries
ftrace: Have ftrace pages output reflect freed pages
ftrace: Test mcount_loc addr before calling ftrace_call_addr()
ftrace: Check against is_kernel_text() instead of kaslr_offset() scripts/sorttable: Use normal sort if theres no relocs in the mcount section scripts/sorttable: Allow matches to functions before function entry
----
arch/arm64/Kconfig | 1 + kernel/trace/ftrace.c | 55 ++++++- scripts/link-vmlinux.sh | 4 +- scripts/sorttable.c | 411 +++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 457 insertions(+), 14 deletions(-)
---------------------------
The pull request you sent on Tue, 25 Mar 2025 18:05:27 -0400:
The pull request you sent on Tue, 25 Mar 2025 18:05:27 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.gittrace-sorttable-v6.15
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/dd161f74f8198c62f9bcf893f72c64bbb0d68b25
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html