Re: [PATCH 00/14] scripts/sorttable: ftrace: Remove place holders for weak functions in available_filter_functions

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2025-01-02 19:30:32
Also in
bpf, linux-kbuild, lkml
Reply to
Steven Rostedt, 2025-01-02
On Thu, 2 Jan 2025 at 10:59, Steven Rostedt [off-list ref] wrote:
Where the file created by "nm -S" is read, recording the address
and the associated sizes of each function. It then is sorted, and
before sorting the mcount_loc table, it is scanned to make sure
all symbols in the mcounc_loc are within the boundaries of the functions
defined by nm. If they are not, they are zeroed out, as they are most
likely weak functions (I don't know what else they would be).
Please just do this by sorting non-existent functions at the end,
instead of just zeroing them out.

That makes the mcount_loc table dense in valid entries. We could then
just rewrite the size of the table (or just add a variable containing
the size, if you don't want to change ELF metadata - but you're
already sorting the table, so why not?)

Because:
Then on boot up, when creating the ftrace tables from the mcount_loc
table, it will ignore any function that matches the kaslr_offset()
value.
Why even do that? Why not just make the mcount_loc table be proper in
the first place.

             Linus
Thread (36 messages) 36 messages, 4 authors, last reply 2025-01-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help