Mail Archives: djgpp/2000/01/15/17:27:37
Jeff Williams wrote:
>
> So, on DOS, it doesn't seem that `time' could report much of
> interest, anyway.
Perhaps you could enhance getrusage so that `time' *does* report useful info.
It's not too hard, really. You need:
- hooks in dosexec.c, just before a child program is launched and after
it exits, to record time spent in the child process;
- hook in __dpmi_int, int86, and their ilk, to record ``system'' time
used by the process;
- hooks in _read and _write, to record I/O usage statistics;
- a simple counter in dpmiexcp.c, to record the number of signals delivered
to the process;
- a counter in __dpmi_yield, to record the number of ``voluntary'' context
switches.
Since the memory footprint of a DJGPP program can only grow, the maximum
resident set size, data size, stack size etc. can be easily computed from the
current limit of the DS selector and other variables like _stklen, _etext,
_edata, the value of ESP, etc.
- Raw text -