Mike.Sullivan at sun.com wrote:
> >From on-discuss-bounces at opensolaris.org Thu Apr 16 08:59:29 2009
> 
> >> Is there any document which describes the rules what kind of debug
> >> behaviour is allowed for OS/Net DEBUG builds ? For example:
> >> - Is it allowed to call |assert()| in DEBUG builds, even if this means
> >> that vital components (e.g. /usr/bin/sh or SMF) of a system will fail in
> >
> >The Kernel is covered in ASSERT calls in DEBUG builds and there is
> >nothing more critical than that since if those asserts in kernel trip
> >the result is a panic.
> >
> >It is understood that a DEBUG kernel is slower than a non DEBUG one
> >since there is a lot more code running and by default a lot more kmem
> >checking.
> 
> but it used to be that you weren't supposed to have DEBUG code make
> it lots slower, as that discourages people from running DEBUG kernels
> for normal use which does help. What 'lots' means these days I don't know,
> but while I'd probably not worry much about asserts I'd probably put
> things like
>         #ifdef DEBUG
>                 /* spend minutes validating all my structures */
>         #endif
> 
> under another debug variables control that is not enabled by default.
> 
> >What I believe tends to be frowned on though is spewing out lots of
> >additional "tracing" type stuff to stdout/stderr or log files; but I'm
> >not aware of any policy on that I can point you to.
> 
> scary debugging messages like that also prevent people from running
> DEBUG kernels, or just scare them, so they are also not wise (in
> my view).

I don't want to add "scary" debug messages... the idea was to have some
kind of memory corruption detection enabled by default which fires a
SIGABRT when a the heap gets corrupted. The performance penalty is a bit
difficult to predict (AFAIK the "worst" possible case is that $ ksh -c
'while read -N 1 c ; do print "%s" "$c" ; done # (read file character by
character) runs only with 1/3 of the speed (as said this is the _worst_
case, doing it line by line reaches ~~92% of the normal speed).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to