Re: Stack Tracing using Ftrace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 3, 2010 at 7:02 PM, Neependra Khare
<neependra.khare@xxxxxxxxx> wrote:
> Hi,
>
> I wrote a module and somehow it is corrupting the thread_info of the
> process.
> After some debugging I concluded that its corrupting the kernel stack.
>
> Then I came across Ftrace to get the stack trace, which confirmed high stack
> usage.
> http://lwn.net/Articles/366796/
>
> I see around 7K in the depth section of first entry in "stack_trace".
>
> At the same time I run a stap script to get the current stack usage using
> "stack_used"  function.
> It comes around 4k.

Given that you are eating so much of stack space, you must have lots
of local variables or some *big* ones. It might be easy to just open
your .ko check the sizes of the variables and compute from there.  You
can also enable below variables in your .config.

CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_DEBUG_STACK_USAGE=y

Thanks -
Manish


>
> To my understanding the depth section of first entry in "stack_trace" and
> value retuned by
> stack_used should match.
>
> Is my understanding correct?
>
> Thanks
> Neependra
>
>
>
>
>



-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux