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.

Questions regarding advanced logging with LoggerSM ?

Other Parts Discussed in Thread: SYSBIOS

Hello everyone,

Main subjects:
LoggerSM, LoggerStreamer, System Analyser, Loggers, Log_write, System_printf, ...

The target is:
EVM C6678 with SYSBIOS 6.35, UIA 1.03.01 XDCtools 3.25 and CCS5.5. Jtag access XDS560v2

I'm familiar with System_printf to display statements on CCS console.
I'm familiar with Log_write, Log_print to log data and SYSBIOS events.
I'm very familiar with the System Analyser (multicore synchronisation with Log Sync) in JTAGRUNMODE.
I'm quite familiar with the loggers configuration (LoggerCircBuf for sysbios and main loggers, LoggerBuf for the overflow logger)
I'm familiar with the LoggerSM and LoggerStreamer documentation (cdoc uia) and have seen the evmti816x exemple.

All is fine for a single C6678 target with a regular CCS System Analyser multicore session.

Next step is:
One DSP C6678 with one core on Linux, one core on SYSBIOS.

Aim:

The sysbios application writes Log events in circular buffers in shared memory (MSMC or DDR3). Overflow must be configurable at runtime.

The linux application is able to read and decode the data  to display the user printf  on our custom Human-Machine Interface window.

In case of DSP application crash, we want to feed System Analyser with the last logs (in a binary file) to have the execution graph leading to the crash.

Limitations:
- Live view of the logs is not necessary (the display on the Linux side can be delayed)
- User printf logs must NOT be lost
- No transmition via UDP/ethernet/whatever. Only options : Shared Memory (prefered) or SRIO.
- No DSS scripting hack.
- L1P/D cache enabled, L2 as SRAM
- for the printf, variable arguments would be great.

Questions:

To achieve the above : what is best LoggerSM ? LoggerStreamer ?
Can they do it ? What are the limitations ?
What should we use for the user printf : system_printf with a custom interface ISystemSupport ?
or directly Log_write ? (with which Log_Event ?) or directly LoggerSM_write/LoggerStreamer2_write ?

Thank you
Clement

  • Hi Clement,

    I would recommend using LoggerSM.  Your Log_printn() or Log_writen() on the BIOS app will be formatted into a shared buffer that can be read by a utility (loggerSMDump) on the Linux side.  You will find the loggerSMDump.c file in <UIA_INSTALL_DIR>/packages/ti/uia/examples/evmti816x.  You will need to build this for the C6678 Linux target, so I would copy it somewhere else and write a makefile to build it.  That will be easier, I think, than trying to modify the package.bld in the examples/evmti816x directory.

    You will also need to build the loggersm.a library for C6678.  You will find the source for this library (LoggerSM.c,h) in

        <UIA_INSTALL_DIR>/packages/ti/uia/linux

    There is also a makefile which you can start with (you don't need ServiceMgr or SYSLink, so you can remove those from your makefile).  You could also just compile ti/uia/linux/LoggerSM.c into your loggerSMDump executable instead of building a library.  (Note that this LoggerSM.c file is not the LoggerSM.c used for the logging! That one is in ti/uia/runtime.)

    There is information in the System Analyzer User's Guide on how to configure LoggerSM into your app and the constraints for using it.

    Best regards,

        Janet

  • Hi Janet,

    Thank you for your input, it is very helpful.

    I re-read the System Analyser UG and it was a good thing : I had forgotten it was talking about the LoggerSM subject.

    Additionnal questions :

    - It is not clear which LoggingSetup.eventUploadMode  should be used with LoggerSM. Non-jtag transport ?

    - I suppose it is compatible with multicore event correlation using LogSync, am I right ?

    - We are writing a wrapper around the user log calls. Let's call the function UserPrintf().
       It is my understanding that there is no way to have variable arguments in UserPrintf if we use Log_write/Log_print behind the scenes ? The user will have a maximum of 8 arguments right ?

    Regards,

    Clement

  • Hi Clement,

    You do not need to use LoggingSetup, since LoggerSM will not work for uploading events directly to System Analyzer. The data can be saved to a file for later processing by System Analyzer (according the the User's Guide, although I have never actually tried this).

    You should be able to use LogSync, but you will need to configure its logger to LoggerSM, for example, here is a configuration I did for the TI814X DSP:

        var LoggerSM = xdc.useModule('ti.uia.runtime.LoggerSM');
        LoggerSM.partitionId = MultiProc.id;
        LoggerSM.bufSection = ".loggerSM";
        LoggerSM.sharedMemorySize = 0x30000;
        LoggerSM.numPartitions = 3;

        var loggerSM = LoggerSM.create();
        Defaults.common$.logger = loggerSM;

        var LogSync = xdc.useModule('ti.uia.runtime.LogSync');
        LogSync.syncLogger = loggerSM;

    But you must also set the LogSync GlobalTimeStampProxy and frequencies, or LogSync will be disabled by UIA. For C66, you would set this to:

        LogSync.GlobalTimeStampProxy = xdc.useModule('ti.uia.family.c66.TimestampC66XGlobal');

    Although, it looks like the LogSync module will try to set the GlobalTimeStampProxy based on the device, if you have not set it.  So you may not need to set it for C66.

    There is a lot of good information on UIA and System Analyzer here:

    processors.wiki.ti.com/index.php/Multicore_System_Analyzer

    You can check out the System Analyzer tutorials.

    Tutorial 4:  http://processors.wiki.ti.com/index.php/SystemAnalyzerTutorial4 has examples of multi-core event correlation.

    For your Log_print wrapper, the user will have a maximum 6 arguments.  The maximum Log_print is Log_print6() Log_print6() calls the logger's write8 function with two arguments going to the module Id and the format string.

    Best regards,

        Janet

  • Clement,

    My first link to System Analyzer is not working.  Please try this one:

    http://processors.wiki.ti.com/index.php/Multicore_System_Analyzer

  • Janet,

    Thank you for the precisions.

    I won't do the implementation myself right now but you've given me plenty of elements to make it work when it'll be the right time.

    Regards,

    Clement