Opened 2 years ago

Last modified 12 months ago

#66 new defect

SVN rev 326: tracing still not dynamically controllable via the trace.exe utility

Reported by: erdmann Owned by:
Priority: major Milestone: Future
Component: IFS Version:
Severity: medium Keywords:
Cc:

Description

File "ifslog.c", routine "trace":

you need to remove this block of code, otherwise invocation of "message" function will still not correctly deal with the trace flags:

294	static BOOL fInitted = FALSE;
295	static BOOL fTraceEnabled;
...
306	   if (! fInitted)
307	      {
308	      // check if tracing with TRACE_MAJOR is enabled
309	      fTraceEnabled = pGI->amecRAS[TRACE_MAJOR / 8] & (0x80 >> (TRACE_MAJOR % 8));
310	      }
311	   fInitted = TRUE;
312	
313	   if (! fTraceEnabled)
314	      return 0;

I don't know if you still need routine "Trace" (written with capital T).
Of course that will then miss the check for the trace flag. It would be best to get rid of it and use routines "Message"/"message" instead.

Change History (6)

comment:1 Changed 2 years ago by valerius

Where are you seeing this fragment of code? It is already removed some days ago, in r326.

comment:2 Changed 2 years ago by erdmann

Valery, please thoroughly read what I have written.

This undesirable code appears TWICE in "ifslog.c". You fixed it in one place but forgot the other place where it needs to be removed entirely which was what I was suggesting.

And unfortunately, routine "trace" is called from routine "message".

Last edited 2 years ago by erdmann (previous) (diff)

comment:3 Changed 2 years ago by valerius

Ah, indeed, I overlooked the routine "trace". Will delete it here too. "Trace" and "Message" are wrappers over "trace" and "message", correspondingly. The ones with a small letter take va_list as parameters, and the ones with a capital letter are variable argument routines. And yes, "trace" is called by "message", because I need the corresponding trace entries to be generated when standard messages are output. I also added the "%m" format string parameter specially for MessageL to pass a minor trace number at this place. And additionally, you can use Trace() to output a trace entry without a debug message.

comment:4 Changed 2 years ago by erdmann

Still not fixed with SVN 330.

comment:5 Changed 12 months ago by valerius

BTW, did you started f32mon.exe, in addition to enabling trace? Tracing and logging are done with the same routines, which do nothing if f32mon is not started or /monitor switch is not set in fat32.ifs command line.

comment:6 Changed 12 months ago by valerius

Ah, no. That's not true. message() function begins like this:

   if (pGI->amecRAS[TRACE_MAJOR / 8] & (0x80 >> (TRACE_MAJOR % 8)))
      {
      // output to trace buffer
      va_copy(va2, va);
      trace(pszMessage, va2);
      va_end(va2);
      }

   if (!(f32Parms.fMessageActive & usLevel))
      {
      va_end(va);
      _asm pop es;
      return;
      }

So, if messages are disabled, trace should still work.

Note: See TracTickets for help on using tickets.