From: Steven Rostedt <rostedt@goodmis.org>
To: Maverickk 78 <maverickk1778@gmail.com>
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: ftrace not tracing pciehp probe
Date: Mon, 30 Sep 2024 11:22:13 -0400 [thread overview]
Message-ID: <20240930112213.4dc0916e@gandalf.local.home> (raw)
In-Reply-To: <CALfBBTtqho0iEV5rpG=2uead0MPZQoRiins8yeXwY-WfZnR08Q@mail.gmail.com>
On Mon, 30 Sep 2024 18:16:01 +0530
Maverickk 78 <maverickk1778@gmail.com> wrote:
> Hello,
>
> I enabled ftrace and set a filter on the command line as *pcie*, I
> dont see some of the pciehp(eg: pciehp_probe from pciehp_core.c)
> module function calls in ftrace, It does trace pciehp_isr but nothing
> else.
>
> My command line is "ftrace=function_graph ftrace_graph_filter=*pcie*
> ", is there any restriction on tracing static function calls?
Only if the compiler inlines them.
Ftrace only traces true function calls. That is, locations that something
performs a jump to via the call instruction for x86, or a branch-and-link
for several other architectures. The function has a prologue where gcc or
clang will insert code that will allow ftrace to attach to it.
If the compiler decides to inline the function, it will no longer be
visible to ftrace as the compiler will not add the necessary logic to allow
ftrace to hook to it. In the binary, the function simply "disappears" and
the content of that function is injected directly into the calling function.
If you do not see the function you want listed in:
/sys/kernel/tracing/available_filter_functions
Then it likely was inlined by the compiler. If you don't want the compiler
to inline your function, simply add "noinline" to that function:
static noinline int foo(void)
{
}
And that should tell gcc not to inline it.
-- Steve
>
> # cat /proc/cmdline
> BOOT_IMAGE=/boot/vmlinuz-6.11.0+
> root=UUID=f563804b-1b93-4921-90e1-4114c8111e8f ro
> ftrace=function_graph ftrace_graph_filter=*pcie* pciehp.pciehp_force=1
> pciehp.pciehp_debug=1 pcie_ports=native quite splash
> crashkernel=512M-:192M vt.handoff=7
>
>
> Raghu
next prev parent reply other threads:[~2024-09-30 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 12:46 ftrace not tracing pciehp probe Maverickk 78
2024-09-30 15:22 ` Steven Rostedt [this message]
2024-10-01 12:34 ` Maverickk 78
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=20240930112213.4dc0916e@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=maverickk1778@gmail.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