PASDK-254:Provide compile-time switch to allow heap usage to be displayed after each...
authorFrank Livingston <frank-livingston@ti.com>
Wed, 10 May 2017 20:28:37 +0000 (15:28 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Wed, 10 May 2017 20:28:37 +0000 (15:28 -0500)
18 files changed:
pasdk/common/audioStreamProc_common.h
pasdk/common/paf_alg_print.c
pasdk/common/paf_heapMgr.h
pasdk/common/pfp_app.h
pasdk/paf
pasdk/test_arm/application/main.c
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_arm/framework/audioStreamDecodeProc.h
pasdk/test_arm/framework/itopo/params.c
pasdk/test_dsp/framework/alphaFuncProc.c
pasdk/test_dsp/framework/alphaIntervalProc.c
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/framework/audioStreamInpProc.h
pasdk/test_dsp/framework/audioStreamOutProc.c
pasdk/test_dsp/framework/audioStreamOutProc.h
pasdk/test_dsp/framework/itopo/params.c
pasdk/test_dsp/framework/systemInit.c
pasdk/test_dsp/framework/systemStream.c

index 54682ba5f8c6268c0080a18c5742f0017787b423..7ed6e4cc3d32b7d0718af18089da1af29a79699f 100644 (file)
@@ -153,32 +153,33 @@ All rights reserved.
 //
 // Heap & Memory Allocation Definitions
 //
-#define HEAP_ID_INTERNAL                  *pP->heap.pHeapIdIntern     //*pP->heap.pIntern
-#define HEAP_ID_INTERNAL1                 *pP->heap.pHeapIdIntern1    //*pP->heap.pIntern1
-#define HEAP_ID_EXTERNAL                  *pP->heap.pHeapIdExtern     //*pP->heap.pExtern
-#define HEAP_ID_INTERNAL1_SHM             gPafHeapIdInt1Shm
-#define HEAP_ID_EXTERNAL_SHM              gPafHeapIdExtShm
-#define HEAP_ID_EXTERNAL_NONCACHED_SHM    gPafHeapIdExtNonCachedShm
-
-#define HEAP_INTERNAL                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL)
-#define HEAP_INTERNAL1                    (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1)
-#define HEAP_EXTERNAL                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL)
-#define HEAP_INTERNAL1_SHM                (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1_SHM)
-#define HEAP_EXTERNAL_SHM                 (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_SHM)
-#define HEAP_EXTERNAL_NONCACHED_SHM       (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_NONCACHED_SHM)
-#define HEAP_CLEAR                         pP->heap.clear
-
-#define HEAP_ID_INPBUF      *pP->heap.pHeapIdInpbuf     //*pP->heap.pInpbuf
-#define HEAP_ID_OUTBUF      *pP->heap.pHeapIdOutbuf     //*pP->heap.pOutbuf
-#define HEAP_ID_FRMBUF      *pP->heap.pHeapIdFrmbuf     //*pP->heap.pFrmbuf
-#define HEAP_INPBUF         (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INPBUF)
-#define HEAP_OUTBUF         (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_OUTBUF)
-#define HEAP_FRMBUF         (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_FRMBUF)
-
-#define HEAP_ID_MDBUF       *pP->pMetadataBufStatus->pHeadIdSpace
-#define HEAP_MDBUF          (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_MDBUF)
-
-#define COMMONSPACE         pP->common.space
+#define HEAP_ID_INTERNAL                *pP->heap.pHeapIdIntern
+#define HEAP_ID_INTERNAL1               *pP->heap.pHeapIdIntern1
+#define HEAP_ID_EXTERNAL                *pP->heap.pHeapIdExtern
+#define HEAP_ID_INTERNAL1_SHM           *pP->heap.pHeapIdInt1Shm
+#define HEAP_ID_EXTERNAL_SHM            *pP->heap.pHeapIdExtShm
+#define HEAP_ID_EXTERNAL_NONCACHED_SHM  *pP->heap.pHeapIdExtNonCachedShm
+
+#define HEAP_INTERNAL                   (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL)
+#define HEAP_INTERNAL1                  (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1)
+#define HEAP_EXTERNAL                   (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL)
+#define HEAP_INTERNAL1_SHM              (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1_SHM)
+#define HEAP_EXTERNAL_SHM               (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_SHM)
+#define HEAP_EXTERNAL_NONCACHED_SHM     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL_NONCACHED_SHM)
+#define HEAP_CLEAR                      pP->heap.clear
+
+#define HEAP_ID_INPBUF                  *pP->heap.pHeapIdInpbuf
+#define HEAP_ID_OUTBUF                  *pP->heap.pHeapIdOutbuf
+#define HEAP_ID_FRMBUF                  *pP->heap.pHeapIdFrmbuf
+#define HEAP_INPBUF                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INPBUF)
+#define HEAP_OUTBUF                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_OUTBUF)
+#define HEAP_FRMBUF                     (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_FRMBUF)
+
+#define HEAP_ID_MDBUF                   *pP->pMetadataBufStatus->pHeadIdSpace
+#define HEAP_MDBUF                      (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_MDBUF)
+
+
+#define COMMONSPACE                     pP->common.space
 
 // .............................................................................
 
index e93ab087142cdcda5b29a2f87911da86a5a15287..3dbfb2772a0b784ca511f9de95be75427c84c22f 100644 (file)
@@ -157,6 +157,7 @@ PAF_ALG_commonPrint(IALG_MemRec common[], PAF_IALG_Config *p)
 
 Void
 PAF_ALG_memStatusPrint(
+    CString header, 
     HeapMem_Handle hInternalHeap, 
     HeapMem_Handle hInternal1Heap,
     HeapMem_Handle hExternalHeap, 
@@ -167,37 +168,38 @@ PAF_ALG_memStatusPrint(
 {
     Memory_Stats stats;
 
-    System_printf("\n\nHeap\tSize\tUsed\tAvailable");
+    System_printf("\n\n%s\n", header);
+    System_printf("%-12s%-12s%-12s%-12s", "Heap", "Size", "Used", "Available");
     
     if (hInternalHeap != NULL)
     {
         Memory_getStats((IHeap_Handle)hInternalHeap, &stats);
-        System_printf("\nINT\t%d\t%d\t%d", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
+        System_printf("\n%-12s0x%08x  0x%08x  0x%08x", "INT", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
     }
     if (hInternal1Heap != NULL)
     {
         Memory_getStats((IHeap_Handle)hInternal1Heap, &stats);
-        System_printf("\nINT1\t%d\t%d\t%d", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);    
+        System_printf("\n%-12s0x%08x  0x%08x  0x%08x", "INT1", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);    
     }
     if (hExternalHeap != NULL)
     {
         Memory_getStats((IHeap_Handle)hExternalHeap, &stats);
-        System_printf("\nEXT\t%d\t%d\t%d", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
+        System_printf("\n%-12s0x%08x  0x%08x  0x%08x", "EXT", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
     }
     if (hInternal1HeapShm != NULL)
     {
         Memory_getStats((IHeap_Handle)hInternal1HeapShm, &stats);
-        System_printf("\nINT1 SHM\t%d\t%d\t%d", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
+        System_printf("\n%-12s0x%08x  0x%08x  0x%08x", "INT1 SHM", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
     }
     if (hExternalHeapShm != NULL)
     {
         Memory_getStats((IHeap_Handle)hExternalHeapShm, &stats);
-        System_printf("\nEXT SHM\t%d\t%d\t%d", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
+        System_printf("\n%-12s0x%08x  0x%08x  0x%08x", "EXT SHM", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
     }
     if (hExternalNonCachedShm != NULL)
     {
         Memory_getStats((IHeap_Handle)hExternalNonCachedShm, &stats);
-        System_printf("\nEXT NC SHM\t%d\t%d\t%d\n", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
+        System_printf("\n%-12s0x%08x  0x%08x  0x%08x", "EXT NC SHM", stats.totalSize, stats.totalSize-stats.totalFreeSize, stats.largestFreeSize);
     }
     
     System_flush();
index 46c7890bcd2b4b50eccb729d224b81ec766fa15c..f1a3a59fb290f0751fb900e1314e860b7167657e 100644 (file)
@@ -39,22 +39,33 @@ All rights reserved.
 #include <xdc/std.h>
 #include <xdc/runtime/IHeap.h>
 
-#define PAF_NUM_PRVMEM_HEAPS            ( 3 )
-#define PAF_NUM_SHMEM_HEAPS             ( 3 )
-#define PAF_NUM_HEAPS                   ( PAF_NUM_PRVMEM_HEAPS + PAF_NUM_SHMEM_HEAPS )
-#define PAF_HEAP_ID_INT                 ( 0 )   // L2 SRAM
-#define PAF_HEAP_ID_INT1                ( 1 )   // MSMC SRAM
-#define PAF_HEAP_ID_EXT                 ( 2 )   // DDR3
-#define PAF_HEAP_ID_INT1_SHM            ( 3 )   // MSMC SRAM, Shared
-#define PAF_HEAP_ID_EXT_SHM             ( 4 )   // DDR3, Shared
-#define PAF_HEAP_ID_EXT_NON_CACHED_SHM  ( 5 )   // DDR3 non-cached, Shared
+#define PAF_NUM_PRVMEM_HEAPS                ( 3 )   // number of private (local) heaps
+#define PAF_NUM_SHMEM_HEAPS                 ( 3 )   // number of shared heaps
+#define PAF_NUM_HEAPS                       ( PAF_NUM_PRVMEM_HEAPS + PAF_NUM_SHMEM_HEAPS ) // total number of heaps
 
-extern Int gPafHeapIdInt;                       // L2 SRAM
-extern Int gPafHeapIdInt1;                      // MSMC SRAM
-extern Int gPafHeapIdExt;                       // DDR3
-extern Int gPafHeapIdInt1Shm;                   // MSMC SRAM, Shared
-extern Int gPafHeapIdExtShm;                    // DDR3, Shared
-extern Int gPafHeapIdExtNonCachedShm;           // DDR3 non-cached, Shared
+// heap IDs
+#define PAF_HEAP_ID_INT                     ( 0 )   // L2 SRAM
+#define PAF_HEAP_ID_INT1                    ( 1 )   // MSMC SRAM
+#define PAF_HEAP_ID_EXT                     ( 2 )   // DDR3
+#define PAF_HEAP_ID_INT1_SHM                ( 3 )   // MSMC SRAM, Shared
+#define PAF_HEAP_ID_EXT_SHM                 ( 4 )   // DDR3, Shared
+#define PAF_HEAP_ID_EXT_NON_CACHED_SHM      ( 5 )   // DDR3 non-cached, Shared
+
+// macros for translating heap IDs to handles
+#define PAF_HEAP_INT                        (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt)
+#define PAF_HEAP_INT1                       (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1)
+#define PAF_HEAP_EXT                        (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExt)
+#define PAF_HEAP_INT1_SHM                   (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1Shm)
+#define PAF_HEAP_EXT_SHM                    (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtShm)
+#define PAF_HEAP_EXT_NONCACHED_SHM          (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtNonCachedShm)
+
+// exported heap IDs
+extern Int gPafHeapIdInt;               // L2 SRAM
+extern Int gPafHeapIdInt1;              // MSMC SRAM
+extern Int gPafHeapIdExt;               // DDR3
+extern Int gPafHeapIdInt1Shm;           // MSMC SRAM, Shared
+extern Int gPafHeapIdExtShm;            // DDR3, Shared
+extern Int gPafHeapIdExtNonCachedShm;   // DDR3 non-cached, Shared
 
 /* Initialize PAF heap manager */
 Void pafHeapMgr_init(
index 0199b6bc7cef7e26bdd0306cf19a1b99ceaada31..746af6e4efd5af1a82c06bef0a0dd0fc7d18e6d2 100644 (file)
 #define PFP_ENABLE_MASK ( 0 )
 
 // enable all PFP's
-//#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASIT_0) | \
-//                          (1<<PFP_ID_ASIT_1) | \
-//                          (1<<PFP_ID_ASIT_2) | \
-//                          (1<<PFP_ID_ASOT_0) | \
-//                          (1<<PFP_ID_ASOT_1) | \
-//                          (1<<PFP_ID_ASOT_ASP_0) | \
-//                          (1<<PFP_ID_ASOT_ASP_1) | \
-//                          (1<<PFP_ID_ASOT_ASP_2) | \
-//                          (1<<PFP_ID_ASOT_ASP_3) )
+/*
+#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASIT_0) | \
+                          (1<<PFP_ID_ASIT_1) | \
+                          (1<<PFP_ID_ASIT_2) | \
+                          (1<<PFP_ID_ASOT_0) | \
+                          (1<<PFP_ID_ASOT_1) | \
+                          (1<<PFP_ID_ASOT_ASP_0) | \
+                          (1<<PFP_ID_ASOT_ASP_1) | \
+                          (1<<PFP_ID_ASOT_ASP_2) | \
+                          (1<<PFP_ID_ASOT_ASP_3) )
+*/
 
 #else /* _TMS320C6X */
 
 #define PFP_ENABLE_MASK ( 0 )
 
 // enable INFO and DECODE PFP's
-//#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASDT_0) | \
-//                          (1<<PFP_ID_ASDT_1) | \
-//                          (1<<PFP_ID_ASDT_2) )
-
+/*
+#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASDT_0) | \
+                          (1<<PFP_ID_ASDT_1) | \
+                          (1<<PFP_ID_ASDT_2) )
+*/
 
 #endif /* _TMS320C6X */
 
index 7f1efc12ac68ebc544917ee83f62deac7943dd73..06e1f3bc75c768efe6cedc8cd3bf9bc2736ef1ed 160000 (submodule)
--- a/pasdk/paf
+++ b/pasdk/paf
@@ -1 +1 @@
-Subproject commit 7f1efc12ac68ebc544917ee83f62deac7943dd73
+Subproject commit 06e1f3bc75c768efe6cedc8cd3bf9bc2736ef1ed
index 588cfe64e288a4aa61b0b32ccdf9a37acb685fb3..3a1ebe9c84e3754872daa41b68b1d938132791dc 100644 (file)
@@ -58,7 +58,7 @@ Int main()
 { 
     Int status;
     Int k;
-    UInt32 tsStart, tsEnd, delta;
+    //UInt32 tsStart, tsEnd, delta; // debug: check ARM SYS/BIOS timestamp provider
     
     Log_info0("Enter main()");
 
index 28bad17a306654f91ab4cd9a97a8eaf6cfb3a3c6..90d281948dc651995b6314a09709d9e04d94a571 100644 (file)
@@ -273,7 +273,8 @@ Void taskAsdpFxn(
     //
     if (pP->fxns->memStatusPrint)
     {
-        pP->fxns->memStatusPrint(HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
+        pP->fxns->memStatusPrint("ASDT MEMSTAT REPORT",
+            HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
             HEAP_INTERNAL1_SHM, HEAP_EXTERNAL_SHM, HEAP_EXTERNAL_NONCACHED_SHM);
     }
     
index bd3daa4761310a5d686083f2dc5bdd68f46097e3..6bdde86e81bb4e5b8da195bc9c7e5e1e914a1e00 100644 (file)
@@ -63,7 +63,9 @@ typedef struct PAF_ASDT_Fxns {
     Int  (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
     Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
     Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
-    Void (*memStatusPrint)(HeapMem_Handle hInternalHeap, 
+    Void (*memStatusPrint)(
+        CString header, 
+        HeapMem_Handle hInternalHeap, 
         HeapMem_Handle hInternal1Heap, 
         HeapMem_Handle hExternalHeap, 
         HeapMem_Handle hInternal1HeapShm,
@@ -87,6 +89,9 @@ typedef struct PAF_ASDT_Params {
         int *pHeapIdExtern;   //int *pExtern;
         int *pHeapIdFrmbuf;   //int *pFrmbuf;
         int *pHeapIdIntern1;  //int *pIntern1;
+        int *pHeapIdInt1Shm;
+        int *pHeapIdExtShm;
+        int *pHeapIdExtNonCachedShm;
         int clear; 
     } heap;
     struct {
index c16a5b760a786b57312944bb669b754f7e1e6ace..ab71a91406007cb6ad7d094a828f6e974c8126a2 100644 (file)
@@ -434,6 +434,9 @@ const PAF_ASDT_Params asdp_params_PAi =
         //&gPafHeapIdInt1,    //&IRAM,                        // heap.pFrmbuf
         &gPafHeapIdExt,     //&SDRAM,                        // heap.pFrmbuf //Qin - moved to external memory
         &gPafHeapIdInt1,    //&L3RAM,                       // heap.pIntern1
+        &gPafHeapIdInt1Shm,                                 // heap.pHeapIdInt1Shm
+        &gPafHeapIdExtShm,                                  // heap.pHeapIdExtShm
+        &gPafHeapIdExtNonCachedShm,                         // heap.pHeapIdExtNonCachedShm
         1,                                                  // heap.clear
     },
     {                                                       // common
index e32bb9e4e58db85a24e22098b0670609c5bb3fbf..2d176640fdff0a49c05dae0836bf119e11e207ba 100644 (file)
@@ -49,6 +49,12 @@ All rights reserved.
 #include "paf_heapMgr.h"
 #include "alphaFuncProc.h"
 
+//#define MEMSTAT_REPORT
+#ifdef MEMSTAT_REPORT
+#include "paf_alg_print.h"
+#endif /* MEMSTAT_REPORT */
+
+
 #define ENABLE_AE_TRACE
 #ifdef ENABLE_AE_TRACE
     //#define AE_TRACE0(a) LOG_printf a
@@ -84,6 +90,7 @@ Void *AFP_memAlloc(
     return (void *)Memory_alloc((IHeap_Handle)hHeap, size, align, NULL);
 }
 
+extern UInt32 gPafHeapMgrInit;
 
 Void AFP_process(
     AFP_Handle handle
@@ -101,7 +108,6 @@ Void AFP_process(
         txOffset = 0;
         encap = 0;
 
-        
         /* Read the payload */
         if (handle->dcs7->fxns->read(handle->dcs7, 
             handle->rxBuf+rxIdx,
@@ -355,6 +361,13 @@ Void taskAfpFxn(AFP_Handle handle)
                 //handle->fxns->log(handle,handle->logObj,"AFP6: AFP6 initialized");
                 Log_info0("TaskAfp: Initialized");
 
+#ifdef MEMSTAT_REPORT
+                // Output current heap memory usage
+                PAF_ALG_memStatusPrint("AFP MEMSTAT REPORT", 
+                    PAF_HEAP_INT, PAF_HEAP_INT1, PAF_HEAP_EXT, 
+                        PAF_HEAP_INT1_SHM, PAF_HEAP_EXT_SHM, PAF_HEAP_EXT_NONCACHED_SHM);
+#endif /* MEMSTAT_REPORT */
+               
                 // Process alpha commands
                 handle->fxns->process(handle);
             }
index 292f2a0b4f864638551d165b4e07b541f3c924d4..56f6903037521fc4400bd1d62f9cf72380e167fd 100644 (file)
@@ -54,18 +54,14 @@ All rights reserved.
 
 #include "logp.h"
 #include "pafaip.h"
-#include "paf_alg_print.h"
-#include "paf_heapMgr.h"
 
 #include "fwkPort.h"
 
-// Symbolic constants for translating heap Ids to handles
-#define HEAP_INTERNAL                   (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt)
-#define HEAP_INTERNAL1                  (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1)
-#define HEAP_EXTERNAL                   (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExt)
-#define HEAP_INTERNAL1_SHM              (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdInt1Shm)
-#define HEAP_EXTERNAL_SHM               (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtShm)
-#define HEAP_EXTERNAL_NONCACHED_SHM     (HeapMem_Handle)pafHeapMgr_readHeapHandle(gPafHeapIdExtNonCachedShm)
+//#define MEMSTAT_REPORT
+#ifdef MEMSTAT_REPORT
+#include "paf_heapMgr.h"
+#include "paf_alg_print.h"
+#endif /* MEMSTAT_REPORT */
 
 //
 // Alpha code shortcut arrays
@@ -127,8 +123,6 @@ const PAF_AlphaIntervalProcessingStatus aipStatusInit =
     100,    // time (msec.)
 };
 
-Int gEnableRamReport = 0;  // set this in main if RAM_REPORT is desired.
-
 // Global debug counters */
 Uint32 gTaskAipCnt=0;
 
@@ -184,11 +178,12 @@ Void taskAipFxn(
     //LOG_printf(&trace, "AIP: ACP processing initialized");
     Log_info0("AIP: ACP processing initialized");
 
-    if (gEnableRamReport)
-    {
-        PAF_ALG_memStatusPrint(HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
-            HEAP_INTERNAL1_SHM, HEAP_EXTERNAL_SHM, HEAP_EXTERNAL_NONCACHED_SHM);
-    }
+#ifdef MEMSTAT_REPORT
+    // Output current heap memory usage
+    PAF_ALG_memStatusPrint("AIP RAM REPORT", 
+        PAF_HEAP_INT, PAF_HEAP_INT1, PAF_HEAP_EXT, 
+        PAF_HEAP_INT1_SHM, PAF_HEAP_EXT_SHM, PAF_HEAP_EXT_NONCACHED_SHM);
+#endif  
     
     // Set default stream
     if (betaPrimeValue != 0)
index de545a167a5328d652bdfcf606c3b9a8aa51009e..05e847f71193c4146478b2eac53e1f7b361de30d 100644 (file)
@@ -469,7 +469,8 @@ Void taskAsipFxn(
     //
     if (pP->fxns->memStatusPrint)
     {
-        pP->fxns->memStatusPrint(HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
+        pP->fxns->memStatusPrint("ASIT MEMSTAT REPORT",
+            HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
             HEAP_INTERNAL1_SHM, HEAP_EXTERNAL_SHM, HEAP_EXTERNAL_NONCACHED_SHM);
     }
     
index e2bc5fdcd1772a83265c9a7ead3d875724ce5ec6..d80ab4588c109ad7d977798df4b4694585b56f9e 100644 (file)
@@ -93,8 +93,9 @@ typedef struct PAF_ASIT_Fxns {
     Int  (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
     Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
     Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
-    Void (*memStatusPrint)(HeapMem_Handle 
-        hInternalHeap, 
+    Void (*memStatusPrint)(
+        CString header, 
+        HeapMem_Handle hInternalHeap, 
         HeapMem_Handle hInternal1Heap, 
         HeapMem_Handle hExternalHeap, 
         HeapMem_Handle hInternal1HeapShm, 
@@ -126,12 +127,15 @@ typedef struct PAF_ASIT_Params {
     const SmInt *inputsFromDecodes;
     const SmInt *outputsFromEncodes;
     struct {
-        int *pHeapIdIntern;   //int *pIntern;
-        int *pHeapIdExtern;   //int *pExtern;
-        int *pHeapIdInpbuf;   //int *pInpbuf;
-        int *pHeapIdOutbuf;   //int *pOutbuf;
-        int *pHeapIdFrmbuf;   //int *pFrmbuf;
-        int *pHeapIdIntern1;  //int *pIntern1;
+        int *pHeapIdIntern;
+        int *pHeapIdExtern;
+        int *pHeapIdInpbuf;
+        int *pHeapIdOutbuf;
+        int *pHeapIdFrmbuf;
+        int *pHeapIdIntern1;
+        int *pHeapIdInt1Shm;
+        int *pHeapIdExtShm;
+        int *pHeapIdExtNonCachedShm;
         int clear; 
     } heap;
     struct {
index 3eb7f78b8ef8a2655de42922c8d48142ab2a24ca..f0e0095899c95882e1d36c6e780472cd8e4c47c6 100644 (file)
@@ -244,7 +244,8 @@ Void taskAsopFxn(
     //
     if (pP->fxns->memStatusPrint)
     {
-        pP->fxns->memStatusPrint(HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
+        pP->fxns->memStatusPrint("ASOT MEMSTAT REPORT",
+            HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, 
             HEAP_INTERNAL1_SHM, HEAP_EXTERNAL_SHM, HEAP_EXTERNAL_NONCACHED_SHM);
     }
 
index 1714a03b651cf32f27b61f5430542a86d39696f4..f7115544238459802b519557a9226fb1b0865fc7 100644 (file)
@@ -93,7 +93,9 @@ typedef struct PAF_ASOT_Fxns {
     Int  (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
     Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
     Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
-    Void (*memStatusPrint)(HeapMem_Handle hInternalHeap, 
+    Void (*memStatusPrint)(
+        CString header, 
+        HeapMem_Handle hInternalHeap, 
         HeapMem_Handle hInternal1Heap, 
         HeapMem_Handle hExternalHeap, 
         HeapMem_Handle hInternal1HeapShm, 
@@ -125,12 +127,15 @@ typedef struct PAF_ASOT_Params {
     const SmInt *inputsFromDecodes;
     const SmInt *outputsFromEncodes;
     struct {
-        int *pHeapIdIntern;   //int *pIntern;
-        int *pHeapIdExtern;   //int *pExtern;
-        int *pHeapIdInpbuf;   //int *pInpbuf;
-        int *pHeapIdOutbuf;   //int *pOutbuf;
-        int *pHeapIdFrmbuf;   //int *pFrmbuf;
-        int *pHeapIdIntern1;  //int *pIntern1;
+        int *pHeapIdIntern;
+        int *pHeapIdExtern;
+        int *pHeapIdInpbuf;
+        int *pHeapIdOutbuf;
+        int *pHeapIdFrmbuf;
+        int *pHeapIdIntern1;
+        int *pHeapIdInt1Shm;
+        int *pHeapIdExtShm;
+        int *pHeapIdExtNonCachedShm;
         int clear; 
     } heap;
     struct {
index f4b4fc4fbc5d91585a0a8f82b3d81d9c825243c7..cb41dd9d9b9915fd53821379cb2cd07309ef4322 100644 (file)
@@ -863,6 +863,9 @@ const PAF_ASIT_Params asip_params_PAi =
         &gPafHeapIdInt,    //&IRAM,                         // heap.pOutbuf
         &gPafHeapIdInt,    //&IRAM,                         // heap.pFrmbuf
         &gPafHeapIdInt1,   //&L3RAM,                        // heap.pIntern1
+        &gPafHeapIdInt1Shm,                                 // heap.pHeapIdInt1Shm
+        &gPafHeapIdExtShm,                                  // heap.pHeapIdExtShm
+        &gPafHeapIdExtNonCachedShm,                         // heap.pHeapIdExtNonCachedShm
         1,                                                  // heap.clear
     },
     {                                                       // common
@@ -927,6 +930,9 @@ const PAF_ASOT_Params asop_params_PAi =
         &gPafHeapIdInt,    //&IRAM,                         // heap.pOutbuf
         &gPafHeapIdInt,    //&IRAM,                         // heap.pFrmbuf
         &gPafHeapIdInt1,   //&L3RAM,                        // heap.pIntern1
+        &gPafHeapIdInt1Shm,                                 // heap.pHeapIdInt1Shm
+        &gPafHeapIdExtShm,                                  // heap.pHeapIdExtShm
+        &gPafHeapIdExtNonCachedShm,                         // heap.pHeapIdExtNonCachedShm
         1,                                                  // heap.clear
     },
     {                                                       // common
index 7665f275ec7ddb07cca78bcd5dc2e44e00312207..3e2f79824959ed33d0e92d038cd41bf4c3db3503 100644 (file)
@@ -76,10 +76,15 @@ All rights reserved.
 extern Void ACP_main_cus(Void);     // (*** ?) FL: revisit -- check method of patching alpha codes
 //extern Void taskSystemStreamFxn(Void);  // (*** ?) FL: revisit -- shouldn't need to call this from system init
 
+//#define MEMSTAT_REPORT
+#ifdef MEMSTAT_REPORT
+#include "paf_alg_print.h"
+#endif
+
 #define RAM_REPORT
 #ifdef RAM_REPORT
-#include <audioStreamProc_params.h>
-#include <paf_alg_print.h>
+#include "audioStreamProc_params.h"
+#include "paf_alg_print.h"
 extern PAF_ASIT_Fxns PAF_ASIT_params_fxns;
 extern PAF_ASOT_Fxns PAF_ASOT_params_fxns;
 #endif
@@ -94,7 +99,6 @@ Int gTaskInitFlag[NUM_SYS_TASKS];
 const PAFHJT_t *pafhjt;
 
 
-
 /*
  *  ======== taskSysInitFxn ========
  *  System Initializations task function
@@ -171,6 +175,13 @@ Void taskSysInitFxn(Void)
         srHeapMsmc, 
         srHeapDdr3,
         srHeapNonCacheDdr3);
+
+#ifdef MEMSTAT_REPORT
+    // Output current heap memory usage
+    PAF_ALG_memStatusPrint("System Initialization, Initial MEMSTAT REPORT",
+        PAF_HEAP_INT, PAF_HEAP_INT1, PAF_HEAP_EXT, 
+        PAF_HEAP_INT1_SHM, PAF_HEAP_EXT_SHM, PAF_HEAP_EXT_NONCACHED_SHM);
+#endif        
     
     /* Initialize HJT */
     pafhjt = &PAFHJT_RAM;
@@ -215,14 +226,20 @@ Void taskSysInitFxn(Void)
     // once.
     while (gTaskInitFlag[TASK_SSP_INIT_FLAG_IDX] == 0)  // System Stream initialization flag is set to 1 in TaskSystemStream
     {
-       Task_sleep(SYS_INIT_SLEEP);
+        Task_sleep(SYS_INIT_SLEEP);
     }
 
-
     Task_setPri(TaskAfp, TASK_AFP_PRI);
     Task_setPri(TaskAip, TASK_AIP_PRI);
     Task_setPri(TaskAsip, TASK_ASIP_PRI);
     Task_setPri(TaskAsop, TASK_ASOP_PRI);
 
+#ifdef MEMSTAT_REPORT
+    // Output current heap memory usage
+    PAF_ALG_memStatusPrint("System Initialization, Final MEMSTAT REPORT",
+        PAF_HEAP_INT, PAF_HEAP_INT1, PAF_HEAP_EXT, 
+        PAF_HEAP_INT1_SHM, PAF_HEAP_EXT_SHM, PAF_HEAP_EXT_NONCACHED_SHM);
+#endif           
+    
     Log_info0("Exit taskSysInitFxn()");
 }
index a593fd2d6f7328ec35e1d3ac5055647219a61ead..39653dfef1b7a0367970a4daa8cec8de90c67047 100644 (file)
@@ -75,13 +75,12 @@ All rights reserved.
 #include "systemInit.h"
 
 //#include "pafhjt.h"
-//
-//#ifdef RAM_REPORT
-//#include <paf_alg_print.h>
-//extern int IRAM;
-//extern int SDRAM;
-//extern int L3RAM;
-//#endif /* RAM_REPORT */
+
+//#define MEMSTAT_REPORT
+#ifdef MEMSTAT_REPORT
+#include "paf_heapMgr.h"
+#include "paf_alg_print.h"
+#endif /* MEMSTAT_REPORT */
 
 #ifndef FULL_SPEAKER
 #define FULL_SPEAKER
@@ -191,24 +190,16 @@ systemStreamMain(
             acp->fxns->attach(acp, ACP_SERIES_STD, STD_BETA_IDENTITY, (IALG_Status *) &pafIdentification);
         }
         
+#ifdef MEMSTAT_REPORT
+        // Output current heap memory usage
+        PAF_ALG_memStatusPrint("System Stream MEMSTAT REPORT", 
+            PAF_HEAP_INT, PAF_HEAP_INT1, PAF_HEAP_EXT, 
+            PAF_HEAP_INT1_SHM, PAF_HEAP_EXT_SHM, PAF_HEAP_EXT_NONCACHED_SHM);
+#endif /* MEMSTAT_REPORT */
+
         pC->firstTimeInit = 1;
     }       
 
-#ifdef RAM_REPORT
-    {
-        static int count=0;
-        if (count < 10)
-        {
-            count++;            
-        }
-        else if (count == 10)
-        {
-            PAF_ALG_memStatusPrint(IRAM,SDRAM,L3RAM);
-            count++;
-        }
-    }
-#endif /* RAM_REPORT */
-
     // Invoke sub-functions as per mode
     if (fxns != NULL) 
     {
@@ -716,7 +707,7 @@ systemStream5Compute(
     UInt32 pfpLatchStatsMask;
     UInt32 pfpResetStatsMask;
     UInt32 pfpAlphaUpdateMask;
-    pfpStats_t pfpStats;
+    //pfpStats_t pfpStats; //Integer only PFP alpha interface
     UInt8 i;
 
     Load_getTaskLoad(Task_getIdleTask(), &stat);
@@ -813,7 +804,7 @@ systemStream5Compute(
         {
             if (pfpLatchStatsMask & 1)
             {
-                pfpGetStats(i, &pStatus->ssPfpStats[i]);
+                pfpGetStats(i, (pfpStats_t *)&pStatus->ssPfpStats[i]);
 #if 0 //Integer only PFP alpha interface          
                 //pfpGetStats(i, &pfpStats);
                 //copyPfpStats(&pfpStats, (PAF_SystemStatus_PfpStats *)&pStatus->ssPfpStats[i]);