CELog and Kernel Tracker

Remote Kernel Tracker

1.  Introduction

The Remote Kernel Tracker tool provides a visual representation on a development workstation of OS and application events occurring on a Windows CE–based device. It shows all processes and threads in the system and when these processes and threads are created, run, stopped, or killed. It also shows when processes and threads are sleeping. This data provides the means for a developer to track system-wide program execution.

2.  Usage

The Remote Kernel Tracker tool allows you to view the following in a real-time environment:
  • Thread interactions
  • Internal dependencies
  • System state information
  • System events, mapped onto the thread that was executing at the time they occurred
  • System interrupts
  • All processes and threads in the system, including when these processes and threads are:
    • Created
    • Run
    • Stopped
    • Sleeping

3.  How to enable

  1. To enable CE log, in OS design property page, under build options,
·         Enable Event tracking during boot
·         Flush Tracked events to Release Directory.


Figure 1: Project Properties

Figure 2: Enabling Event generation

  1. Copy and Paste the Following in Platform.reg (release directory)
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE\System\CeLog]
    "ZoneCE"=dword:815263
    "Transport"="LocalFile"
    "FlushTimeout"=dword:7D0            ; 2000 ms per flush
    "SavedFlushes"=dword:1                        ; 16 x 2000 ms = 32 seconds
    "FileName"=\\celog.clg

  1. Now give Make run time image.

4.  Using the CElog File to fixing the thread name

After deploying the image to the target board, run the application (if any) to test the thread activity. The celog.clg file will get saved under Ram \\celog.clg. Copy the file to the local machine. Here I’m using an application will do streaming from camera in 60FPS and do OCR process if enabled.
Once application executes and completes its process close the application and copy the “celog.clg” that generated in Ram \\celog.clg to the PC.

Open Visual studio command prompt build, build->Open Release directory in build window.
Figure 3: Release Directory Command prompt

Run the following command
“readlog –fixthreads g:\celog.clg g: \outputlog.clg”

Figure 4: Fixing Thread Names

e:\celog.clg – Input log file
e:\outputlog.clg – generated output file.
Now the output Celog files get generated with the thread name fixed.

5.  Viewing the log and Analyzing the Thread

To open the .clg file in kernel tracker, go to Target -> Remote Tools -> Kernel Tracker.
Figure 5: Kernel Tracker
In File -> open, give the output log file location.
You can view the different threads and its timings and all.
Figure 6: Thread Flow 1

Figure 7: Thread flow 2
 

6. Creating the log file during runtime and not loading during image booting

With the above method Celog will started automatically after image loading. In some case we may need to log the data after some time or after some case. It is also possible.
  1. Don't enable the automaticall flush in build options. This will not add the celogflush.exe with the image.So that logging will not start after image is loaded. 
 
2. Since the automatically flush options is removed. We have to add the celogflsuh.exe in the bib file.
3. celogflush.exe can be executed at any time, using the Createprocess API.
The above steps will help to control the starting of celog.

Comments

Popular posts from this blog

Drawing National flag using Java Applet

WinCE Essentials Volume and File Control