This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: time usage for subprocesses [NEW PATCH]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]