dsp_ps_debug.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef DSP_PS_DEBUG_H
  2. #define DSP_PS_DEBUG_H
  3. #include "xrp_types.h"
  4. #include "xrp_kernel_dsp_interface.h"
  5. #ifdef DEBUG
  6. #define FILENAME(x) strrchr(x,'/')?strrchr(x,'/')+1:x
  7. #include <stdio.h>
  8. //#define ps_log(fmt, ...) printf("%s[%d]:"fmt,FILENAME(__FILE__),__LINE__,##__VA_ARGS__)
  9. #define ps_log(level,fmt, ...) printf("CSI_DSP_FW %s,(%s,%d):"fmt,level,__FUNCTION__,__LINE__,##__VA_ARGS__)
  10. #else
  11. #define ps_log
  12. #endif
  13. #define DSP_PS_ERR "ERROR"
  14. #define DSP_PS_WRN "WARNING"
  15. #define DSP_PS_INFO "INFO"
  16. #define DSP_PS_DEBUG "DEBUG"
  17. extern int dsp_log_level;
  18. #define ps_err(fmt, ...) \
  19. {\
  20. if(dsp_log_level>=FW_DEBUG_LOG_MODE_ERR) \
  21. ps_log(DSP_PS_ERR,fmt, ##__VA_ARGS__);\
  22. }
  23. #define ps_wrn(fmt, ...) \
  24. {\
  25. if(dsp_log_level>=FW_DEBUG_LOG_MODE_WRN) \
  26. ps_log(DSP_PS_WRN,fmt,##__VA_ARGS__);\
  27. }
  28. #define ps_info(fmt, ...) \
  29. {\
  30. if(dsp_log_level>=FW_DEBUG_LOG_MODE_INF) \
  31. ps_log(DSP_PS_INFO,fmt,##__VA_ARGS__);\
  32. }
  33. #define ps_debug(fmt, ...) \
  34. {\
  35. if(dsp_log_level>=FW_DEBUG_LOG_MODE_DBG) \
  36. ps_log(DSP_PS_DEBUG,fmt,##__VA_ARGS__);\
  37. }
  38. /*****************************************************************************************
  39. Other Definition.
  40. *****************************************************************************************/
  41. #define _FUNC_ENTRY_ ps_log(":E")
  42. #define _FUNC_EXIT_ ps_log(":X")
  43. #endif