From 29e7f08eb22601a849bb81ecbda7b4606780c3dc Mon Sep 17 00:00:00 2001 From: Nallani Bhaskar Date: Mon, 9 Aug 2021 18:41:56 +0530 Subject: [PATCH] Updated aocldtl loging with fflush Description: 1. Added fflush after fprintf in aocldtl so avoid mising any log info when application crashes 2. Removed one redundent if def statement Change-Id: I79a645060fa36bd8c7e5eaca4d9183dc944329ea --- aocl_dtl/aocldtl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aocl_dtl/aocldtl.c b/aocl_dtl/aocldtl.c index 8615a58e2..1c377e092 100644 --- a/aocl_dtl/aocldtl.c +++ b/aocl_dtl/aocldtl.c @@ -264,6 +264,7 @@ void DTL_Trace( fprintf(pOutFile, "%s\n", pi8Message); break; } + fflush(pOutFile); } } /* DTL_Data_Trace_Entry */ #endif @@ -401,6 +402,7 @@ void DTL_DumpData( } fprintf(pDumpFile, "\n"); } /* End of if */ + fflush(pDumpFile); } /* DTL_DumpData */ #endif @@ -460,6 +462,7 @@ void __cyg_profile_func_enter(void *pvThisFunc, void *pvCaller) fprintf(pOutFile, "\n%lu:+:%p", AOCL_getTimestamp(), (void *)(pvThisFunc - info.dli_fbase)); + fflush(pOutFile); } /*=================================================================== @@ -498,6 +501,7 @@ void __cyg_profile_func_exit(void *pvThisFunc, void *pvCaller) fprintf(pOutFile, "\n%lu:-:%p", AOCL_getTimestamp(), (void *)(pvThisFunc - info.dli_fbase)); + fflush(pOutFile); } #endif /* AOCL_AUTO_TRACE_ENABLE */