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.

Optimized logging

Hi ,

I am developing a multicore logging support in my C6670 device . I cannot use standard UIA Log_writex() api's because the setup is such that NDK is only used for communicating between ARM and DSP.

Anyways, i could see my logging api takes around 5000 CPU cycles , where as for the same log using UIA's log_write() takes around 700 CPU cycles which is a huge improvement. In my application 80 % of cpu cyles is wasted in sprintf() only. I was wondering how Log_writex() api's format the logs. Can you please give us some pointers to log_write() implementation which i can refert to, so that i can incorporate the same formatting logic in my application.

Thanks in advance for your support.

Thanks.,

Ankit

  • Ankit,

    UIA allows you to get the data off the target into System Analyzer via several different transports. Out of the box, you can use stop-mode or run-mode (runmode is supported on 66xxx) devices. Both of these require JTAG. Newer versions support of CCS support UART also, but you'll need to write the transport on the target. Let me know if you want to go this route and I can give you pointers on how to accomplish this (it is overviewed in the UIA User Guide)

    Are you using LoggingSetup to set up your loggers? If you are you can set the uploadMode to either of the following

    LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE;

    or

    LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGSTOPMODE;

    For stop-mode, you have to halt the target to get the data. Note: depending on you version of CCS, their is a bug where when you first open System Analyzer and the target is stop-mode, you might not get the events. Just run and halt the target again and the events will be read.

    Todd

  • Thanks for your reply Todd.

    We are not using LoggingSetup for setting up our logger. We have developed our own multi core logging mechanism on C6670 device. UIA JTAG mode was discouraged since it require availability of costly JTAG with every engineer working on this device.

    We debugged this further and found that 80% of CPU cycles are being consumed in sprintf() api only which is used for generating formatted log in our Logging api. I think UIA Log_writex() api's does not use sprintf() internally for log formatting due to which it appears to be highly optimized. But there seems to be a limitation in these Log_writex() api's, i.e for printing using %s while displaying strings. User has to explicitly use LogSnapshot_writeString() for printing strings.Is it true or is there any way by which this can be avoided?

    This i feel is required because the memory contents of the string can change between the time the log is actually send to the host.

    We can also avoid using sprintf() api in our log api which will reduce CPU consumption by 80 % ,but this will required separate api for printing formatted logs.

    Thanks,

    Ankit