www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/26/01:13:13

Date: Thu, 25 Aug 94 22:11:04 -0400
From: dj AT ctron DOT com (DJ Delorie)
To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: gprof problems

> 1. It seems that profiling doesn't work under DPMI, except counting
> the number of times each function was called.  mcount_isr_init()
> (on crt0.s) explicitly tests for run_mode to be not more than 3,
> while DPMI is 4 (see include/go32.h).  Is there some inherent
> incompatibility between DPMI and the timer tick interrupt, or
> is this just a bug?

The signature of the interrupt stack is different in DPMI, so the same
code won't work in both cases.  If someone wants to volunteer to make
the code better, go for it.  The test is there to allow call counting
in DPMI mode.

> 2. Also, I would suggest to reprogram the timer to work with finer
> granularity than the default 55 msec.  This would add only a few
> more machine instructions to the interrupt handler (to pass the
> interrupt down the chain only every n interrupts, so the system
> time runs at normal speed), but will greatly enhance the accuracy
> of the profile.  55 msec is really too coarse for most functions,
> and would skew the profile for programs which take a short time
> to execute.  Another possibility is to use the CMOS clock which
> ticks every 1 msec, and can generate an interrupt if you ask nicely
> enough.  This has an advantage of not messing up with the system
> timer.

The more interrupts, the more overhead also.

> 3. It seems to me that the time spent outside the protected-mode code
> (including the library), e.g., when go32 does something on behalf
> of the user, doesn't get counted.  For instance, a program which

Yup, because the protected-mode timer interrupt doesn't happen then


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019