Community
Participate
Working Groups
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;
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.
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.
closing "ancient" resolved bugs