Re: [hatari-users] Trace file not flushed

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-users Archives ]


Hi,

On lauantai 24 joulukuu 2011, Vincent Rivière wrote:
> I put that in Hatari configuration file:
> [Log]
> sTraceFileName = trace.log
> 
> That trace file is only flushed on Hatari exit, that's
> unusable :-(  It should be flushed on new line.

Where exactly do you have the issue?

Something like the attached patch should fix it in the normal
case but after checking the code I noticed that:

* CPU disasm trace goes to debugOutput (as it
  uses/shares debugger output functions)
* DSP disasm trace seems to go to stderr

Those don't go to trace log file.


	- Eero
diff -r b71fc05b3e31 src/debug/log.h
--- a/src/debug/log.h	Mon Dec 26 12:39:40 2011 +0100
+++ b/src/debug/log.h	Mon Dec 26 22:45:28 2011 +0200
@@ -149,7 +149,7 @@
 
 #ifndef _VCWIN_
 #define	LOG_TRACE(level, args...) \
-	if (unlikely(LogTraceFlags & level)) fprintf(TraceFile, args)
+	if (unlikely(LogTraceFlags & level)) { fprintf(TraceFile, args); fflush(TraceFile); }
 #endif
 #define LOG_TRACE_LEVEL( level )	(unlikely(LogTraceFlags & level))
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/