Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333522

Summary: Log events lost when Text.isLoaded set to false
Product: [Technology] RTSC Reporter: Ramsey Harris <ramsey>
Component: RuntimeAssignee: Sasha Slijepcevic <sascha>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: d-russo
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ramsey Harris CLA 2011-01-04 19:35:46 EST
I am using Log_print#() to raise log events from a registered Classic C module. The logger instance is LoggerBuf. When Text.isLoaded == true, the log events are raised but when Text.isLoaded == false, the log events are not raised. The following code fragments illustrate what I'm trying to do.

TsrKnl.c
-------------
Registry_Desc Registry_CURDESC;
Registry_addModule(&Registry_CURDESC, "TsrKnl");
Diags_setMask("TsrKnl+1");
Log_print1(Diags_USER1, "waited %d msec", (IArg)waitTimeMs);


ComputeDevice.cfg
--------------------
var Registry = xdc.useModule('xdc.runtime.Registry');
Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;
var Text = xdc.useModule('xdc.runtime.Text');
Text.isLoaded = false;
Comment 1 Dave Russo CLA 2011-02-24 19:32:39 EST
The root cause is that Diags implicitly disables Diags_setMask() when Text.isLoaded is false.  It does this because, prior to the Registry module introduction, it was impossible for Diags_setMask() to have any effect when Text.isLoaded == false; Diags_setMask() matchs its string argument against each module's name string which is not loaded, so Diags_setMask() will never find a matching module to control.

Now that Registry is in play, Diags should allow Diags_setMask() even if Text.isLoaded is false.
Comment 2 Sasha Slijepcevic CLA 2011-03-03 20:19:09 EST
The bug is fixed in xdc-w27. The function Diags_setMask is always present, but the for-loop that goes through Diags_dictElem is used only if Diags_setMaskEnabled is true.
We could still eliminate the whole function if we required that Registry is specifically "used" in a user's config script. Right now, Diags call useModule on Registry unconditionally.
Comment 3 Dave Russo CLA 2011-11-09 18:55:46 EST
closing "ancient" resolved bugs