1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 table.table, table.table td, table.table th 50 { 51 border-collapse: collapse; 52 background-color: white; 53 } 54 55 table.table 56 { 57 width: auto; 58 margin: 1em; 59 position : static; 60 font-family : Arial; 61 } 62 63 table.table td, table.table th 64 { 65 padding: 0.2em; 66 } 67 68 table.table td.number, table.table th.number 69 { 70 text-align: right; 71 } 72 73 table.table tbody tr th 74 { 75 text-align: left; 76 font-weight: normal; 77 width: auto; 78 } 79 80 table.table thead tr th, 81 table.table tbody tr th.category 82 { 83 padding: 0 0.2em; 84 } 85 86 table.table caption 87 { 88 font-weight: bold; 89 padding: 0.4em; 90 } 91 table.table th 92 { 93 font-weight : bold; 94 background : #acf; 95 } 96 --></style> 97 <title>ctr_FsAccesslogAnalyzer</title> 98 </head> 99 <body> 100<h1>ctr_FsAccesslogAnalyzer</h1> 101 <h2>Overview</h2> 102 <div class="section"> 103 <p> 104 ctr_FsAccesslogAnalyzer is a tool for detecting what may be inefficient file access not intended by the developer and due to CTR file system properties, and so forth.<br /> In most cases, Nintendo recommends resolving the warnings given by this tool. However, if the file access in question is intended by the developer or if there is no problem in the access speed itself, warnings given by this tool do not necessarily need to be resolved.<br /> 105 </p> 106 <p> 107 Also, this tool displays the following information in addition to warnings. 108 <ul> 109 <li>File access statistics</li> 110 <li>File access log format</li> 111 </ul> 112 </p> 113 </div> 114 <h2>How to Use</h2> 115 <div class="section"> 116 <p> 117 <h3>Preparing for Use</h3> 118 <p> 119 Change the program so that the file access log is displayed.<br /> Call <CODE>nn::fs::SetAnalysisLog(true)</CODE> in the fs library in the development build, and then all file access information beginning from <font color="red"><CODE>[FS_ANALYSIS]</CODE></font> will be output to the log during file access.<br /> To stop log output, call <CODE>nn::fs::SetAnalysisLog(false)</CODE>. 120 </p> 121 <h3>How to Use</h3> 122 <p> 123 By passing the obtained log output results to the tool as standard input (as follows), the analysis results will be output as standard output. (You can also pipeline output from the debugger as input to the tool.)<br /> 124 125<pre> 126 ctr_FsAccesslogAnalyzer32.exe < input.txt 127</pre> 128 129 Strings other than the access log's can be contained in the log passed to this tool. 130 </p> 131 <h3>Notes</h3> 132 <p> 133 This tool does not support file access logs from CTR-SDK versions prior to 4.1. 134 </p> 135 </p> 136 </div> 137 <h2>Output Format</h2> 138 <div class="section"> 139 <p> 140Output is displayed in the following order: file access statistics, warnings, and then the file access log format. <br />The formats for each are as follows. 141 <h3>File Access Statistics Format</h3> 142 <p> 143 File access statistics for each archive are displayed in the following format. 144 </p> 145 146<pre> 147Statistics 148 Archive name 149 Archive access statistic 1 150 Archive access statistic 2 151 Archive access statistic 3 152 Archive name 153 Archive access statistic 1 154 Archive access statistic 2 155 Archive access statistic 3 156</pre> 157 158 <p> 159 Supported archives: 160 <ul> 161 <li>RomFs<br />Access to the ROMFS archive</li> 162 <li>SaveData<br />Access to the save data archive</li> 163 <li>ExtSaveData<br />Access to the extended save data archive</li> 164 <li>Sdmc<br />Access to the SD Card archive</li> 165 </ul> 166 </p> 167 168 <p> 169 Information displayed for each archive: 170 <ul> 171 <li>TotalReadSize<br />Total size of reads from archive</li> 172 <li>TotalReadCount<br />Number of reads from archive</li> 173 <li>MinReadSize<br />Minimum size of reads from archive (specified)</li> 174 <li>MaxReadSize<br />Maximum size of reads from archive (specified)</li> 175 <li>TotalWriteSize<br />Total size of writes to archive</li> 176 <li>TotalWriteCount<br />Number of writes to archive</li> 177 <li>MinWriteSize<br />Minimum size of writes to archive (specified)</li> 178 <li>MaxWriteSize<br />Maximum size of writes to archive (specified)</li> 179 </ul> 180 </p> 181 <h3>Warnings</h3> 182 <p> 183 The type of warning and the history for the accesses that caused the warning are displayed in the following format. 184 </p> 185<pre> 186Warnings 187 Types of warnings 188 File access history 1 189 File access history 2 190 File access history 3 191 File access history 4 192 Types of warnings 193 File access history 1 194 File access history 2 195</pre> 196 197 <p> 198 Types of warnings 199 <ul> 200 <li>FrequencyFlush<br /> The same file is being written and flushed a large number of times in a short period of time.<br /> Nintendo recommends disabling flushing, write to a file, and then flushing only once.<br /> Also see <a href="../api/nn/fs/briefing/betterUsage.html">Improved Use of the File System</a>. 201 </li> 202 <li>FrequencySmallWrite<br /> A large number of small writes are being performed.<br /> Nintendo recommends performing a single batch write, because there is an overhead associated with each write.<br /> Also see <a href="../api/nn/fs/briefing/betterUsage.html">Improved Use of the File System</a>. 203 </li> 204 <li>FrequencyOpenClose<br/ > The same file is being opened and closed a large number of times in a short period of time. 205 </li> 206 <li>FrequencyMountUnmount<br /> The same archive is being mounted and unmounted a large number of times in a short period of time. 207 </li> 208 <li>NotAlignedSequentialRead<br /> A buffer that is not 4-byte aligned is being passed to the file system.<br /> Alternatively, an archive is being accessed with a non-4-byte file offset.<br /> When boundaries are not aligned, the alignment is adjusted internally. This tends to decrease access speed.<br /> Misalignment is prone to occur while reading audio streaming playback data, which tends to cause skipping.<br /> 209 </li> 210 </ul> 211 </p> 212 </p> 213 </div> 214 <h2>Revision History</h2> 215 <div class="section"> 216 <dl class="history"> 217 <dt>2012/04/26</dt> 218 <dd>Initial version.<br /></dd> 219 </dl> 220 </div> 221 <hr><p>CONFIDENTIAL</p></body> 222</html>