diff options
author | Andi Kleen <ak@linux.intel.com> | 2010-10-06 22:02:58 +0000 |
---|---|---|
committer | Andi Kleen <ak@gcc.gnu.org> | 2010-10-06 22:02:58 +0000 |
commit | 6e9bd0f8983779325b34a9645c2634dafd14d3c9 (patch) | |
tree | 4b6b55c80051aa7deeeb8de1d0979f488e306b4c /gcc/lto | |
parent | 826d817faeaa2549589553b276e4c71f83ce6dd7 (diff) | |
download | gcc-6e9bd0f8983779325b34a9645c2634dafd14d3c9.zip gcc-6e9bd0f8983779325b34a9645c2634dafd14d3c9.tar.gz gcc-6e9bd0f8983779325b34a9645c2634dafd14d3c9.tar.bz2 |
[PATCH] Report LTO phase in lto1 process name v2
On larger parallel WHOPR builds I find it useful to see in top which
phase a given lto1 is in.
Set the process name to lto1-wpa, lto1-ltrans, lto1-lto depending
on the current mode.
This is currently only implemented for Linux and only
using the "comm" process name, which is reported in top.
v2: Moved function to libiberty, renamed setproctitle to match
BSD. In theory it should pick up BSD's libc function for this
on a BSD system, but I haven't tested this.
gcc/lto/
2010-10-06 Andi Kleen <ak@linux.intel.com>
* lto.c (lto_process_name): Add.
(lto_main): Call lto_process_name.
include/
2010-10-06 Andi Kleen <ak@linux.intel.com>
* libiberty.h (setproctitle): Add prototype.
libiberty/
2010-10-06 Andi Kleen <ak@linux.intel.com>
* Makefile.in (CFILES): Add setproctitle.
(CONFIGURED_OFILES): Add setproctitle.
(setproctitle): Add rule.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Add checks for prctl PR_SET_NAME and setproctitle.
* setproctitle.c: Add file.
* functions.texi: Regenerate.
From-SVN: r165066
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 0057fe3..2bce315 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2010-10-06 Andi Kleen <ak@linux.intel.com> + + * lto.c (lto_process_name): Add. + (lto_main): Call lto_process_name. + 2010-10-06 Jan Hubicka <jh@suse.cz> * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index ab90e85..12fa613 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2379,6 +2379,18 @@ lto_eh_personality (void) return lto_eh_personality_decl; } +/* Set the process name based on the LTO mode. */ + +static void +lto_process_name (void) +{ + if (flag_lto) + setproctitle ("lto1-lto"); + if (flag_wpa) + setproctitle ("lto1-wpa"); + if (flag_ltrans) + setproctitle ("lto1-ltrans"); +} /* Main entry point for the GIMPLE front end. This front end has three main personalities: @@ -2403,6 +2415,8 @@ lto_eh_personality (void) void lto_main (int debug_p ATTRIBUTE_UNUSED) { + lto_process_name (); + lto_init_reader (); /* Read all the symbols and call graph from all the files in the |