a:3:{s:7:"#markup";O:25:"Drupal\Core\Render\Markup":1:{s:9:"*string";s:3577:"<span property="schema:name">YAFFS Debugging</span>
<span rel="schema:author"><span lang="" about="/user/wookey" typeof="schema:Person" property="schema:name" datatype="">Wookey</span></span>
<span property="schema:dateCreated" content="2006-09-15T21:32:13+00:00">15 September, 2006 - 10:32pm</span>

            <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<h1>How to control debugging in yaffs</h1>
<p>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.</p>
<h2>Available Trace Flags</h2>
<table>
<tr>
 <th>name</th>
 <th>C #define</th>
 <th>bitmask value</th>
</tr>
<tr>
 <td>error </td>
 <td>YAFFS_TRACE_ERROR </td>
 <td>0x00000001</td>
</tr>
<tr>
 <td>os </td>
 <td>YAFFS_TRACE_OS </td>
 <td>0x00000002</td>
</tr>
<tr>
 <td>allocate </td>
 <td>YAFFS_TRACE_ALLOCATE </td>
 <td>0x00000004</td>
</tr>
<tr>
 <td>scan </td>
 <td>YAFFS_TRACE_SCAN </td>
 <td>0x00000008</td>
</tr>
<tr>
 <td>bad_blocks </td>
 <td>YAFFS_TRACE_BAD_BLOCKS </td>
 <td>0x00000010</td>
</tr>
<tr>
 <td>erase </td>
 <td>YAFFS_TRACE_ERASE </td>
 <td>0x00000020</td>
</tr>
<tr>
 <td>gc </td>
 <td>YAFFS_TRACE_GC </td>
 <td>0x00000040</td>
</tr>
<tr>
 <td>write </td>
 <td>YAFFS_TRACE_WRITE </td>
 <td>0x00000080</td>
</tr>
<tr>
 <td>tracing </td>
 <td>YAFFS_TRACE_TRACING </td>
 <td>0x00000100</td>
</tr>
<tr>
 <td>deletion </td>
 <td>YAFFS_TRACE_DELETION </td>
 <td>0x00000200</td>
</tr>
<tr>
 <td>buffers </td>
 <td>YAFFS_TRACE_BUFFERS </td>
 <td>0x00000400</td>
</tr>
<tr>
 <td>nandaccess </td>
 <td>YAFFS_TRACE_NANDACCESS </td>
 <td>0x00000800</td>
</tr>
<tr>
 <td>gc_detail </td>
 <td>YAFFS_TRACE_GC_DETAIL </td>
 <td>0x00001000</td>
</tr>
<tr>
 <td>scan_debug </td>
 <td>YAFFS_TRACE_SCAN_DEBUG </td>
 <td>0x00002000</td>
</tr>
<tr>
 <td>mtd </td>
 <td>YAFFS_TRACE_MTD </td>
 <td>0x00004000</td>
</tr>
<tr>
 <td>always </td>
 <td>YAFFS_TRACE_ALWAYS </td>
 <td>0x40000000</td>
</tr>
<tr>
 <td>bug </td>
 <td>YAFFS_TRACE_BUG </td>
 <td>0x80000000</td>
</tr>
</table>
<h2>Flag meanings</h2>
<p>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.</p>
<h2>Setting flags at runtime</h2>
<p>The flags can be set or cleared by echoing the name of the flag into /proc/yaffs with a '+' or '-':<br />
<code>echo +os-write &gt; /proc/yaffs</code></p>
<p>It can be set to to all or none using '=', and then flags can be added or removed:<br />
<code>echo =none+os+write &gt; /proc/yaffs</code></p>
<p>And you can use numerical values, if you are so inclined (using standard C format):<br />
<code>echo 0xf00001 &gt; /proc/yaffs</code></p>
<p>So<br />
<code>echo all &gt; /proc/yaffs</code><br />
will turn all tracing on</p>
<p><b>Note</b> that you only see the output showing you the current trace state if the 'always' (YAFFS_TRACE_ALWAYS) flag is set, so to see what you are doing do this:<br />
<code>echo +always &gt; /proc/yaffs</code></p>
<h2>Setting flags at compile time</h2>
<p>Flags can be set in the code at compile-time by setting <code>yaffs_traceMask</code> in <code>yaffs_fs.c</code> (add new flags to <code>always</code> and <code>bad_blocks</code> which are set by default)</p>
</div>
      ";}s:9:"#attached";a:0:{}s:6:"#cache";a:3:{s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:5:"theme";i:2;s:8:"timezone";i:3;s:17:"url.path.is_front";i:4;s:16:"user.permissions";}s:4:"tags";a:4:{i:0;s:30:"config:filter.format.full_html";i:1;s:8:"node:351";i:2;s:9:"node_view";i:3;s:6:"user:3";}s:7:"max-age";i:-1;}}