Hi,
Is there a way to compile out all the Log/Trace/Diag statements in codec engine and framework components?
Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
Is there a way to compile out all the Log/Trace/Diag statements in codec engine and framework components?
Thanks
What version of CE and FC are you using?
Chris
We don't provide that out of the box in those builds. You _may_ be able to rebuild the CE/FC sources with "the right compiler flags", but that may be an effort that's more than you bargained for.
In more recent builds, we do provide a 'notrace' library (along with 'debug' and 'release') that eliminates all the trace logs and helps with data footprint, and to a small degree, performance. Is that why you're looking for trace-free builds?
Chris
Chris Ring said:We don't provide that out of the box in those builds. You _may_ be able to rebuild the CE/FC sources with "the right compiler flags", but that may be an effort that's more than you bargained for.
I've been rebuilding the ce and fc. Any idea what are "the right compiler flags"?
Chris Ring said:
In more recent builds, we do provide a 'notrace' library (along with 'debug' and 'release') that eliminates all the trace logs and helps with data footprint, and to a small degree, performance. Is that why you're looking for trace-free builds?
Chris
Yes. footprint and speed.
RP said:I've been rebuilding the ce and fc. Any idea what are "the right compiler flags"?
CE and FC 3.x use xdc.runtime.Log and xdc.runtime.Assert for Logging and Assertion checking. If you rebuild the CE and FC libs with -Dxdc_runtime_Log_DISABLE_ALL and -Dxdc_runtime_Assert_DISABLE_ALL, it should eliminate all the trace statements.
FWIW, when we added the 'notrace' profile, it essentially meant adding the following to our config.bld script:
for (var t = 0; t < Build.targets.length; t++) {
/*
* add a 'notrace' profile for all libraries that is equivalent
* to the 'release' profile, but disables all Logs, Asserts, etc
*/
var rel_defs = Build.targets[t].profiles['release'].compileOpts.defs;
var rel_copts = Build.targets[t].profiles['release'].compileOpts.copts;
var notrace_defs = " -Dxdc_runtime_Log_DISABLE_ALL " +
"-Dxdc_runtime_Assert_DISABLE_ALL ";
Build.targets[t].profiles["notrace"] = {
compileOpts: {
defs: (rel_defs == undefined) ? notrace_defs :
"" + rel_defs + notrace_defs,
copts: (rel_copts == undefined) ? "" :
"" + rel_copts
}
};
}
For the extremely interested (and for myself later!) the xdc.runtime.Log APIs have some documentation here:
http://rtsc.eclipse.org/docs-tip/Using_xdc.runtime_Logging
... and the -D options to eliminate Logging are documented here:
http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/Log.html
Chris