lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: build warnings after merge of the tip tree
On Mon, Mar 21, 2022 at 12:15:49PM -0400, Steven Rostedt wrote:
> On Mon, 21 Mar 2022 12:12:09 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > > > funcB:
> > > > call __fentry__
> > > push funcB on trace-stack
> > > >
> > > > [..]
> > > call __fexit__
> > > pop trace-stack until empty
> > > 'exit funcB'
> > > 'exit funcA'
> >
> > And what happens if funcC called funcA and it too was on the stack. We pop
> > that too? But it's not done yet, because calling of funcA was not a tail
> > call.

Hmm, yeah, how about we have __ftail__ mark the left function.

func_B()
{
...
}

func_A()
{
...
return func_B();
}

func_C()
{
func_A();
...
return;
}

func_B:
call __fentry__ /* push func_B */
...
call __fexit__ /* pop 1 + tails */
ret

func_A:
call __fentry__ /* push func_A */
...
call __ftail__ /* mark func_A tail */
jmp func_B

func_C:
call __fentry__ /* push func_C */
call func_A;
...
call __fexit__ /* pop 1 + tails */
ret;


Then the stack at the end of func_B looks something like:

func_C
func_A (tail)
func_B

And it will pop func_B plus all tails (func_A).

> And I just thought of another issue, where even my solution wont fix it.
> What happens if we trace funcA but not funcB? How do we get to trace the
> end of funcA?

Disallow tail calls to notrace?

\
 
 \ /
  Last update: 2022-03-21 17:42    [W:0.335 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site