[repost] [patch] CPU time usage for subprocesses of gcc

Jeffrey A Law law@cygnus.com
Wed Oct 13 00:27:00 GMT 1999


  In message <199909110552.WAA01047@zack.bitmover.com>you write:
  > 
  > I submitted this patch some time ago.  It received some comments, and
  > then vanished into the ether.  This repost should address all of the
  > concerns raised, and also fixes some typos in the original.
The joys of EOQ crunch time :(  It sucks in a major way....


  > The point of the patch: gcc -time ... will print out the user and
  > system time consumed by each subprocess it runs.  This is useful when
  > profiling: it's finer grained than "time make" but coarser than
  > rebuilding the compiler with -pg.
  > 
  > -time disables -pipe, because you can't get valid timing info for
  > concurrent subprocesses unless the system has wait4.  Many of them
  > don't, and a good number of the ones that purport to have it actually
  > have a fake implementation that doesn't work for concurrent
  > subprocesses.
  > 
  > zw
  > 
  > 1999-09-10 22:47 -0700  Zack Weinberg  <zack@bitmover.com>
  > 
  > 	* gcc.c: Include sys/resource.h.
  > 	(report_times): New flag.
  > 	(execute):  If report_times is set, calculate and report the
  > 	CPU time consumed by each subprocess.
  > 
  > 	(rus, prus): New globals.
  > 	(option_map): Add --time.
  > 	(display_help): Document -time.
  > 	(process_command): Set report_times if -time is given.
  > 	Turn off -pipe if -time is given.
  > 
  > 	* invoke.texi: Document new option -time.
  > 
  > 	* configure.in: Check for getrusage.  Check if we have to
  > 	prototype getrusage.
  > 	* acconfig.h: Add NEED_DECLARATION_GETRUSAGE.
Looks good.  Please install it.  Sorry about the delays.

jeff



More information about the Gcc-patches mailing list