lkml.org 
[lkml]   [2000]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel debugging
Elmer Joandi wrote:
>
> > understanding the
> > > underlying principles and the code.
>
> Speaking about that, I have been long time dreaming
> about following strict standard template for linux kernel functions:
> (macroplay intended)
> ----------------------
> INLINE(context,level,for_speed, fixed) returntype functionname
> (PARM(parameters)){
> DEBUG(ENTRY,SUBSYSTEM, module, functionname);
> /* function body starts */
> do something
> do something
> on success goto ok;
> on failure goto failure_reason_name;
> /* function body ends */
> ok:
> on ok do something
> DEBUG(EXIT,SUBSYSTEM, module functionname, OK);
> exit or return whatever
> failure_reason_name;
> on this reason do something
> DEBUG(EXIT,SUBSYSTEM, module, functionname, reason_name);
> exit or return whatever
> failure_reason_name1;
> on this reason do something
> DEBUG(EXIT,SUBSYSTEM, module, functionname, reason_name1);
> exit or return whatever
> };
> ----------------------

Please have a tought look at the floppy tape streamer driver to see why
this
is a BAD IDEA.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.181 / U:9.108 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site