[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250102144553.5b32b0f3@gandalf.local.home>
Date: Thu, 2 Jan 2025 14:45:53 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
linux-kbuild@...r.kernel.org, bpf <bpf@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>, Mathieu
Desnoyers <mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Peter Zijlstra <peterz@...radead.org>,
Masahiro Yamada <masahiroy@...nel.org>, Nathan Chancellor
<nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>, Zheng Yejian
<zhengyejian1@...wei.com>, Martin Kelly <martin.kelly@...wdstrike.com>,
Christophe Leroy <christophe.leroy@...roup.eu>, Josh Poimboeuf
<jpoimboe@...hat.com>
Subject: Re: [PATCH 00/14] scripts/sorttable: ftrace: Remove place holders
for weak functions in available_filter_functions
On Thu, 2 Jan 2025 11:30:12 -0800
Linus Torvalds <torvalds@...ux-foundation.org> 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:
>
> > 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
Powered by blists - more mailing lists