aboutsummaryrefslogtreecommitdiff
path: root/libiberty/configure.ac
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-10-06 22:02:58 +0000
committerAndi Kleen <ak@gcc.gnu.org>2010-10-06 22:02:58 +0000
commit6e9bd0f8983779325b34a9645c2634dafd14d3c9 (patch)
tree4b6b55c80051aa7deeeb8de1d0979f488e306b4c /libiberty/configure.ac
parent826d817faeaa2549589553b276e4c71f83ce6dd7 (diff)
downloadgcc-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 'libiberty/configure.ac')
-rw-r--r--libiberty/configure.ac14
1 files changed, 13 insertions, 1 deletions
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 4de83f9..8b7be18 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -351,6 +351,7 @@ funcs="$funcs vprintf"
funcs="$funcs vsnprintf"
funcs="$funcs vsprintf"
funcs="$funcs waitpid"
+funcs="$funcs setproctitle"
# Also in the old function.def file: alloca, vfork, getopt.
@@ -373,7 +374,8 @@ if test "x" = "y"; then
on_exit \
psignal pstat_getdynamic pstat_getstatic putenv \
random realpath rename rindex \
- sbrk setenv sigsetmask snprintf stpcpy stpncpy strcasecmp strchr strdup \
+ sbrk setenv setproctitle sigsetmask snprintf stpcpy stpncpy strcasecmp strchr \
+ strdup \
strerror strncasecmp strndup strrchr strsignal strstr strtod strtol \
strtoul strverscmp sysconf sysctl sysmp \
table times tmpnam \
@@ -533,6 +535,16 @@ fi
AC_SUBST(CHECK)
AC_SUBST(target_header_dir)
+# check for prctl PR_SET_NAME
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/prctl.h>
+int main()
+{
+ return (prctl(PR_SET_NAME, "foo") == 0) ? 0 : 1;
+}
+]])], AC_DEFINE(HAVE_PRCTL_SET_NAME, 1,
+ [Define if you have prctl PR_SET_NAME]))
+
case "${host}" in
*-*-cygwin* | *-*-mingw*)
AC_DEFINE(HAVE_SYS_ERRLIST)