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.

are Log_write functions interruptible

Other Parts Discussed in Thread: SYSBIOS

Hello

(target C6678, sysbios 6.41.01.36, xdctools 3 30 05 60)

I'm using the Log_write functions to create trace used by System Analyser

It usually looks like this

Log_write1(UIABenchmark_start, "my_trace");

// code

Log_write1(UIABenchmark_stop, "my_trace");

I'm wondering what happens in a multitask context
if a TASK A starts calling "log_write", gets interrupt in the middle of it, a task B starts running and also calls log_write

Would it be an issue ?

In other words, is Log_write interruptible or do I need to protect it ?

Regards,
Clement

  • Hi Clement,

    Loggers protect themselves by globally disabling interrupts during their execution, through a Hwi_disable() call. As such, you do not need to add extra protection around the Log_writes within your code.

    Best,
    Alexander
  • Hi Alexander

    Thank you, that's all I wanted to know

    Can you point me where is in SYSBIOS or XDCTOOLS source code ?

    Log_write functions are difficult to track down !

    Clement

  • Sure thing Clement,

    In your XDCTools installation that came with TIRTOS, you may navigate to the packages/xdc/runtime directory. There you will find source code for the various loggers.

    Ex)  C:\ti\xdctools_3_31_01_33_core\packages\xdc\runtime


    In reference to interrupts being disabled, as an example, within the LoggerBuf.c source you'll find references such as:

     key = Gate_enterModule();
     Gate_leaveModule(key);

    protecting the critical sections of code.

    Edit: Note that when you call, say Log_write, it will link back call the specific logger such as LoggerBuf as it is simply an alias.

    Best,

    Alexander