linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ftrace_direct_func_count ?
@ 2024-05-04 13:35 Dr. David Alan Gilbert
  2024-05-06 17:25 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2024-05-04 13:35 UTC (permalink / raw
  To: linux-trace-kernel, rostedt

Hi,
  I've just posted a patch 'ftrace: Remove unused list 'ftrace_direct_funcs''
that clears out some old code, but while at it I noticed the global
'ftrace_direct_func_count'.

As far as I can tell, it's never assigned (or initialised) but it is tested:

kernel/trace/fgraph.c:
#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
  /*
   * Skip graph tracing if the return location is served by direct trampoline,
   * since call sequence and return addresses are unpredictable anyway.
   * Ex: BPF trampoline may call original function and may skip frame
   * depending on type of BPF programs attached.
   */
  if (ftrace_direct_func_count &&
      ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
    return -EBUSY;
#endif

So I wasn't sure whether it was just safe to nuke that section
or whether it really needed fixing?

Dave

-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ftrace_direct_func_count ?
  2024-05-04 13:35 ftrace_direct_func_count ? Dr. David Alan Gilbert
@ 2024-05-06 17:25 ` Steven Rostedt
  2024-05-06 17:26   ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2024-05-06 17:25 UTC (permalink / raw
  To: Dr. David Alan Gilbert; +Cc: linux-trace-kernel

On Sat, 4 May 2024 13:35:26 +0000
"Dr. David Alan Gilbert" <dave@treblig.org> wrote:

> Hi,
>   I've just posted a patch 'ftrace: Remove unused list 'ftrace_direct_funcs''
> that clears out some old code, but while at it I noticed the global
> 'ftrace_direct_func_count'.
> 
> As far as I can tell, it's never assigned (or initialised) but it is tested:
> 
> kernel/trace/fgraph.c:
> #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
>   /*
>    * Skip graph tracing if the return location is served by direct trampoline,
>    * since call sequence and return addresses are unpredictable anyway.
>    * Ex: BPF trampoline may call original function and may skip frame
>    * depending on type of BPF programs attached.
>    */
>   if (ftrace_direct_func_count &&
>       ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
>     return -EBUSY;
> #endif
> 
> So I wasn't sure whether it was just safe to nuke that section
> or whether it really needed fixing?

Yes, after commit 8788ca164eb4bad ("ftrace: Remove the legacy
_ftrace_direct API") that variable is no longer used.

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ftrace_direct_func_count ?
  2024-05-06 17:25 ` Steven Rostedt
@ 2024-05-06 17:26   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2024-05-06 17:26 UTC (permalink / raw
  To: Steven Rostedt; +Cc: linux-trace-kernel

* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Sat, 4 May 2024 13:35:26 +0000
> "Dr. David Alan Gilbert" <dave@treblig.org> wrote:
> 
> > Hi,
> >   I've just posted a patch 'ftrace: Remove unused list 'ftrace_direct_funcs''
> > that clears out some old code, but while at it I noticed the global
> > 'ftrace_direct_func_count'.
> > 
> > As far as I can tell, it's never assigned (or initialised) but it is tested:
> > 
> > kernel/trace/fgraph.c:
> > #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
> >   /*
> >    * Skip graph tracing if the return location is served by direct trampoline,
> >    * since call sequence and return addresses are unpredictable anyway.
> >    * Ex: BPF trampoline may call original function and may skip frame
> >    * depending on type of BPF programs attached.
> >    */
> >   if (ftrace_direct_func_count &&
> >       ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
> >     return -EBUSY;
> > #endif
> > 
> > So I wasn't sure whether it was just safe to nuke that section
> > or whether it really needed fixing?
> 
> Yes, after commit 8788ca164eb4bad ("ftrace: Remove the legacy
> _ftrace_direct API") that variable is no longer used.

OK, thanks, I'll send a follow up patch to my other patch to nuke
this as well.

Dave

> -- Steve
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-06 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-04 13:35 ftrace_direct_func_count ? Dr. David Alan Gilbert
2024-05-06 17:25 ` Steven Rostedt
2024-05-06 17:26   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).