Share via


Event Tracking Implementation

The event tracking subsystem is implemented as a library that can be loaded dynamically into the kernel. While no particular kernel settings are required to use it, the profiling kernel provides more event tracking data than the kernel would without profiling. Events that are omitted on the non-profiling kernel are interrupts, kernel calls, and translation look-aside buffer (TLB) misses. To enable event tracking on any kernel, call LoadKernelLibrary with the name of the event-tracking library, usually Celog.dll.

The Windows CE build environment provides a single build option to enable event tracking in the profiling kernel. To enable event tracking for the build, choose Settings from the Platform menu and then the Build Options tab and set Enable Profiling. This is equivalent to setting the environment variables IMGCELOGENABLE and IMGPROFILER to 1.

When the Windows CE–based device begins running an image with event tracking enabled, a file named Celog.clg is created in the %_FLATRELEASEDIR% directory. This is a file of raw data, which is updated periodically as your device runs. To look at the data that has been collected, you may use Readlog.exe, which can be found in the %_WINCEROOT%\Public\Common\Oak\Bin\i386 directory. Additionally, a graphical viewer, the Remote Kernel Tracker, is available in Platform Builder for viewing the log file.

As an OEM, you can create your own events to log by creating your own structures and calling CeLogData with the appropriate parameters. However, there is a limit on the number of user-defined events that can be active at any one time. The limit sets a starting point and a max. You can starting assigning identifier values from CELID_USER forward and must restrict identifier assignments to less than or equal to CELID_MAX. Identifier values located below CELID_USER are reserved for OS events.

The event-tracking engine supports the functions in the following table for use by the kernel.

Function Description
CeLogData Called by the kernel whenever an event occurs that can be tracked.
CeLogInterrupt Called by the kernel when an interrupt occurs and before the interrupt service routine (ISR) is called, and again when the ISR returns to the kernel.
CeLogSetZones Called to change the current tracking zones.
CeLogQueryZones Called by the kernel during a call to CeLogGetZones to query the current zone settings.

If you replace the event-tracking engine (Celog.lib), your OAL must implement these functions.

The following table shows the IOCTLs used by the event-tracking engine.

IOCTL Description
IOCTL_CELOG_GETDESKTOPZONE Used to query the default zone settings in the registry of the host machine.
IOCTL_CELOG_REGISTER Used to register the required event-tracking APIs with the kernel.

See Also

OEM Adaptation Layer | Enabling Events and Zones During Boot | Event Tracking Options | Log File Flushing in the Event Tracking Subsystem | Replacing the Default Celog.dll

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.