From c88e81060da38b0af1efe9fd7c9d980b617745b1 Mon Sep 17 00:00:00 2001 From: Frank Livingston Date: Thu, 11 May 2017 12:19:58 -0500 Subject: [PATCH] PASDK-254:Add debug IDLE memstat report --- pasdk/test_dsp/framework/alphaFuncProc.c | 2 + pasdk/test_dsp/framework/dbgIdle.c | 70 ++++++++++++++++++++++++ pasdk/test_dsp/framework/dbgIdle.h | 42 ++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 pasdk/test_dsp/framework/dbgIdle.c create mode 100644 pasdk/test_dsp/framework/dbgIdle.h diff --git a/pasdk/test_dsp/framework/alphaFuncProc.c b/pasdk/test_dsp/framework/alphaFuncProc.c index f3eae60c..3c59875d 100644 --- a/pasdk/test_dsp/framework/alphaFuncProc.c +++ b/pasdk/test_dsp/framework/alphaFuncProc.c @@ -54,6 +54,7 @@ All rights reserved. #include "paf_alg_print.h" #endif /* MEMSTAT_REPORT */ +//#include "dbgIdle.h" // FL: debug -- initiate IDLE memstat #define ENABLE_AE_TRACE #ifdef ENABLE_AE_TRACE @@ -365,6 +366,7 @@ Void taskAfpFxn(AFP_Handle handle) 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 */ + //gRunIdleMemStatRpt=1; // FL: debug // Process alpha commands handle->fxns->process(handle); diff --git a/pasdk/test_dsp/framework/dbgIdle.c b/pasdk/test_dsp/framework/dbgIdle.c new file mode 100644 index 00000000..584aed55 --- /dev/null +++ b/pasdk/test_dsp/framework/dbgIdle.c @@ -0,0 +1,70 @@ + +/* +Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/ +All rights reserved. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the +* distribution. +* +* Neither the name of Texas Instruments Incorporated nor the names of +* its contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +/* + * ======== dbgIdle.c ======== + */ + +#include +#include +#include +#include + + +#define MEMSTAT_REPORT +#ifdef MEMSTAT_REPORT +#include "paf_heapMgr.h" +#include "paf_alg_print.h" +UInt32 gRunIdleMemStatRpt=0; // export to other threads to allow Idle memstat to run +#endif /* MEMSTAT_REPORT */ + +/* + * ======== idleNotifyInfoChange ======== + * IDLE function for debugging. + * Can be safely removed from build. + */ +Void idleDebug() +{ +#ifdef MEMSTAT_REPORT + if (gRunIdleMemStatRpt == 1) + { + // Output current heap memory usage + PAF_ALG_memStatusPrint("IDLE MEMSTAT REPORT", + PAF_HEAP_INT, PAF_HEAP_INT1, PAF_HEAP_EXT, + PAF_HEAP_INT1_SHM, PAF_HEAP_EXT_SHM, PAF_HEAP_EXT_NONCACHED_SHM); + gRunIdleMemStatRpt = 0; + } +#endif +} diff --git a/pasdk/test_dsp/framework/dbgIdle.h b/pasdk/test_dsp/framework/dbgIdle.h new file mode 100644 index 00000000..8b47cbb0 --- /dev/null +++ b/pasdk/test_dsp/framework/dbgIdle.h @@ -0,0 +1,42 @@ + +/* +Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/ +All rights reserved. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the +* distribution. +* +* Neither the name of Texas Instruments Incorporated nor the names of +* its contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +/* + * ======== dbgIdle.h ======== + */ + +#include + +extern UInt32 gRunIdleMemStatRpt; // export to other threads to allow Idle memstat to run -- 2.39.2