summaryrefslogtreecommitdiff
path: root/autoconf
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-04 23:19:55 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-04 23:19:55 +0000
commit73c35d86b9d5236be5b3f49bc8df11008b96636e (patch)
tree2f479bcb66906083a890f835e0de373f9e506370 /autoconf
parent57fa912be794d2ba1b26894e4a725d75e1157957 (diff)
downloadllvm-73c35d86b9d5236be5b3f49bc8df11008b96636e.tar.gz
llvm-73c35d86b9d5236be5b3f49bc8df11008b96636e.tar.bz2
llvm-73c35d86b9d5236be5b3f49bc8df11008b96636e.tar.xz
Add time getters to the process interface for requesting the elapsed
wall time, user time, and system time since a process started. For walltime, we currently use TimeValue's interface and a global initializer to compute a close approximation of total process runtime. For user time, this adds support for an somewhat more precise timing mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock selected. For system time, we have to do a full getrusage call to extract the system time from the OS. This is expensive but unavoidable. In passing, clean up the implementation of the old APIs and fix some latent bugs in the Windows code. This might have manifested on Windows ARM systems or other systems with strange 64-bit integer behavior. The old API for this both user time and system time simultaneously from a single getrusage call. While this results in fewer system calls, it also results in a lower precision user time and if only user time is desired, it introduces a higher overhead. It may be worthwhile to switch some of the pass timers to not track system time and directly track user and wall time. The old API also tracked walltime in a confusing way -- it just set it to the current walltime rather than providing any measure of wall time since the process started the way buth user and system time are tracked. The new API is more consistent here. The plan is to eventually implement these methods for a *child* process by using the wait3(2) system call to populate an rusage struct representing the whole subprocess execution. That way, after waiting on a child process its stats will become accurate and cheap to query. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac4
1 files changed, 4 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index c5ac14999f..fdda3f9567 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1250,6 +1250,10 @@ AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],
[Define if dlopen() is available on this platform.]),
AC_MSG_WARN([dlopen() not found - disabling plugin support]))
+dnl clock_gettime() is required for modern timing support.
+AC_SEARCH_LIBS(clock_gettime,rt,[],
+ AC_MSG_ERROR([clock_gettime not found and is required for modern POSIX timing uspport]))
+
dnl libffi is optional; used to call external functions from the interpreter
if test "$llvm_cv_enable_libffi" = "yes" ; then
AC_SEARCH_LIBS(ffi_call,ffi,AC_DEFINE([HAVE_FFI_CALL],[1],