 yaffs debugging yaffs debugging wookey 15 september 2006 1032pm how to control debugging in yaffs yaffs provides a debugging mechanism which can be controlled at runtime if you have access to proc normally via a shell if you need to trace things before you get to a shell then you can set default trace options at compile time available trace flags name c define bitmask value error yaffs traceerror 0x00000001 os yaffs traceos 0x00000002 allocate yaffs traceallocate 0x00000004 scan yaffs tracescan 0x00000008 badblocks yaffs tracebadblocks 0x00000010 erase yaffs traceerase 0x00000020 gc yaffs tracegc 0x00000040 write yaffs tracewrite 0x00000080 tracing yaffs tracetracing 0x00000100 deletion yaffs tracedeletion 0x00000200 buffers yaffs tracebuffers 0x00000400 nandaccess yaffs tracenandaccess 0x00000800 gcdetail yaffs tracegcdetail 0x00001000 scandebug yaffs tracescandebug 0x00002000 mtd yaffs tracemtd 0x00004000 always yaffs tracealways 0x40000000 bug yaffs tracebug 0x80000000 flag meanings the flags cover possible debugging messages from various aspects of the filesystem initial scanning mtd interface writing nand access garbage collection os interaction etc turning on everything results an awful lot of trace info so it is usually best to just enable a few relevant flags setting flags at runtime the flags can be set or cleared by echoing the name of the flag into proc yaffs with a or echo oswrite proc yaffs it can be set to to all or none using and then flags can be added or removed echo none os write proc yaffs and you can use numerical values if you are so inclined using standard c format echo 0xf00001 proc yaffs so echo all proc yaffs will turn all tracing on note that you only see the output showing you the current trace state if the always yaffs tracealways flag is set so to see what you are doing do this echo always proc yaffs setting flags at compile time flags can be set in the code at compiletime by setting yaffstracemask in yaffsfsc add new flags to always and badblocks which are set by default  