Re: Capturing debug messages using CeLog on a release terminal

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Don't set the shipbuild flag in your retail kernel (because it will #define RETAILMSG and DEBUGMSG into nirvana) and don't set Enable CE Target control and don't set Enable Kernel Debugger. I'm not entirely sure if DEBUGMSGs (as opposed to RETAILMSGs) still work when replacing dll's in a retail build with their debug counterparts. I think it should, otherwise just #undef DEBUGMSG and #define DEBUGMSG RETAILMSG in the debug dll's you're including in the retail image. You can capture the debugmessages by hooking up a serial cable to whatever port you defined as your debug serial port and capture using for example Tera Term.

CeLog has nothing to do with debugmessages. That's only tracking CeLog events (use kernel tracker to show that). To enable that, simply enable profiling and the flush log settings in the platform and rebuild. You may need to set the registry entries to store the celog.clg on a storage device (I think it does that automatically when \Release can't be found, but not sure). If you want to see the threadnames and you didn't enable profiling, you can fix the celog.clg by copying it from your device to your flatreleasedir and opening a build window. Then type:

readlog -fixthreads celog.clg celogthreads.clg

Now you can open the .clg file in kernel tracker and see the thread names. Sue Loh wrote some excellent documentation on CeLog tools, it's all in MSDN.

Also be careful with setting ZoneCE to 0xffffffff. I've seen a couple of platforms where setting this results in a hanging kernel.

Hope this helps,

Michel Verhagen, eMVP
EmbeddedFusion
www.EmbeddedFusion.com
mverhagen at embeddedfusion dot com


Josh wrote:
Does anyone have any experience capturing and parsing debug messages using CeLog tools (oscapture, celogflush, readlog)? I.e., the sort of messages printed to the console under the Platform Builder debugger.

I have a problem that I can't debug in Platform Builder. It's sort of a heisenbug - the more debug I enable, the less stable the platform becomes, limiting my ability to get usable debug. I'd like to build a release version of my OS, but substitute a couple of the DLLs built in debug mode, and then capture the relevant debug, on the theory that the simpler system will be more robust.

I'm able to capture logs, but the debug statements that I would see in a Debug Build under Platform Builder aren't present, or if they are, readlog.exe isn't parsing them out. Instead, I get all the normal kernel tracker type stuff, which I don't really need. Ideally I'd want to suppress that for starters, and get the debug statements only.

Is there some key registry setting that I'm not tweaking properly? I'm running on CE 5.0, with the following settings, which I thought would suffice:

[HKEY_LOCAL_MACHINE\DebugZones]
"ndis"=dword:ffff
"ndisuio"=dword:ffff
"wzcsvc"=dword:ffff
"wzcapi"=dword:ffff


[HKEY_LOCAL_MACHINE\System\CeLog]
"ZoneCE"=dword:ffffffff


It seems to me that I've pulled this sort of thing off before when debugging a bluetooth issue, but my notes aren't great on the subject - I must be missing something.

Thanks,

- Josh



--
.



Relevant Pages

  • Re: How to optimize startup time?
    ... you could still generate serial debug messages and send RETAILMSG ... The kernel works stable now for a while, a lot testing is allready done ... Does anybody have an idea on how to get more info from the retail kernel ...
    (microsoft.public.windowsce.platbuilder)
  • Re: OAL logging library
    ... While OALLog will still work in RETAIL mode, ... turning on debug zones to help you debug a hanging kernel will in fact ...
    (microsoft.public.windowsce.platbuilder)
  • Re: DEBUGMSGs in retail build + USB enumeration problem
    ... If you just build your debug kernel, then copy the debug versions of the drivers you want debug info on into your retail flatreldir, and do a makeimg, you should get debugmsg info out of the serial port in your retail image. ... device at a time plugged into the single USB port. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Very slow Kernel Debugger when loading modules
    ... When building a retail version of the kernel with KITL and KDB enabled ... So you can build only modules as debug which you need to debug and ...
    (microsoft.public.windowsce.embedded)
  • Re: DEBUGMSGS
    ... Are you running a Debug build of the driver? ... DEBUGMSGmaps to nothing in a Retail build and a Retail build of ... i am unable to see any of the DEBUGMSG. ...
    (microsoft.public.windowsce.platbuilder)