Opened 7 years ago

Closed 3 years ago

#66 closed defect (fixed)

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:
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 (10)

comment:1 by Valery V. Sedletski, 7 years ago

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

comment:2 by erdmann, 7 years ago

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. And unfortunately, routine "trace" is called from routine "message".

Version 0, edited 7 years ago by erdmann (next)

comment:3 by Valery V. Sedletski, 7 years ago

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

Still not fixed with SVN 330.

comment:5 by Valery V. Sedletski, 6 years ago

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

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.

comment:7 by martini, 5 years ago

Hi

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

Regards

comment:8 by martini, 5 years ago

Owner: set to Valery V. Sedletski
Status: newassigned

comment:9 by erdmann, 3 years ago

In the meantime, I am using 0.10 r384 and it looks like this problem is now fixed. I can enable and disable tracing for major trace code 0xFE (which is what FAT32.IFS uses) via the trace utility. Closing this ticket.

comment:10 by erdmann, 3 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.