PASDK-71:Add SS status for ASIT/ASOT/AIP/AFP/SS peak load
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / systemStream.c
index 19b6656dc2f214a54efec46cf80e728f6a9552b6..6b71de640d1e75aada2ea8dcba21311a2118410d 100644 (file)
@@ -638,13 +638,19 @@ asm("_systemStream3Transmit .set 0");
 //#include <ti/bios/include/log.h>
 //#include <ti/sysbios/knl/Task.h>
 
-#if 0 // FL: debug
-UInt8 gCpuLoad;
+#if 1 // FL: debug
+UInt16 gCpuLoad;
+UInt8 gPeakCpuLoad;
 UInt8 gAsipLoad;
+UInt8 gPeakAsipLoad;
 UInt8 gAsopLoad;
+UInt8 gPeakAsopLoad;
 UInt8 gAipLoad;
+UInt8 gPeakAipLoad;
 UInt8 gAfpLoad;
+UInt8 gPeakAfpLoad;
 UInt8 gSsLoad;
+UInt8 gPeakSsLoad;
 //UInt32 gHwiLoad;
 //UInt32 gSwiLoad;
 #endif
@@ -663,34 +669,63 @@ systemStream5Compute(
     Load_getTaskLoad(Task_getIdleTask(), &stat);
     pStatus->cpuLoad = (100 - Load_calculateLoad(&stat)) * 256;
     if (pStatus->peakCpuLoad < pStatus->cpuLoad)
+    {
         pStatus->peakCpuLoad = pStatus->cpuLoad;
+    }
   
-    //gCpuLoad = (100 - Load_calculateLoad(&stat)
-
     // Compute ASIT load
     Load_getTaskLoad(TaskAsip, &stat);
-    //gAsipLoad = Load_calculateLoad(&stat);
     pStatus->asitLoad = Load_calculateLoad(&stat);
+    if (pStatus->peakAsitLoad < pStatus->asitLoad)
+    {
+        pStatus->peakAsitLoad = pStatus->asitLoad;
+    }
     
     // Compute ASOT load
     Load_getTaskLoad(TaskAsop, &stat);
-    //gAsopLoad = Load_calculateLoad(&stat);
     pStatus->asotLoad = Load_calculateLoad(&stat);
+    if (pStatus->peakAsotLoad < pStatus->asotLoad)
+    {
+        pStatus->peakAsotLoad = Load_calculateLoad(&stat);
+    }
 
     // Compute AIP Task load
     Load_getTaskLoad(TaskAip, &stat);
-    //gAipLoad = Load_calculateLoad(&stat);
     pStatus->aipLoad = Load_calculateLoad(&stat);
+    if (pStatus->peakAipLoad < pStatus->aipLoad)
+    {
+        pStatus->peakAipLoad = Load_calculateLoad(&stat);        
+    }
 
     // Compute AFP Task load
     Load_getTaskLoad(TaskAfp, &stat);
-    //gAfpLoad = Load_calculateLoad(&stat);
     pStatus->afpLoad = Load_calculateLoad(&stat);
+    if (pStatus->peakAfpLoad < pStatus->afpLoad)
+    {
+        pStatus->peakAfpLoad = Load_calculateLoad(&stat);        
+    }
     
     // Compute System Stream Task load
     Load_getTaskLoad(TaskSystemStream, &stat);
-    //gSsLoad = Load_calculateLoad(&stat);
     pStatus->ssLoad = Load_calculateLoad(&stat);
+    if (pStatus->peakSsLoad < pStatus->ssLoad)
+    {
+        pStatus->peakSsLoad = Load_calculateLoad(&stat);        
+    }
+
+    // FL: debug
+    gCpuLoad = pStatus->cpuLoad>>8;
+    gAsipLoad = pStatus->asitLoad;
+    gAsopLoad = pStatus->asotLoad;
+    gAipLoad = pStatus->aipLoad;
+    gAfpLoad = pStatus->afpLoad;
+    gSsLoad = pStatus->ssLoad;
+    gPeakCpuLoad = pStatus->peakCpuLoad>>8;
+    gPeakAsipLoad = pStatus->peakAsitLoad;
+    gPeakAsopLoad = pStatus->peakAsotLoad;
+    gPeakAipLoad = pStatus->peakAipLoad;
+    gPeakAfpLoad = pStatus->peakAfpLoad;
+    gPeakSsLoad = pStatus->peakSsLoad;
     
     return 0;
 }