Opened 3 years ago

Last modified 5 months ago

#66 assigned defect

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

Reported by: erdmann Owned by: Valery V. Sedletski
Priority: major Milestone: Future
Component: IFS Version:
Severity: medium Keywords:


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;
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 (8)

comment:1 Changed 3 years ago by Valery V. Sedletski

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

comment:2 Changed 3 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 3 years ago by erdmann (previous) (diff)

comment:3 Changed 3 years ago by Valery V. Sedletski

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 3 years ago by erdmann

Still not fixed with SVN 330.

comment:5 Changed 2 years ago by Valery V. Sedletski

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 2 years ago by Valery V. Sedletski

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);

   if (!(f32Parms.fMessageActive & usLevel))
      _asm pop es;

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

comment:7 Changed 5 months ago by martini


Is this fixed on release 0.10 r383 ? Can we close this ticket?


comment:8 Changed 5 months ago by martini

Owner: set to Valery V. Sedletski
Status: newassigned
Note: See TracTickets for help on using tickets.