All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Determining stack usage?
@ 2010-07-07 22:51 Steve Deiters
  2010-07-07 23:12 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Deiters @ 2010-07-07 22:51 UTC (permalink / raw)
  To: xenomai

With the recent questions about the stack size going around I had a
somewhat related question.  Does Xenomai (or Linux for that matter)
provide any mechanism to determine stack usage?  I know of other RTOSes
that used a mechanism that basically prefills the stack with a guard
word upon task creation, and then calculates the stack usage based on
the first non guard word it encounters from the bottom of the stack.  I
didn't know if Xenomai provided this or anything similar.

This kind of mechanism has proved somewhat useful to me in the past.  It
allows you to know that you're close to overruning your stack and adjust
accordingly.  Otherwise you don't really have any way of knowing until
things go bad.


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

* Re: [Xenomai-help] Determining stack usage?
  2010-07-07 22:51 [Xenomai-help] Determining stack usage? Steve Deiters
@ 2010-07-07 23:12 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2010-07-07 23:12 UTC (permalink / raw)
  To: Steve Deiters; +Cc: xenomai

Steve Deiters wrote:
> With the recent questions about the stack size going around I had a
> somewhat related question.  Does Xenomai (or Linux for that matter)
> provide any mechanism to determine stack usage?  I know of other RTOSes
> that used a mechanism that basically prefills the stack with a guard
> word upon task creation, and then calculates the stack usage based on
> the first non guard word it encounters from the bottom of the stack.  I
> didn't know if Xenomai provided this or anything similar.

No. The only thing provided is an unwritable page below the stack, so
that in case of stack overflow, a segmentation fault happens on machines
with an MMU. If you look at the stack pointer at the time of the fault,
you can see that you got a stack overflow. There is no silent corruption
of a neighbor stack.

-- 
					    Gilles.


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

end of thread, other threads:[~2010-07-07 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-07 22:51 [Xenomai-help] Determining stack usage? Steve Deiters
2010-07-07 23:12 ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.