This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: time usage for subprocesses [NEW PATCH]
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: time usage for subprocesses [NEW PATCH]
- From: Zack Weinberg <zack at bitmover dot com>
- Date: Thu, 12 Aug 1999 20:19:24 -0700
- cc: law at cygnus dot com, egcs-patches at egcs dot cygnus dot com
Michael Meissner wrote:
> | Jeffrey A Law wrote:
> | >
> | > In message <199908070639.XAA08070@zack.bitmover.com>you write:
> | > > Jeffrey A Law wrote:
> | > > > But it's trivial to get deltas given the rusage stats as you wait o
> n
> | > > > each process in succession.
> | > >
> | > > My impression was that times() and getrusage(RUSAGE_CHILDREN, ...)
> | > > would give me cumulative execution times for all the children up to
> | > > the moment I made the call. Is that not the case?
> | > Right, but all that means is you have to subtract the last sample from th
> e
> | > new sample to get the run time for whatever pass you just ran.
> |
> | I get it now... and doing it this way, I don't have to modify
> | libiberty. On the other hand, I have to turn off -pipe, but that's
> | OK. New patch follows.
>
> At some point it would be nice if wait4 exists to use that so that on such
> systems (most UNIX varients these days and cygwin), you don't have to disable
> -pipe.
It's a good idea, but I discovered that sometimes wait4 is faked in
terms of getrusage and will be spectacularly wrong if you have two
children executing simultaneously.
zw