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.

Log prints no longer going to logger buffer

Other Parts Discussed in Thread: SYSBIOS

Hi

  • CGT 7.2.6.
    IPC 1.24.3.23
    SYS/BIOS 6.33.5.46
    XDCtools 3.23.2.47
  • C6472

Before updating to the above build configuration, my log prints were being put in loggerBuf0. Now they are being put into "Main Logger" (same .cfg script). I found this by going to Tools->RTA->Raw Logs and reviewing the various logs that were available. I don't know how I even created "Main Logger". Can you tell me how to get the logs back into loggerBuf0?

There is also a RTASystemLog. How do I control its size?

Cheers

// Sets log_printf time to be in usec.
// todo: we should enable these in the future for the CPU to download logs to a .txt file when we get an assert.
var Agent = xdc.useModule("ti.sysbios.rta.Agent");
Agent.addSupportLogger = true;
Agent.sysbiosTaskLogging = false;
Agent.sysbiosSwiLogging = false;
Agent.sysbiosHwiLogging = false;
Agent.loadLogging = false;
Agent.transport = Agent.Transport_STOP_MODE_ONLY;

// Log_prints are turned on/off by setting the USER value below to
// RUNTIME_OFF
//
// Logging       Diags_USER
// ---------     ----------
// Framework          1   Includes logs generated by interaction with the host.
// Twod               2
// color              3
// Doppler/MMode      4   Combining since they will not be run at the same time.
// Error              5
// SRIO               6

var Diags = xdc.useModule('xdc.runtime.Diags');
// Set log_print masks to RUNTIME_ON so that we can turn them on/off realtime in the code.
// Eg:
// - to turn diages_USER1 off: Diags_setMask( "xdc.runtime.Main-1" );
// - to turn diages_USER1 on: Diags_setMask( "xdc.runtime.Main+1" );
Main.common$.diags_USER1 = Diags.RUNTIME_ON;
Main.common$.diags_USER2 = Diags.RUNTIME_ON;
Main.common$.diags_USER3 = Diags.RUNTIME_ON;
Main.common$.diags_USER4 = Diags.RUNTIME_ON;
Main.common$.diags_USER5 = Diags.RUNTIME_ON;
Main.common$.diags_USER6 = Diags.RUNTIME_ON;
/* Turn on USER1 logs in Task module */
Task.common$.diags_USER1 = Diags.RUNTIME_ON;
Task.common$.diags_USER2 = Diags.RUNTIME_ON;
Task.common$.diags_USER3 = Diags.RUNTIME_ON;
Task.common$.diags_USER4 = Diags.RUNTIME_ON;
Task.common$.diags_USER5 = Diags.RUNTIME_ON;
Task.common$.diags_USER6 = Diags.RUNTIME_ON;

var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var loggerBuf0Params = new LoggerBuf.Params();
loggerBuf0Params.numEntries = 256;
loggerBuf0Params.instance.name = "loggerBuf0";
loggerBuf0 = LoggerBuf.create(loggerBuf0Params);
Program.global.hLogger = loggerBuf0;

Main.common$.logger = Program.global.hLogger;

 

 

  • Hi

    I deleted all my logger code and followed the example code in the BIOS cdoc and still have my logs going to "Main Logger"

    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

    var loggerBuf0Params = new LoggerBuf.Params();
    loggerBuf0Params.exitFlush = true;
    loggerBuf0Params.numEntries = 256;
    loggerBuf0Params.instance.name = "loggerBuf0";
    loggerBuf0 = LoggerBuf.create(loggerBuf0Params);
    Defaults.common$.logger = loggerBuf0;
    Program.global.loggerBuf0 = loggerBuf0;
    Diags.setMaskMeta("my.pkg.%", Diags.USER1, Diags.RUNTIME_ON);
    Diags.setMaskMeta("my.pkg.%", Diags.USER2, Diags.RUNTIME_ON);
    Diags.setMaskMeta("my.pkg.%", Diags.USER3, Diags.RUNTIME_ON);
    Diags.setMaskMeta("my.pkg.%", Diags.USER4, Diags.RUNTIME_ON);
    Diags.setMaskMeta("my.pkg.%", Diags.USER5, Diags.RUNTIME_ON);
    Diags.setMaskMeta("my.pkg.%", Diags.USER6, Diags.RUNTIME_ON);

    Any ideas why BIOS wont log to loggerBuf0?

    Cheers

  • Somehow this is creating the "Main Logger" and stopping the logs from going into loggerBuf0

    var Agent = xdc.useModule("ti.sysbios.rta.Agent");
    Agent.addSupportLogger = false;
    Agent.sysbiosTaskLogging = false;
    Agent.sysbiosSwiLogging = false;
    Agent.sysbiosHwiLogging = false;
    Agent.loadLogging = false;
    Agent.transport = Agent.Transport_STOP_MODE_ONLY;

    I added the rta agent to get nsec timestamp as per

    http://e2e.ti.com/support/embedded/bios/f/355/p/138924/542656.aspx#542656

  • Tried this as per the post I mentioned above and still got nothing in loggerBuf0 but everything in "Main Logger"

    var Agent = xdc.useModule("ti.sysbios.rta.Agent");
    Agent.addSupportLogger = true;

    If I remove the above code, loggerBut0 works as its supposed to. But without RTA, the log timestamp is in cycles not nsec. Arg.

    B.T.W, I created the C64x+ BIOS log example to test this. The logger buf in that example no longer works when you add the above .cfg script.

    The saga continues.......

  • This might be a clue as to what is going on. Prior to upgrading to the new bios, we never got this error

    warning: xdc.runtime.Main: "C:/Program Files/Texas Instruments/bios_6_33_05_46/packages/ti/sysbios/rta/Agent.xs", line 442: xdc.runtime.Main : xdc.runtime.Main.common$.logger has already been assigned, Agent reassigning logger to 'Main Logger'

    which is caused by the code we had used before in our .cfg

    Main.common$.logger =logger0;

    Somehow the new BIOS agent does not like use setting the main logger to our logger0

  • The 6.33.05.46 bios has a bug. It will not let a user specify a different logger other than "Main Logger". See the Agent.xs file at line 440. This was not in the previous bios 6.31.04.27.

        /* Warn if the user has already set the logger for this module. */
        if (Main.common$.logger != undefined) {
            Main.$logWarning(Main.$name + ".common$.logger has already " +
                             "been assigned, Agent reassigning logger to " +
                             "'Main Logger'", Main);
        }
        Main.common$.logger = mainLog;

    I would like to use the agent to get correct timestamps and would also like to use the agents swi, task, etc logs for our product dumps. Is there a way to do not have the bios use "Main Logger" and instead use logger0?

    Or must I delete my logger0 and use the RTA log buffer? (i.e. why fight the tide and swim with the "Main Logger" instead?)

    I tried using deleting the logger0 and use the RTA "Main Logger" but I cannot create a global for the logger handle. (I want to do this for assert uploading. see http://e2e.ti.com/support/embedded/bios/f/355/p/150020/734221.aspx#734221 )

    var loggerBuf0 = Main.common$.logger;
    Program.global.loggerBuf0 = loggerBuf0;

    Unfortunately I get the error below. How can I create a global of the "Main Logger" handle for uploading the logger buffer when we assert?

    js: "C:/Program Files/Texas Instruments/xdctools_3_23_02_47/packages/xdc/cfg/Main.xs", line 46: XDC runtime error: Program.global.loggerBuf0 (of type class org.mozilla.javascript.Undefined): unsupported generation type
    xdctools_3_23_02_47\gmake.exe: *** [package/cfg/M2_EVM6472_p64P.xdl] Error 1
    xdctools_3_23_02_47\gmake.exe: *** [package/cfg/M2_EVM6472_p64P.xdl] Deleting file `package/cfg/M2_EVM6472_p64P.h'
    xdctools_3_23_02_47\gmake.exe: *** [package/cfg/M2_EVM6472_p64P.xdl] Deleting file `package/cfg/M2_EVM6472_p64P.c'
    Warning: directory "D:/packages" on package path does not exist
    Warning: directory "D:/examples" on package path does not exist
    Warning: directory "D:/vws/ejp_M2_evm6472_256pntFft_3/spDsp/EVM/M2_EVM6472_configuration/RTSC" on package path does not exist
    js: "C:/Program Files/Texas Instruments/xdctools_3_23_02_47/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake: *** [configPkg/linker.cmd] Error 1
    gmake: Target `all' not remade because of errors.

  • Hi Eddie,

    The Main logger that Agent creates is for all non-XDC modules (i.e. your code). Is there a specific reason why you want your log events to go to your loggerBuf0 instead of the Main logger? You can still control the size of the buffer via ""Agent.mainLoggerSize".

    If you want to use your logger, you can set "Agent.mainLogging" and "Agent.mainLoggingRuntimeControl" to false. Then create your logger and set the Main.common$.logger as noted in the first post.

    The changes to the Agent module were supposed to make things easier for the standard user (i.e. create and plug in the Main, SYS/BIOS and Load loggers). Sorry if it did the opposite for you.

    Todd

  • Hi Todd

    ToddMullanix said:
    The changes to the Agent module were supposed to make things easier for the standard user

    I think the key words are "for the standard user". I'm a non-standard kinda person. (but an update to the cdoc would be helpful stating that the loggerBuf example is void if one uses that Agent)

    ToddMullanix said:
    You can still control the size of the buffer via ""Agent.mainLoggerSize".

    Did that. It works great, but how can I pass the handle of the Main Logger to the program.globals?

    I'd like to have our CPU upload the logs when an assert occurs according to http://e2e.ti.com/support/embedded/bios/f/355/p/150020/734221.aspx#734221

    var loggerBuf0 = Main.common$.logger;
    Program.global.loggerBuf0 = loggerBuf0;

    Unfortunately I get the error below. How can I create a global of the "Main Logger" handle for uploading the logger buffer when we assert?

    js: "C:/Program Files/Texas Instruments/xdctools_3_23_02_47/packages/xdc/cfg/Main.xs", line 46: XDC runtime error: Program.global.loggerBuf0 (of type class org.mozilla.javascript.Undefined): unsupported generation type
    xdctools_3_23_02_47\gmake.exe: *** [package/cfg/M2_EVM6472_p64P.xdl] Error 1
    xdctools_3_23_02_47\gmake.exe: *** [package/cfg/M2_EVM6472_p64P.xdl] Deleting file `package/cfg/M2_EVM6472_p64P.h'
    xdctools_3_23_02_47\gmake.exe: *** [package/cfg/M2_EVM6472_p64P.xdl] Deleting file `package/cfg/M2_EVM6472_p64P.c'
    Warning: directory "D:/packages" on package path does not exist
    Warning: directory "D:/examples" on package path does not exist
    Warning: directory "D:/vws/ejp_M2_evm6472_256pntFft_3/spDsp/EVM/M2_EVM6472_configuration/RTSC" on package path does not exist
    js: "C:/Program Files/Texas Instruments/xdctools_3_23_02_47/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake: *** [configPkg/linker.cmd] Error 1
    gmake: Target `all' not remade because of errors.

    Cheers

  • There is no supported method to get the logger handle for any of the loggers created by the Agent module. You could create the loggers yourself as needed and disable the creation within the Agent. For example

    /* Create default logger for the whole system. */
    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
    var loggerBuf0Params = new LoggerBuf.Params();
    loggerBuf0Params.numEntries = 256;
    loggerBuf0Params.instance.name = "loggerBuf0";
    loggerBuf0 = LoggerBuf.create(loggerBuf0Params);
    Program.global.hLogger = loggerBuf0;

    var Agent = xdc.useModule("ti.sysbios.rta.Agent");
    Agent.sysbiosTaskLogging = false;
    Agent.sysbiosTaskLoggingRuntimeControl = false;
    Agent.sysbiosSwiLogging = false;
    Agent.sysbiosSwiLoggingRuntimeControl = false;
    Agent.sysbiosHwiLogging = false;
    Agent.sysbiosHwiLoggingRuntimeControl = false;
    Agent.loadLogging = false;
    Agent.loadLoggingRuntimeControl = false;
    Agent.mainLogging = false;
    Agent.mainLoggingRuntimeControl = false;
    Agent.transport = Agent.Transport_STOP_MODE_ONLY;
    Main.common$.diags_USER1 = Diags.RUNTIME_ON;
    Main.common$.diags_USER2 = Diags.RUNTIME_ON;
    Main.common$.diags_USER3 = Diags.RUNTIME_ON;
    Main.common$.diags_USER4 = Diags.RUNTIME_ON;
    Main.common$.diags_USER5 = Diags.RUNTIME_ON;
    Main.common$.diags_USER6 = Diags.RUNTIME_ON;
    Main.common$.logger = loggerBuf0;

    Todd

  • That solves the problem.

    Thanks a bunch Todd.