Monday, September 15, 2008

CeLog

Its one of the most helpful tools that I have used in WinCE BSP development. Celog is an event-tracking tool that logs a set of predefined ( I think configured or filtered would be an apt word) for this) CeLog collects the data given by various sources such as applications or drivers in a location configured in registry.

Using tools such as CeLogFlush.exe, we can periodically collect the data and can be analyzed in a development workstation.
A Special Thanks to Sue Loh, for posting a really helpful and detail documentation in her blog in MSDN for using CeLog along with tools such as kernel tracker.
While working on the wrist pc project, we were experiencing some unexpected slow of system while booting up and running applications and we were pondering in dark just to figure out the cause of the snail's pace performance. Then I came across the tutorial given by Sue Loh in her microsoft blog on using CeLog on a standalone machine.

Previously I had used Remote Kernel Tracker, which is built into the platform builder for connecting to a development board using CoreCon and use CeLog to gather Kernel Data (such as interrupt, thread switching, events and other information), on a real time basis (well pretty close to real time). But for this the board needs to be connected to over ethernet or serial to a development work station.

Most of the times problems will arise while testing under real scenarios. So debugging such issues, I came up with a solution. I made a CAB file with the following things:
  • celog.dll
  • celogflush.exe
  • ITaskMgr_arm.exe (A free task manager I found in net, http://urana.info/mobile/wince/itaskmgr/index.html)
  • oscapture.exe
(Also added shortcuts in start menu to launch the exes too, just for the ease of use)

I distributed this cab file among my team and asked them to install in all the boards that we were using. So at any point of the system is showing any slowness, start the 'CeLogFlush.exe' application, which will periodically dump the performance data on to a file. After significant data is gathered, they can use the ITaskMgr_arm.exe to kill the CeLogFlush flush instance and then take the dumped file.

This file can be opened in Kernel tracker to view the information.

In later posts I will explain in detail about CeLogFlush and other tools for performance monitoring.

Regarding how to analyze the performance data, Sue has put up a detailed tutorial in her blog.

6 comments:

Rashmi said...

Nice info! You have talked about a location configuered in registry at which the data gets collected. But I cannot find such location. Can you help me to look?

Vaisakh P S said...

Sorry for the delayed reply Rashmi, was really caught up with work.

These are the registry settings that I used for setting up.

[HKEY_LOCAL_MACHINE\init]
"Launch05"="CeLogFlush.exe" -- include celog.dll

[HKEY_LOCAL_MACHINE\System\CeLog]
"Transport"="LocalFile"
"FileName"="celog.clg"
"BufferSize"=dword:100000// 1MB
"ZoneCE"=dword:815263 "FlushTimeout"=dword:1388// 5 sec
"FileFlags"=dword:1 // Keep file open
"ThreadPriority"=dword:C8 // Priority increased to 200

Vaisakh P S said...

You can get more info in this page:

http://msdn.microsoft.com/en-us/library/aa935735.aspx

Unknown said...

Great article Vaisakh! I'm using VS 2005 and I cannot find CeLogFlush.exe, do you know where is it?

Vaisakh P S said...

Hi,

Its been sometimes since i worked on Windows CE. But how about out the output bin directory???

Regards,
Vaisakh P S

Vaisakh P S said...

hey u need to enable a a build env variable, check the last section in this link

http://msdn.microsoft.com/en-us/library/ee479818.aspx

set that environment variable in build and build ur code, u hsould have it in the out directory.

Regards,
Vaisakh P S