Opened 7 years ago

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

comment:3 Changed 7 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 6 years ago by erdmann

Still not fixed with SVN 330.

comment:5 Changed 6 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 6 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);
      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 Changed 4 years ago by martini

Hi

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

Regards

comment:8 Changed 4 years ago by martini

Owner: set to Valery V. Sedletski
Status: newassigned

comment:9 Changed 2 years ago by erdmann

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

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