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.

AM5728: IPC log issue

Part Number: AM5728

Hi TI community,

I'm using the IPC module for QNX provided by TI's IPC package (1.0.10). It is possible to start a remote application on one of these slave cores (e.g. DSP1) and the IPC app will create and ipc-trace device for DSP1. No errors or problems up to this point. But If I look into this device (/dev/ipc-trace/DSP1) with the "cat" command, only the first few lines are visible whereas in ROV View - SysMin the entire log is visible.

It seems to me that the buffer / log device is limited or it will not be triggered anymore. If I comment out some messages - for example 3 messages - , the next 3 messages are visible.

Here is a snippet of my config file:

/* system logger */
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
var LoggerSysParams = new LoggerSys.Params();
var Defaults = xdc.useModule('xdc.runtime.Defaults');
Defaults.common$.logger = LoggerSys.create(LoggerSysParams);

/* enable runtime Diags_setMask() for non-XDC spec'd modules */
var Diags = xdc.useModule('xdc.runtime.Diags');
Diags.setMaskEnabled = true;

/* override diags mask for selected modules */
var Main = xdc.useModule('xdc.runtime.Main');
Diags.setMaskMeta("xdc.runtime.Main",
    Diags.ENTRY | Diags.EXIT | Diags.INFO, Diags.RUNTIME_ON);

var Registry = xdc.useModule('xdc.runtime.Registry');
Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
Registry.common$.diags_EXIT  = Diags.RUNTIME_OFF;
Registry.common$.diags_INFO  = Diags.RUNTIME_OFF;
Registry.common$.diags_USER1 = Diags.RUNTIME_OFF;
Registry.common$.diags_LIFECYCLE = Diags.RUNTIME_OFF;
Registry.common$.diags_STATUS = Diags.RUNTIME_OFF;

Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
/*
 *  ======== End Instrumentation Configuration ========
 */

 
/*  Use SysMin because trace buffer address is required for Linux/QNX
 *  trace debug driver, plus provides better performance.
 */
var System = xdc.useModule('xdc.runtime.System');
var SysMin = xdc.useModule('ti.trace.SysMin');
System.SupportProxy = SysMin;
SysMin.bufSize  = 0x8000;

Program.sectMap[".tracebuf"] = "TRACE_BUF";
Program.sectMap[".errorbuf"] = "EXC_DATA";

My log function is something like: Log_printX(Diags_INFO, msg, ...)

Can somebody explain this problem?

  • Does the IPC module provide the opportunity to save the entire log in a file (to store the log on file system although ipc command is shutdown)?
  • What about the -c argument of ipc command? In source code it seems that this option has not been implemented, yet.
  • Which purpose has the trace daemon command which has a "-l"-argument for storing the log in a file, too?

Thanks for your help & best regards

Thomas

  • Okay the bullet's questions are solved: I can call ipc_trace_daemon after ipc and can define a log filename (e.g. ipc DSP1 /mnt/sdcard/C66xx_MyApp.out; ipc_trace_daemon -l /tmp/ipc.log). The entire output of /dev/ipc-trace/<core> will be written to log file.

    But the main issue is still remaining. Can somebody help to solve this issue?

  • Hi Thomas,

    Your config file looks OK. Note that you can reference the example config file in IPC3.x code for DSP at

    <ipc_install_path>/packages/ti/ipc/tests/Dsp_vayu.cfg

    The ipc_trace_daemon will dump the contents of the trace buffer periodically in a process. Do you mean that only some traces are coming to the trace buffer? If you view the trace buffer memory location in CCS, are all traces there?

    Thanks,
    Angela
  • Hi Angela,

    thanks for your reply.

    Angela Stegmaier said:
     
    Do you mean that only some traces are coming to the trace buffer? If you view the trace buffer memory location in CCS, are all traces there?
     

    Yes. That's it. Only a few logs are visible in trace device (the last messages are missing). In ROV View - Sysmin in CCS, there are all traces listed.

    I could detail my problem. It is not any buffer overflow problems. If I add a second task which logs messages, too, I see more messages in the trace device (but not all, yet. The last messages are still missing). Maybe is this a scheduling or trigger problem? How will the trace device receive the messages?

    Best regards

    Thomas

  • Ah, I solved the problem (beginner's mistake). I looked for something like "flush buffer" and I found out, that I have to flush the virtual queue cache.

    Thanks for your hints, Angela.

    Best regards
    Thomas
  • Is it possible to receive only the new messages (changes). At the moment, by flushing the cache (with VirtQueue_cacheWb in idle) I receive the entire log (incl. new lines) everytime. The internal buffer of sysmin is not cleared after flushing...

    My trace in the device /dev/ipc-trace/DSP1 is complete and nothing is redundant. But if I create a textfile on file system with the help of ipc_trace_daemon the entire trace is stored everytime the trace buffer is dumped and looks like:

    Msg 1

    Msg 1

    Msg 2

    Msg 1

    Msg 2

    Msg 3

    Msg 1

    Msg 2

    Msg 3

    Msg 4

    ...

    Instead of:

    Msg 1

    Msg 2

    Msg 3

    Msg 4

    I don't know whether the command 'ipc_trace_daemon' is the correct one for my requirements (Creating a text file of my traces/logging on file system which shall exist even if slave core and ipc command is finished) because it seems that ipc_trace_daemon dumps every time the entire content of trace device.

    Do you have some ideas or hints?

  • Hi Thomas,

    My apologies for the delay in reply. Are you still facing issues with this?

    By design the cat of /dev/ipc-trace/DSP1 should print only new traces. The ipc_trace_daemon internally calls "cat /dev/ipc-trace/DSP1", so behavior should be the same. Are you seeing different behavior between the two? Are you launching ipc_trace_daemon with the "-l <logfile>" option to log to a logfile?

    Thanks,
    Angela
  • Hi Angela,

    thanks for your reply. I already solved this problem by using the logfiles, which will be created while IPC is running. I think, this is similar to the "-l option" of trace_daemon.

    I would like to thank you for your support, you helped me lot in understanding the IPC module.

    Best regards

    Thomas