The query is regarding the updation of Log Module functionality with the one in Sys/Bios.
In the Existing code, we have something like this:
Existing tcf uses the following:bios.LOG.create("LOG1");bios.LOG.instance("LOG1").bufLen = 1024;bios.LOG.instance("LOG1").comment = "Purpose1";
Usage in C:LOG_printf(LOG1,"%d %d",(x1),(x2))
bios.LOG.create("LOG2");bios.LOG.instance("LOG2").bufLen = 8192;bios.LOG.instance("LOG2").comment = "Purpose2";Usage in C:LOG_printf(LOG2,"%d",(x1))
bios.LOG.create("LOG3");bios.LOG.instance("LOG3").bufLen = 1024;bios.LOG.instance("LOG3").comment = "Purpose3"Usage in C:LOG_printf(LOG3,"%d %d",(x1),x2)
In Sys/Bios, the equivalent of LOG_printf (Log_printf*) does not take LoggerBuf_Handle as an input
So while using Log_printf in Sys/Bios, how does it know which buffer to write to? In the above example there are 3 choices.
The Log APIs changed from BIOS5. They offer more flexibility now and at cost of some complexity.
First of all, the logger is not specified in the Log call. This was an attempt to minimize the number of cycles that it took to complete the Log call. Instead loggers can be tied to modules and/or source files. Any XDC module (e.g. SYS/BIOS' Task or HeapMem) can have a specific logger assigned to it by setting the module's common$.logger setting. There is a special module called Main that sets up all non-XDC modules. So you can create a logger and assign it to Main.common$.logger.
If you do not want to configure individual modules, you can set Defaults.common$.logger and all un-initialized modules inherit from it.
SYS/BIOS has a Log example that shows the above functionality.
Note: If a single logger for all non-XDC modules does not offer enough granularity, you can use the xdc.runtime.Registry module to have an additional logger for non-XDC modules. The Registry module also offers more granularity with the Diags mask settings for non-XDC modules. Please refer to the XDC documentation for more details.
As per my understanding, with any of the above modules we specify something like
<Module>.common$.logger = LoggerBuf.create();
Thus, even with the Registry module, we can use only one loggerbuf.
How do we use more than one LoggerBuf for a particular module?
I want to create multiple loggers for different functions.
Dushyant SahniHow do we use more than one LoggerBuf for a particular module?
You cannot have more than one Logger for a particular module.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.