aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-03-18 15:45:34 +0000
committerNick Clifton <nickc@redhat.com>2022-03-18 15:46:33 +0000
commit0a30596cfad9cd221a81eea984b6fe3fabb20b95 (patch)
treeb688d33f46d2507a16dc89d7f057cba01618c355 /gprofng/src
parentf0cf07f341f565978228c9a2cfa73d2a9f3001c3 (diff)
downloadgdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.zip
gdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.tar.gz
gdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.tar.bz2
Fix Build issues due to patch "gprofng: a new GNU profiler"
Find and fix more places where clock_gettime() and CLOCK_MONOTONIC_RAW are used.
Diffstat (limited to 'gprofng/src')
-rw-r--r--gprofng/src/Makefile.am10
-rw-r--r--gprofng/src/Makefile.in21
-rw-r--r--gprofng/src/gethrtime.c4
3 files changed, 20 insertions, 15 deletions
diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
index 84fd1df..fdd95f5 100644
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -133,19 +133,19 @@ dbe_DATA = $(srcdir)/gprofng.rc
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
diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
index 19b5960..3659ca0 100644
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -193,21 +193,21 @@ libgprofng_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
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
@@ -309,6 +309,7 @@ BUILD_SUBDIRS = @BUILD_SUBDIRS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CLOCK_GETTIME_LINK = @CLOCK_GETTIME_LINK@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
@@ -548,15 +549,15 @@ libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \
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
diff --git a/gprofng/src/gethrtime.c b/gprofng/src/gethrtime.c
index 8ba7295..9e17f1e 100644
--- a/gprofng/src/gethrtime.c
+++ b/gprofng/src/gethrtime.c
@@ -159,7 +159,11 @@ gethrtime (void)
* 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;