Manual Log File Flushing (Windows Embedded CE 6.0)
1/5/2010
While automatic flushing, as done by CeLogFlush.exe, makes it easy to collect data, sometimes you want control over exactly when the flushes take place. CeLog Event Tracking supports functionality that you can use to manually flush the contents of the RAM buffer to a file, or to discard the contents of the RAM buffer.
Typically, developers use manual flushing to clear the log immediately before running a test application, and to flush it immediately after the test is done. This method is also ideal for capturing custom events that are logged by an application.
Unrestricted event logging can quickly accumulate a very large amount of data. Since this data is written to a fixed-size RAM buffer, logging too much data may exhaust the space in the buffer and lose the most recent events. To maximize the length of time you can collect data, you may want to reduce the number of collection zones in use, and to increase the size of the buffer.
The following instructions use Target Control Window commands to provide an example of how to manually control data buffering and flushing. You can choose different buffer sizes or zone settings as needed.
For more information about using the Target Control Window, see Using Target Control Commands with CeLog.
To load CeLog manually and begin collecting data
In the Target Control window, type
log –buf 0x400000 0x62
This sets the buffer size to 4MB, and enables a minimal set of zones.
When the Target Control window displays a prompt asking if you want to load CeLog, type
y
This causes Platform Builder to load CeLog.dll.
After completing these steps, CeLog.dll begins storing data in its RAM buffer, but no flushing applications have been enabled to move data from the buffer to a log file. If the buffer fills up, new data will be discarded until the older buffered data is manually cleared or flushed.
To manually collect data and then flush it to a file:
In the Target Control window, type
log –clear
This discards any data that was collected since you last cleared or flushed, or since you loaded CeLog.dll.
Perform the action you want to collect data from. For example, you might start a test application or click on some UI elements you want to measure data about.
In the Target Control window, type
log –flush
This flushes collected data to the default file, \release\celog.clg.
You can also choose a filename, as in this example.
log –flush \release\manual.clg
This flushes the collected data to a file named manual.clg. There is no need to wait any time before flushing, because the data has already been written to the RAM buffer that you are flushing.
After the data is written to a log file, you can view it with the Readlog Viewing Tool or Kernel Tracker.