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

From
Steven Rostedt <rostedt@goodmis.org>
Date
2025-01-02 19:44:39
Also in
bpf, linux-kbuild, lkml
Reply to
Linus Torvalds, 2025-01-02
On Thu, 2 Jan 2025 11:30:12 -0800
Linus Torvalds [off-list ref] wrote:
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:
quoted
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.
I was a bit nervous about changing the stop_mcount_loc value. I thought of
doing that first, but then I noticed that the value is found by looking at
the System.map file and not from the object itself. Changing it in the
object will require some more elf parsing. Just zeroing out didn't require
that.

I'm fine with adding that, but it will take some more elf foo magic, and my
time to work on this is coming near its end.

To do this, I believe the symbol table will need to be searched for the
__stop_mcount_loc. This could be a clean up as well, as I don't really like
that the code does a search of System.map, and reading it from the object
file may be more robust. Then when we have the values from the object file,
we should also be able to modify it.

-- Steve
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