BPF List
 help / color / mirror / Atom feed
From: Martin Kelly <martin.kelly@crowdstrike.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-trace-kernel@vger.kernel.org"
	<linux-trace-kernel@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>
Cc: "masahiroy@kernel.org" <masahiroy@kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"jpoimboe@redhat.com" <jpoimboe@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"mathieu.desnoyers@efficios.com" <mathieu.desnoyers@efficios.com>,
	"mhiramat@kernel.org" <mhiramat@kernel.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"nicolas@fjasle.eu" <nicolas@fjasle.eu>,
	"nathan@kernel.org" <nathan@kernel.org>,
	"zhengyejian1@huawei.com" <zhengyejian1@huawei.com>,
	"christophe.leroy@csgroup.eu" <christophe.leroy@csgroup.eu>
Subject: Re: [PATCH v2 16/16] scripts/sorttable: ftrace: Do not add weak functions to available_filter_functions
Date: Wed, 5 Feb 2025 00:13:26 +0000	[thread overview]
Message-ID: <aba52935dc06a1fe69f05309f5d9828a297ad787.camel@crowdstrike.com> (raw)
In-Reply-To: <20250102232651.347490863@goodmis.org>

On Thu, 2025-01-02 at 18:26 -0500, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> 
> When a function is annotated as "weak" and is overridden, the code is
> not
> removed. If it is traced, the fentry/mcount location in the weak
> function
> will be referenced by the "__mcount_loc" section. This will then be
> added
> to the available_filter_functions list. Since only the address of the
> functions are listed, to find the name to show, a search of kallsyms
> is
> used.
> 
> Since kallsyms will return the function by simply finding the
> function
> that the address is after but before the next function, an address of
> a
> weak function will show up as the function before it. This is because
> kallsyms does not save names of weak functions. This has caused
> issues in
> the past, as now the traced weak function will be listed in
> available_filter_functions with the name of the function before it.
> 

I'm not necessarily a qualified reviewer for this patch, but I'm very
interested in seeing it or a similar solution get merged, as the impact
when it hits is significant (silent failure) and not easy to detect or
work around. Is there any obstacle left in getting this one merged
other than further reviews?

  reply	other threads:[~2025-02-05  0:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 23:26 [PATCH v2 00/16] scripts/sorttable: ftrace: Remove place holders for weak functions in available_filter_functions Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 01/16] scripts/sorttable: Remove unused macro defines Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 02/16] scripts/sorttable: Remove unused write functions Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 03/16] scripts/sorttable: Remove unneeded Elf_Rel Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 04/16] scripts/sorttable: Have the ORC code use the _r() functions to read Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 05/16] scripts/sorttable: Make compare_extable() into two functions Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 06/16] scripts/sorttable: Convert Elf_Ehdr to union Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 07/16] scripts/sorttable: Replace Elf_Shdr Macro with a union Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 08/16] scripts/sorttable: Convert Elf_Sym MACRO over to " Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 09/16] scripts/sorttable: Add helper functions for Elf_Ehdr Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 10/16] scripts/sorttable: Add helper functions for Elf_Shdr Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 11/16] scripts/sorttable: Add helper functions for Elf_Sym Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 12/16] scripts/sorttable: Use uint64_t for mcount sorting Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 13/16] scripts/sorttable: Move code from sorttable.h into sorttable.c Steven Rostedt
2025-01-03 23:02   ` Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 14/16] scripts/sorttable: Get start/stop_mcount_loc from ELF file directly Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 15/16] scripts/sorttable: Zero out weak functions in mcount_loc table Steven Rostedt
2025-01-02 23:26 ` [PATCH v2 16/16] scripts/sorttable: ftrace: Do not add weak functions to available_filter_functions Steven Rostedt
2025-02-05  0:13   ` Martin Kelly [this message]
2025-02-05  0:35     ` Steven Rostedt
2025-02-05 16:00       ` Martin Kelly
2025-01-02 23:31 ` [PATCH v2 00/16] scripts/sorttable: ftrace: Remove place holders for weak functions in available_filter_functions Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aba52935dc06a1fe69f05309f5d9828a297ad787.camel@crowdstrike.com \
    --to=martin.kelly@crowdstrike.com \
    --cc=akpm@linux-foundation.org \
    --cc=bpf@vger.kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zhengyejian1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox