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.

Masking log_printf messages - it won't stop logging those log_print



Hi

CCSv4.2.5.00005

XDCtools 3.20.8.88

IPC 1.22.3.23

SYS/BIOS 6.31.4.27

C6472

I followed the instructions in the post below and our code does not turn off the log_printf messages.

http://e2e.ti.com/support/embedded/bios/f/355/t/162631.aspx

I've attached our .cfg file where I used the code from ToddMullanix verbatim. Hope you could take a moment to review it. (had to rename to .txt to upload)

8712.M2_EVM6472.txt

The "C" code I am using the mask the interrupts is below. When I run, I hit breakpoints in the "if" and not in the "else", yet the log_prints continue to output.(i.e. when I hit the breakpoint, the Printf Logs tab shows an new set of logs).

The following is called by a task.

    if(0 == cnt)

    {
        
Diags_setMask( "xdc.runtime.Main-1" );
        
Diags_setMask( "xdc.runtime.Main-2" );
        
Diags_setMask( "xdc.runtime.Main-3" );
        
Diags_setMask( "xdc.runtime.Main-4" );
        
Diags_setMask( "xdc.runtime.Main-5" );
        
Diags_setMask( "xdc.runtime.Main-6" );
    
}
    
else
    
{
        
Diags_setMask( "xdc.runtime.Main+1" );
        
Diags_setMask( "xdc.runtime.Main+2" );
        
Diags_setMask( "xdc.runtime.Main+3" );
        
Diags_setMask( "xdc.runtime.Main+4" );
        
Diags_setMask( "xdc.runtime.Main+5" );
        
Diags_setMask( "xdc.runtime.Main+6" );        
    
}

I also tried adding the following to the .cfg. No luck.

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;

Could it be that there is something else that must be done for this to work for tasks that are created at runtime?

Thanks for your help.

Cheers

  • Hi,

    You need to set

    var Main = xdc.useModule('xdc.runtime.Main');
    Main
    .common$.diags_USER1 = Diags.RUNTIME_ON;

    ...

    not Task.common$.diags_USER1. You were enabling/disabling the logging within the SYS/BIOS Task module, not your code. Each XDC module (e.g. Task, Swi, HeapMem, Memory) has it's own diags mask. Main is for all non-XDC code (e.g. your code). If you want a diags mask for each of your source files you can use the xdc.runtime.Registry module.

    Todd

  • Just looked in your .cfg and realized you did have Main.common$.diags_USER1 = Diags.RUNTIME_ON.

    Can you put "xdc_runtime_Main_Module__root__V.mask" into a watch window. Does it change as you are calling the Diags_setMask calls? (it should)

    Take a look in the raw tab in ROV for the Main module. Can you post it? Here is one from an example that is working for me.

  • Hi Todd

    Thanks for responding so quickly. I'm in a crunch to find this bug.

    I put xdc_runtime_Main_Module__root__V.mask in my watch window and set a breakpoint at the first line of the code below

        if(0 == cnt)
        {
            Diags_setMask( "xdc.runtime.Main-1" );   // breakpoint here
            Diags_setMask( "xdc.runtime.Main-2" );
            Diags_setMask( "xdc.runtime.Main-3" );
            Diags_setMask( "xdc.runtime.Main-4" );
            Diags_setMask( "xdc.runtime.Main-5" );
            Diags_setMask( "xdc.runtime.Main-6" );
        }

    Unfortunately, the watch variable did not change. Its stayed at 0x3F00 when I stepped through the code above between the { and }.

    Below is my ROV. I noticed the Module_id is different.

    Cheers

  • Thanks. There was a bug in the version of XDCtools you are using. Here is a link that describes the problem.

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=333522

    Can you set Text.isLoaded = true; in your .cfg and confirm this is the problem.

    Todd

  • Hi Todd

    I added

    ToddMullanix said:
    Text.isLoaded = true;
    and watched xdc_runtime_Main_Module__root__V.mask. It is still set to 0x3F00 when I step through the code.

    Cheers
    Eddie

  • Eddie,
    let's verify if the problem is in the config or in the runtime phase. Can you look in the directory Debug/configPkg/package/cfg in your project and find a large *.c file in there? Open it in the editor and search for "isLoaded". You should find the line:
    __FAR__ const CT__xdc_runtime_Text_isLoaded xdc_runtime_Text_isLoaded__C = 1;
    if the value is indeed 1, then the configuration set that parameter correctly and the problem is at runtime.

    Can you also search for "xdc_runtime_Diags_dictElems" in that file? There should be a structure similar to this one:

    xdc_runtime_Diags_DictElem xdc_runtime_Diags_dictElems[] = {
        {32779, &xdc_runtime_Main_Module__root__V.mask},
        {0, 0}
    };

    The important part is that the address of xdc_runtime_Main is in that structure. Also, the fact that you can find xdc_runtime_Main_Module__root__V.mask among the symbols in the executables indicates that the mask can be changed at runtime, otherwise we would not generate it.

  • Sasha Slijepcevic said:
    Can you look in the directory Debug/configPkg/package/cfg

     

    I found a large ...p64P.c file in ...configuration\Default\configPkg\package\cfg. It was about 2 MB. The other .c files were less than 1KB.

    It had

    /* isLoaded__C */
    __FAR__ const CT__xdc_runtime_Text_isLoaded xdc_runtime_Text_isLoaded__C = 0;

    Sasha Slijepcevic said:
    an you also search for "xdc_runtime_Diags_dictElems" in that file?

    I could not find any "dictElems" in my file.

    I checked to make sure I had this in my .cfg.

    var Text = xdc.useModule('xdc.runtime.Text');
    Text.isLoaded = true;

    Strange eh!

    Thanks for your help!

    Cheers

  • I can't find any code in SYS/BIOS that would revert you 'isLoaded' setting. Can you add the following two lines at the very end of your CFG script:
    print("isLoaded: " + Text.isLoaded);
    Text.$seal("isLoaded");

    The first instruction should confirm that 'isLoaded' is true at the end of your script, and the second instruction disables further changes and it will generate an error if some other code tries to change it. You should also set XDC_TRACE_ENABLE environment variable to "all" in the project properties, and then post the console output to this thread.

    If 'isLoaded' is printed as 'false' at the end of your script, then the problem is in your script and you should be able by moving that print instruction up and down to figure out where in your script 'isLoaded' is turned to 'false'.

  • Hi Sasha

    Sasha Slijepcevic said:
    You should also set XDC_TRACE_ENABLE environment variable to "all" in the project properties

    The variable XDC_TRACE_ENABLE is not one of my configuration variables. (the only "X" I have is XDCROOT). I take it you mean I should add this this as a variable. (via Project -> Properties -> Environment (tab) -> Project (tab) -> New)

    Sasha Slijepcevic said:
    Can you add the following two lines at the very end of your CFG script:
    print("isLoaded: " + Text.isLoaded);
    Text.$seal("isLoaded");

    I added the above code to my .cfg and do not see anything output on the console CIO window nor do I see anything in the print log window. Attached is the build log and the .cfg (I cleaned it up a bit from the previous one).

    0005.XDC_TRACE_ENABLE.txt

    0755.M2_EVM6472.cfg.txt

    Thanks a bunch for your help!

    Cheers

  • Right above the added print statement, you are setting Text.isLoaded to 'false'. Can you comment out that statement and try again? Check again p64P.c file in Debug/configPkg/package/cfg and search for "isLoaded". You should see:
    __FAR__ const CT__xdc_runtime_Text_isLoaded xdc_runtime_Text_isLoaded__C = 1;

    The initial problem was that you were still seeing the output in printf logs. After you fix the script, are you still having the problem?

  • Hi Sasha

    I try turning off the logs shortly. But here is the console output after I set isLoaded to true.

    2555.XDC_TRACE_ENABLE_true.txt

    2055.M2_EVM6472_true.cfg.txt

    Cheers

  • Have you checked the generated C file? Is your original problem still present?

  • Hi

    It appears to be working (and is it very helpful!). My apologies for somehow setting isLoaded to false. I have no idea how that happened.

    What should I set XDC_TRACE_ENABLE to in order to turn off the console output. I'd like to keep it defined for future debug. Would "none" work?

    Cheers

  • "none" would work. There are many more ways to filter trace messages. Here is the guide: http://rtsc.eclipse.org/docs-tip/Trace_Support.