Fixing Thread Names With Readlog (Windows Embedded CE 6.0)
1/5/2010
If a thread is the main thread of a process, its name will be the name of the process. Otherwise, the thread name is the thread start routine passed to CreateThread.
In many situations, the CeLog log file contains only handle values for threads, rather than thread names. Because the system contains many threads, this can be very inconvenient. However, you can use Readlog to obtain thread names, and output a new log file that contains those names.
Unlike CeLog, which uses profiling symbols to determine thread names, Readlog uses symbols created for all the files in the flat release directory. In other words, Readlog can obtain thread names for all modules in the flat release directory, including modules from both the MODULES section and the FILES section.
Readlog obtains the thread names, and outputs a new log file. You can then view the new log file in Kernel Tracker or in Readlog, and identify threads by their names in addition to their handles.
To fix thread names in a log file
Open a command window.
Navigate to the flat release directory.
At the command prompt, type
Readlog -fixthreads <LogFile>.clg. <NewLogFile>.clg
This command causes Readlog to create a new copy of the .clg log file with actual thread names. You can now view the log file with Kernel Tracker.
For information about using Remote Kernel Tracker to view the contents of a log file, see Starting Kernel Tracker in File Mode.
Robust Programming
The amount of information available about thread names from a CeLog log file depends on whether the run-time image includes a profiling or non-profiling build of the kernel, and on the location of the modules that contain the threads.
- Profiling builds
When you collect CeLog data on a run-time image that includes a profiling build of the kernel, the celog file will only contain names for threads in the MODULES Section and the main thread of each process. CeLog uses the profiling symbols to provide names for the threads in the log. Therefore, because the profiling symbols only include information for modules that are stored in the MODULES section of ROM, CeLog cannot provide names for threads that are part of the FILES Section of ROM or threads that are not part of ROM. - Non-profiling builds
For a non-profiling build, CeLog cannot provide names for any threads except the main thread of each process.