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.

DM816x: DVR_RDK: how to capture Vps_printf to a log instead of just stdout

Hello:

We would to direct our Vps_printf() messages from the DSP and other M3 processors to a log file on the A8/filesystem. 

Please provide ideas on how to accomplish this (syslog, logger)?

Is there already a mechanism for this?  Where/how does the Linux side handle these messages and send them to STDERR  / STDOUT?

Regards,


B

  • Since this is a common problem where logs need to be stored when UART is not connected, I am providing detailed explanation.

    Here is how Vps_printf works:

    When Vps_printf is invoked on slave cores like M3 and DSP it invokes a function called Vps_rprintf .

    Vps_rprintf will format the print and write is to a buffer in shared memory. Each slave core had a dedicated region of shared memory where the prints are wriiten.

    The slave core will increment the write index in shared memory .If there is not enough empty space in the shared memory log buffer to write the print, the log is dropped on the slave core (i.e. output is not written).

    On the HLOS side (a8) a user space application called remote_debug_client.out is executed. This periodically reads the contents of the shared memory log buffer. After reading the contents of the log buffer, the read index is incremented by remote_debug_client.out .The contents read from the shared memory log buffer is then printed on console using simple printf statements.

    TO redirect logs to a file, remote_debug_client can be executed to redirect stdio to file

    eg: remote_debug_client $(REMOTE_DEBUG_ADDRESS) & 1> /dev/sda1/dvr_rdk_log.txt.

    Note that this will cause the logs to keep growing .In production environment you would probably want a rotating circular log buffer to limit the log file size.This can be achieved by using something like multilog. (http://cr.yp.to/daemontools/multilog.html)

  • Hi Bachi,

    I tired changing ./bin/remote_debug_client.out ${REMOTE_DEBUG_ADDR} & in init.sh to

    ./bin/remote_debug_client.out ${REMOTE_DEBUG_ADDR} & 1> /tmp/dvr_rdk_log.txt

    the file is created but nothing is written into it, what am I doing wrongly?

    Thanks

  • There is already a script part of DVR RDK 4.0 to do this.Pls use that.(dvr_rdk\bin\ti816x\store_logs.sh)

    Execute as

    ./store_logs.sh <path_to_log_file> <max_log-file_size> &