• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » Doubt in migrating Bios 5 LOG Module to LoggerBuf in Sys/Bios 6
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

Doubt in migrating Bios 5 LOG Module to LoggerBuf in Sys/Bios 6

This question is answered
Dushyant Sahni
Posted by Dushyant Sahni
on Apr 12 2012 06:04 AM
Intellectual355 points

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

macro Void 
Log_print2(Diags_Mask mask, String fmt, IArg a1, IArg a2);

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.

Please comment.

SYS/BIOS LOG module LoggerBuf
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • ToddMullanix
    Posted by ToddMullanix
    on Apr 12 2012 13:04 PM
    Genius15630 points

    Hi Dushyant,

    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.

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dushyant Sahni
    Posted by Dushyant Sahni
    on Apr 16 2012 12:36 PM
    Intellectual355 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Apr 16 2012 12:48 PM
    Verified Answer
    Verified by David Friedland
    Genius15630 points

    Dushyant Sahni
    How do we use more than one LoggerBuf for a particular module?

    You cannot have more than one Logger for a particular module.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

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.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use