Add debug counters
authorFrank Livingston <frank-livingston@ti.com>
Thu, 26 Jan 2017 22:58:16 +0000 (16:58 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Thu, 26 Jan 2017 22:58:16 +0000 (16:58 -0600)
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/mib/mib.c
pasdk/test_dsp/sap/sap.c

index ba47735055a0bfc5d0691ce8db9c10c0ed25feec..bef354372e8709f46fb24a7c581206e5fea00a94 100644 (file)
@@ -303,8 +303,14 @@ UInt32 gAsipInitCnt     =0;
 UInt32 gAsipInfo1Cnt    =0;
 UInt32 gAsipInfo2Cnt    =0;
 UInt32 gAsipDecodeCnt   =0;
+UInt32 gAsipDecodeErrCnt   =0;
 UInt32 gAsipFinalCnt    =0;
 UInt32 gAsipQuitCnt     =0;
+UInt32 gIbReset_cnt    =0;
+UInt32 gcapIb_cnt              =0;
+UInt32 gAsipInfo2_PrimaryErrCnt =0;
+UInt32 gAsipInfo2_ErrCnt               =0;
+
 #include "dbgDib.h"
 
 extern struct {
@@ -1920,6 +1926,10 @@ PAF_ASIT_autoProcessing(
     return errno;
 } //PAF_ASIT_autoProcessing
 
+UInt32 gProbe1Err=0;
+UInt32 gProbe2Err=0;
+UInt32 gMajorAuMissed=0;
+
 // -----------------------------------------------------------------------------
 // ASIT Processing Function - Decode Processing
 //
@@ -2153,6 +2163,7 @@ PAF_ASIT_decodeProcessing(
                 // Establish primary timing
                 if (errno = pP->fxns->decodeInfo(pP, pQ, pC, frame, block))
                 {
+                    gProbe1Err++;
                     TRACE_TERSE1("INFO1: errno 0x%x after decodeInfo, primary timing", errno);
                     break;
                 }
@@ -2206,12 +2217,14 @@ PAF_ASIT_decodeProcessing(
                             if (SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
                                 sizeof(pAstCfg->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
                             {
+                                gProbe2Err++;
                                 TRACE_TERSE0("PAF_ASIT_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
                                 return (ASPERR_ISSUE);
                             }
                         }
                     }
                     TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1: frame %d, not major access unit", frame);
+                    gMajorAuMissed++; // debug
                     frame++;
                     state = INFO1;
                     continue;
@@ -2250,6 +2263,7 @@ PAF_ASIT_decodeProcessing(
                 if (errno = pP->fxns->decodeInfo(pP, pQ, pC, frame, block))
                 {
                     TRACE_TERSE1("PAF_ASIT_decodeProcessing: INFO2 break on decodeInfo. errno 0x%x", errno);
+                    gAsipInfo2_PrimaryErrCnt++;
                     break;
                 }
 
@@ -2263,6 +2277,7 @@ PAF_ASIT_decodeProcessing(
                 if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
                 {
                     TRACE_TERSE1("PAF_ASIT_decodeProcessing. %d: INFO2 break on decodeInfo2. errno 0x%x", errno);
+                    gAsipInfo2_ErrCnt++;
                     break;
                 }
 
@@ -2283,6 +2298,7 @@ PAF_ASIT_decodeProcessing(
             
                 if (errno = pP->fxns->decodeDecode(pP, pQ, pC, sourceSelect, frame, block))
                 {
+                       gAsipDecodeErrCnt++;
                     TRACE_TERSE1("PAF_ASIT_decodeProcessing: state: DECODE.  decodeDecode err 0x%04x", errno);
                     break;
                 }
index c36e2e6b91ff947b3d39a456e6bd028422f3c1c7..ebb5d688d303c2479918abbc0000888f0d8a3fb0 100644 (file)
@@ -408,7 +408,8 @@ Int DIB_issue (DEV2_Handle device)
 // Although interface allows for arbitrary BufConfigs we only support 1 -- so
 // we can assume the one on the fromdevice is the one we want
 
-extern int gIsrCnt; // GJ Debug
+extern int gIsrInputCnt; // GJ Debug
+extern int gIsrOutputCnt; // GJ Debug
 
 Int DIB_reclaim (DEV2_Handle device)
 {
@@ -640,7 +641,7 @@ Int DIB_reclaim (DEV2_Handle device)
         // since, at least for THD, it is needed by decoders.
         *pBufConfig = pDevExt->bufConfig;
         pBufConfig->lengthofData -= pDevExt->headerSize;
-        Log_info3("DIB_reclaim.%d lengthofData = %d; ISRCNT=%d", __LINE__, pBufConfig->lengthofData, gIsrCnt); // GJ Debug
+        Log_info4("DIB_reclaim.%d lengthofData = %d; InISRCNT=%d; OutISRCNT=%d", __LINE__, pBufConfig->lengthofData, gIsrInputCnt, gIsrInputCnt); // GJ Debug
         //TRACE((&TR_MOD, "DIB_reclaim.%d lengthofData = %d\n", __LINE__, pBufConfig->lengthofData));
 
         // HACK: for DSD the frameLength needs to be the number of samples to generate.
@@ -691,7 +692,7 @@ Int DIB_reclaim (DEV2_Handle device)
 
     // .........................................................................
 
-    Log_info3("DIB_reclaim.%d exit status = %d, ISRCNT = %d", __LINE__, status, gIsrCnt); // GJ Debug
+    Log_info4("DIB_reclaim.%d exit status = %d, InISRCNT = %d OutISRCNT = %d", __LINE__, status, gIsrInputCnt, gIsrOutputCnt); // GJ Debug
     //TRACE((&TR_MOD, "DIB_reclaim.%d exit status = %d\n", __LINE__, status));
 
     return status;
@@ -1079,6 +1080,7 @@ Int DIB_getSync (DEV2_Handle device, PAF_InpBufConfig *pBufConfig )
 
 // -----------------------------------------------------------------------------
 
+int gWrapCtr=0;
 Int DIB_issueChild (DEV2_Handle device, PAF_InpBufConfig  *pBufConfig, int size, int forTotal)
 {
     DIB_DeviceExtension   *pDevExt = (DIB_DeviceExtension *) device->object;
@@ -1151,6 +1153,13 @@ Int DIB_issueChild (DEV2_Handle device, PAF_InpBufConfig  *pBufConfig, int size,
                 return DIBERR_UNSPECIFIED;
 
             pBufConfig->futureHead.pVoid = endAddr[i];
+            // GJ Debug
+            if (i==1)
+            {
+               gWrapCtr++;
+               Log_info4("DIB: Inside DIB_issueChild Wrap Around Point #%d, with Future Head: 0x%x, current addr: 0x%x, current size: %d", gWrapCtr, pBufConfig->futureHead.pVoid, dstFrame->addr, dstFrame->size ); // GJ Debug
+
+            }
         }
     }
 
index 0b68afa1a342ca1af495e46f5973ea356be0f93d..6797dcc6273e67061ba4fce6226608af439dbe08 100644 (file)
@@ -85,12 +85,16 @@ extern EDMA3_DRV_Handle hEdma0;
 extern EDMA3_DRV_Handle hEdma1;
 
 int gStartError;
-int gIsrCnt;
+int gIsrInputCnt;
+int gIsrOutputCnt;
 int gIsrElseCnt;
-int gIsrErrCnt;
+int gIsrInErrCnt;
+int gIsrOutErrCnt;
 int gIsrRunCnt;
 int gIsrNotRunCnt;
 int gisrOutput;
+int gSAPResetIn;
+int gSAPResetOut;
 
 typedef xdc_Short MdInt;
 
@@ -473,6 +477,9 @@ Int SAP_ctrl (DEV2_Handle device, Uns code, Arg arg)
     return result;
 } // SAP_ctrl
 
+int gSAPIdleShutdownIn=0;
+int gSAPIdleShutdownOut=0;
+
 // -----------------------------------------------------------------------------
 
 Int SAP_idle (DEV2_Handle device, Bool flush)
@@ -492,6 +499,10 @@ Int SAP_idle (DEV2_Handle device, Bool flush)
 
     // reset serial port -- stop generating sync events
     result = SAP_PORT_FTABLE_reset (device);
+    if(device->mode == DEV2_OUTPUT)
+       gSAPResetOut++;
+    else
+       gSAPResetIn++;
     if (result)
     {
         //TRACE_VERBOSE((&TR_MOD, "%s.%d: SAP_PORT_FTABLE_reset returned %d.\n", __FUNCTION__, __LINE__, result));
@@ -500,6 +511,11 @@ Int SAP_idle (DEV2_Handle device, Bool flush)
 
     pDevExt->shutDown = 0; // force shutdown to run
     result = SAP_FTABLE_shutdown (device);
+    if(device->mode == DEV2_OUTPUT)
+       gSAPIdleShutdownOut++;
+    else
+       gSAPIdleShutdownIn++;
+
     if (result)
     {
         //TRACE_VERBOSE((&TR_MOD, "%s.%d: SAP_FTABLE_shutdown returned %d.\n", __FUNCTION__, __LINE__, result));
@@ -1254,7 +1270,7 @@ void SAP_isrCallback (Uint32 tcc, EDMA3_RM_TccStatus status, Ptr context)
 
             // decrement count
             pDevExt->numQueued -= 1;
-            gIsrCnt++;
+            //gIsrCnt++;
             if (device->mode == 1)
                gisrOutput++;
 
@@ -1280,7 +1296,10 @@ void SAP_isrCallback (Uint32 tcc, EDMA3_RM_TccStatus status, Ptr context)
 
         if (!(opt & EDMA3_DRV_OPT_TCINTEN_SET_MASK (1)))
         {
-               gIsrErrCnt++;
+               if (device->mode == 1)
+                       gIsrOutErrCnt++;
+               else
+                       gIsrInErrCnt++;
                pDevExt->errorState = PAF_SIO_ERROR_ERRBUF_XFER;
         }