Find and fix more places where clock_gettime() and CLOCK_MONOTONIC_RAW are used.
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CLOCK_GETTIME_LINK = @CLOCK_GETTIME_LINK@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
LTLIBOBJS
LIBOBJS
BUILD_SUBDIRS
+CLOCK_GETTIME_LINK
GPROFNG_LIBDIR
GPROFNG_CPPFLAGS
GPROFNG_CFLAGS
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12139 "configure"
+#line 12140 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12245 "configure"
+#line 12246 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
done
+clock_gettime_link=
+# At least for glibc, clock_gettime is in librt. But don't
+# pull that in if it still doesn't give us the function we want. This
+# test is copied from libgomp, and modified to not link in -lrt as
+# we're using this for test timing only.
+if test "$ac_cv_func_clock_gettime" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_clock_gettime=yes
+else
+ ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+ CLOCK_GETTIME_LINK=-lrt
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+fi
+
+fi
+
+
ac_config_files="$ac_config_files Makefile src/Makefile gp-display-html/Makefile doc/Makefile"
AC_CHECK_DECLS([basename])
AC_CHECK_FUNCS(clock_gettime strsignal)
+clock_gettime_link=
+# At least for glibc, clock_gettime is in librt. But don't
+# pull that in if it still doesn't give us the function we want. This
+# test is copied from libgomp, and modified to not link in -lrt as
+# we're using this for test timing only.
+if test "$ac_cv_func_clock_gettime" = no; then
+ AC_CHECK_LIB(rt, clock_gettime,
+ [CLOCK_GETTIME_LINK=-lrt
+ AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
+ [Define to 1 if you have the `clock_gettime' function.])])
+fi
+AC_SUBST(CLOCK_GETTIME_LINK)
+
AC_SUBST(BUILD_SUBDIRS)
AC_CONFIG_FILES([Makefile src/Makefile gp-display-html/Makefile doc/Makefile])
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CLOCK_GETTIME_LINK = @CLOCK_GETTIME_LINK@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CLOCK_GETTIME_LINK = @CLOCK_GETTIME_LINK@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
}
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(myincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libgp_collector_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+libgp_collector_la_DEPENDENCIES =
am__objects_1 = libgp_collector_la-gethrtime.lo \
libgp_collector_la-dispatcher.lo libgp_collector_la-iolib.lo \
libgp_collector_la-mmaptrace.lo libgp_collector_la-memmgr.lo \
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CLOCK_GETTIME_LINK = @CLOCK_GETTIME_LINK@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
-CLOCK_GETTIME_LINK
GPROFNG_NO_NONNULL_COMPARE_CFLAGS
GPROFNG_VARIANT
CXXCPP
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12062 "configure"
+#line 12061 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12168 "configure"
+#line 12167 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-clock_gettime_link=
-# At least for glibc, clock_gettime is in librt. But don't
-# pull that in if it still doesn't give us the function we want. This
-# test is copied from libgomp, and modified to not link in -lrt as
-# we're using this for test timing only.
-if test "$ac_cv_func_clock_gettime" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrt $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char clock_gettime ();
-int
-main ()
-{
-return clock_gettime ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_rt_clock_gettime=yes
-else
- ac_cv_lib_rt_clock_gettime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
- CLOCK_GETTIME_LINK=-lrt
-
-$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
-
-fi
-
-fi
-
-
ac_config_files="$ac_config_files Makefile"
ac_config_headers="$ac_config_headers lib-config.h:../common/config.h.in"
ACX_PROG_CC_WARNING_OPTS([-Wno-nonnull-compare], [GPROFNG_NO_NONNULL_COMPARE_CFLAGS])
AC_SUBST(GPROFNG_NO_NONNULL_COMPARE_CFLAGS)
-clock_gettime_link=
-# At least for glibc, clock_gettime is in librt. But don't
-# pull that in if it still doesn't give us the function we want. This
-# test is copied from libgomp, and modified to not link in -lrt as
-# we're using this for test timing only.
-if test "$ac_cv_func_clock_gettime" = no; then
- AC_CHECK_LIB(rt, clock_gettime,
- [CLOCK_GETTIME_LINK=-lrt
- AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
- [Define to 1 if you have the `clock_gettime' function.])])
-fi
-AC_SUBST(CLOCK_GETTIME_LINK)
-
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([lib-config.h:../common/config.h.in])
AC_OUTPUT
bin_PROGRAMS = gp-archive gp-collect-app gprofng gp-display-text gp-display-src
gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
-gp_archive_LDADD = $(LIBGPROFNG)
+gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
-gp_collect_app_LDADD = $(LIBGPROFNG)
+gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gprofng_SOURCES = gprofng.cc
-gprofng_LDADD = $(LIBGPROFNG)
+gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gp_display_src_SOURCES = gp-display-src.cc
-gp_display_src_LDADD = $(LIBGPROFNG)
+gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
-gp_display_text_LDADD = $(LIBGPROFNG)
+gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
if BUILD_MAN
PROGRAMS = $(bin_PROGRAMS)
am_gp_archive_OBJECTS = gp-archive.$(OBJEXT) ArchiveExp.$(OBJEXT)
gp_archive_OBJECTS = $(am_gp_archive_OBJECTS)
-gp_archive_DEPENDENCIES = $(LIBGPROFNG)
+gp_archive_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
am_gp_collect_app_OBJECTS = gp-collect-app.$(OBJEXT) checks.$(OBJEXT) \
envsets.$(OBJEXT) count.$(OBJEXT)
gp_collect_app_OBJECTS = $(am_gp_collect_app_OBJECTS)
-gp_collect_app_DEPENDENCIES = $(LIBGPROFNG)
+gp_collect_app_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
am_gp_display_src_OBJECTS = gp-display-src.$(OBJEXT)
gp_display_src_OBJECTS = $(am_gp_display_src_OBJECTS)
-gp_display_src_DEPENDENCIES = $(LIBGPROFNG)
+gp_display_src_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
am_gp_display_text_OBJECTS = gp-display-text.$(OBJEXT) ipc.$(OBJEXT) \
ipcio.$(OBJEXT)
gp_display_text_OBJECTS = $(am_gp_display_text_OBJECTS)
-gp_display_text_DEPENDENCIES = $(LIBGPROFNG)
+gp_display_text_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
am_gprofng_OBJECTS = gprofng.$(OBJEXT)
gprofng_OBJECTS = $(am_gprofng_OBJECTS)
-gprofng_DEPENDENCIES = $(LIBGPROFNG)
+gprofng_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CLOCK_GETTIME_LINK = @CLOCK_GETTIME_LINK@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
dbedir = $(prefix)/etc
dbe_DATA = $(srcdir)/gprofng.rc
gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
-gp_archive_LDADD = $(LIBGPROFNG)
+gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
-gp_collect_app_LDADD = $(LIBGPROFNG)
+gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gprofng_SOURCES = gprofng.cc
-gprofng_LDADD = $(LIBGPROFNG)
+gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gp_display_src_SOURCES = gp-display-src.cc
-gp_display_src_LDADD = $(LIBGPROFNG)
+gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
-gp_display_text_LDADD = $(LIBGPROFNG)
+gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
# The man pages depend on the version number and on a help2man include file.
@BUILD_MAN_TRUE@common_mandeps = $(top_srcdir)/../bfd/version.m4
* There is no issue on Solaris, where gethrtime() is provided by the kernel
* and used by DTrace.
*/
+#ifdef CLOCK_MONOTONIC_RAW
int r = clock_gettime (CLOCK_MONOTONIC_RAW, &tp);
+#else
+ int r = clock_gettime (CLOCK_MONOTONIC, &tp);
+#endif
if (r == 0)
rc = ((hrtime_t) tp.tv_sec) * 1000000000 + (hrtime_t) tp.tv_nsec;
return rc;
{
struct timespec tp;
hrtime_t rc = 0;
+#ifdef CLOCK_MONOTONIC_RAW
+ int r = clock_gettime (CLOCK_MONOTONIC_RAW, &tp);
+#else
int r = clock_gettime (CLOCK_MONOTONIC, &tp);
+#endif
+
if (r == 0)
rc = ((hrtime_t) tp.tv_sec) * 1000000000 + (hrtime_t) tp.tv_nsec;
return rc;