NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Enabling trace in DSPLink
END OF LIFE
DSP Link is still available for download, but no further releases or updates are planned. Please see IPC Software Options for details and alternatives.
Contents
Overview[edit]
In certain kinds of failures seen in applications, sometimes the system just hangs without a kernel crash dump. Or some Operating Systems do not provide such crash dump. In this case, it is useful to enable trace within DSPLink to give information about the APIs and steps that have resulted in the crash/hang.
Enabling trace[edit]
Run the dsplinkcfg.pl static build configuration script to enable trace
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: DSP/BIOS(TM) LINK Configuration Tool :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Enable debug trace? 0. No 1. Yes :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: YOUR CHOICE : 1
You can also enable trace when running the dsplinkcfg.pl script from the command line by providing the --trace=1
option.
Disabling trace for user-level prints (from API module)[edit]
User-level print levels cannot be controlled, and hence all user-level prints are automatically enabled. Sometimes this gives too many prints, and it is difficult to identify the exact failures. Also, if user and kernel-level prints are sent to the same console, they most often do not come in order, and it is difficult to identify the exact control flow. In such situations, it may be desirable to disable the user-level prints.
To disable the user-level prints, take the following steps: File: ${DSPLINK}/gpp/src/osal/print.h
Existing code: <syntaxhighlight lang='c'>
- if defined (TRACE_USER)
/* ----------------------------------------------------------------------------
* Extern declaration for printf to avoid compiler warning. * ---------------------------------------------------------------------------- */
extern int printf (const char * format, ...) ;
- define PRINT_Printf printf
- endif
</syntaxhighlight>
Change to: <syntaxhighlight lang='c'>
- if defined (TRACE_USER)
/* ----------------------------------------------------------------------------
* Extern declaration for printf to avoid compiler warning. * ---------------------------------------------------------------------------- */
extern int printf (const char * format, ...) ;
- define PRINT_Printf(...)
- endif
</syntaxhighlight>
This disables all user-level prints, so that only special focused kernel level prints can be logged as desired.
Enabling kernel-level prints[edit]
To enable kernel level prints, following additional steps are needed:
File: ${DSPLINK}/gpp/src/pmgr/${GPPOS}/${GPPOSVERSION}/drv_pmgr.c
For example: ${DSPLINK}/gpp/src/pmgr/Linux/2.6/drv_pmgr.c
OR
${DSPLINK}/gpp/src/pmgr/PrOS/drv_pmgr.c
Function: DRV_InitializeModule()
(for Linux) OR
DRV_PMGR_Initialize()
(for PrOS)
Several component trace enables are available but commented out in this function. Enable trace prints for required components by uncommenting specific TRC_ENABLE calls.
Refer to file ${DSPLINK}/gpp/inc/_signature.h for component and sub-component ID definitions.
For example, to enable trace for selective LDRV subcomponents, uncomment some of the following lines as required:
<syntaxhighligh lang='c'>
/* TRC_ENABLE (ID_LDRV) ; */
/* TRC_ENABLE (ID_LDRV_PROC) ; */
/* TRC_ENABLE (ID_LDRV_CHNL) ; */
/* TRC_ENABLE (ID_LDRV_MSGQ) ; */
/* TRC_ENABLE (ID_LDRV_CHIRPS) ; */
/* TRC_ENABLE (ID_LDRV_MPCS) ; */
/* TRC_ENABLE (ID_LDRV_MPLIST) ; */
/* TRC_ENABLE (ID_LDRV_RINGIO) ; */
/* TRC_ENABLE (ID_LDRV_SMM) ; */
/* TRC_ENABLE (ID_LDRV_DATA_ZCPY) ; */
/* TRC_ENABLE (ID_LDRV_DRV) ; */
/* TRC_ENABLE (ID_LDRV_DRV_SHM) ; */
/* TRC_ENABLE (ID_LDRV_DSP) ; */
/* TRC_ENABLE (ID_LDRV_HAL_OBJECT) ; */
/* TRC_ENABLE (ID_LDRV_HAL_INTGEN) ; */
/* TRC_ENABLE (ID_LDRV_HAL_PCI) ; */
/* TRC_ENABLE (ID_LDRV_IPS) ; */
/* TRC_ENABLE (ID_LDRV_IPS_IPS) ; */
/* TRC_ENABLE (ID_LDRV_MQT) ; */
/* TRC_ENABLE (ID_LDRV_MQT_ZCPY) ; */
/* TRC_ENABLE (ID_LDRV_POOL) ; */
/* TRC_ENABLE (ID_LDRV_POOL_SMA) ; */
/* TRC_ENABLE (ID_LDRV_POOL_BUF) ; */
/* TRC_ENABLE (ID_LDRV_POOL_MPBUF) ; */
</syntaxhighlight>
- Set desired trace severity level. For example, if all prints are desired, set severity level as
TRC_ENTER
(default). If only error and specific prints are desired, for example severity could be set atTRC_LEVEL4
:
<syntaxhighligh lang='c'> TRC_SET_SEVERITY (TRC_ENTER) ; </syntaxhighlight>
- Now rebuild DSPLink
- Rebuild the application
- Run the application
- Log the prints
- Check the log and interpret it to see the cause and backtrace resulting in failure.