[1/3] Cleanup hp-timing defines

Message ID DB5PR08MB1030D94CF1FE225CA7F0745683810@DB5PR08MB1030.eurprd08.prod.outlook.com
State Superseded
Headers

Commit Message

Wilco Dijkstra Jan. 15, 2019, 2:02 p.m. UTC
  Cleanup the defines in the hp-timing header: Replace HP_TIMING_AVAIL
with HP_TIMING_INLINE since these are equivalent.  Remove conflicting
uses of HP_SMALL_TIMING_AVAIL and HP_TIMING_NONAVAIL.  Reserve
HP_TIMING_NONAVAIL only for rtld internal timing. No functional changes
(apart from not using rtld timing on alpha).

OK for commit?

ChangeLog:
2019-01-15  Wilco Dijkstra  <wdijkstr@arm.com>

	* elf/dl-support.c: Use HP_TIMING_INLINE.
	* elf/rtld.c (HP_TIMING_NONAVAIL): Define.
	(_dl_start_final): Cleanup timing.
	(_dl_start): Add HP_TIMING_NONAVAIL around timing code.
	* nptl/allocatestack.c: Use HP_TIMING_INLINE.	
	* nptl/descr.h: Likewise.
	* nptl/nptl-init.c: Likewise.
	* nptl/pthread_clock_gettime.c: Likewise.
	* nptl/pthread_clock_settime.c: Likewise.
	* nptl/pthread_create.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Likewise.
	* sysdeps/mach/hurd/dl-sysdep.c: Likewise.
	* sysdeps/nptl/fork.c: Likewise.
	* sysdeps/posix/clock_getres.c: Likewise.
	* sysdeps/unix/clock_gettime.c: Likewise.
	* sysdeps/unix/clock_nanosleep.c: Likewise.
	* sysdeps/unix/clock_settime.c: Likewise.
	* sysdeps/unix/sysv/linux/sysconf.c: Likewise.

--
  

Comments

Tulio Magno Quites Machado Filho Jan. 21, 2019, 7:23 p.m. UTC | #1
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:

> Cleanup the defines in the hp-timing header: Replace HP_TIMING_AVAIL
> with HP_TIMING_INLINE since these are equivalent.  Remove conflicting
> uses of HP_SMALL_TIMING_AVAIL and HP_TIMING_NONAVAIL.  Reserve
> HP_TIMING_NONAVAIL only for rtld internal timing. No functional changes
> (apart from not using rtld timing on alpha).
>
> OK for commit?

I can't apply this patch on master:

$ git am patches/testing/hp-timing-cleanup.mbox
Applying: Cleanup hp-timing defines
error: patch failed: sysdeps/posix/clock_getres.c:87
error: sysdeps/posix/clock_getres.c: patch does not apply
error: patch failed: sysdeps/unix/clock_gettime.c:105
error: sysdeps/unix/clock_gettime.c: patch does not apply
error: patch failed: sysdeps/unix/clock_settime.c:21
error: sysdeps/unix/clock_settime.c: patch does not apply
Patch failed at 0001 Cleanup hp-timing defines

> diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
> index dac4761fcc2c86cb0d53425cab4e88d587696540..9365e0edaf5601f5d1e039203977f0d965ac7d28 100644
> --- a/sysdeps/posix/clock_getres.c
> +++ b/sysdeps/posix/clock_getres.c
> @@ -87,7 +87,7 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
>        break;
>  
>      default:
> -#if HP_TIMING_AVAIL
> +#if HP_TIMING_INLINE

The patch doesn't apply because current master has the following code here:
#ifdef SYSDEP_GETRES_CPU
      SYSDEP_GETRES_CPU;
#endif
  
Tulio Magno Quites Machado Filho Jan. 21, 2019, 7:38 p.m. UTC | #2
Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> writes:

> Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:
>
>> Cleanup the defines in the hp-timing header: Replace HP_TIMING_AVAIL
>> with HP_TIMING_INLINE since these are equivalent.  Remove conflicting
>> uses of HP_SMALL_TIMING_AVAIL and HP_TIMING_NONAVAIL.  Reserve
>> HP_TIMING_NONAVAIL only for rtld internal timing. No functional changes
>> (apart from not using rtld timing on alpha).
>>
>> OK for commit?
>
> I can't apply this patch on master:

I've just found out this patch series depends on:
https://www.sourceware.org/ml/libc-alpha/2019-01/msg00290.html
  
Tulio Magno Quites Machado Filho Jan. 21, 2019, 8:12 p.m. UTC | #3
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:

> Cleanup the defines in the hp-timing header: Replace HP_TIMING_AVAIL
> with HP_TIMING_INLINE since these are equivalent.  Remove conflicting
> uses of HP_SMALL_TIMING_AVAIL and HP_TIMING_NONAVAIL.  Reserve
> HP_TIMING_NONAVAIL only for rtld internal timing. No functional changes
> (apart from not using rtld timing on alpha).
>
> OK for commit?

After applying the 4 patches (3 from this patch series and another from 01/14),
I get a build failure because of:
elf/rtld.c:2717:  if (HP_SMALL_TIMING_AVAIL)
elf/rtld.c:2785:  if (HP_SMALL_TIMING_AVAIL)

Am I missing another patch?  :-D
  
Wilco Dijkstra Jan. 21, 2019, 9:17 p.m. UTC | #4
Hi Tulio,

> After applying the 4 patches (3 from this patch series and another from 01/14),
> I get a build failure because of:
> elf/rtld.c:2717:  if (HP_SMALL_TIMING_AVAIL)
> elf/rtld.c:2785:  if (HP_SMALL_TIMING_AVAIL)
> 
> Am I missing another patch?  :-D

Oops... It looks like when I split the big patch into smaller parts, it added that
define back. Basically that define is treated as always true now, so the if
can be removed. I'll respin.

Wilco
  

Patch

diff --git a/elf/dl-support.c b/elf/dl-support.c
index 42c350c75d89ebdac1d6ec4bb50c2e0897e2fd87..b1290361a9f08973a16c020168c49bb99d6bb8d1 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -130,7 +130,7 @@  void *_dl_random;
 #include <dl-procinfo.c>
 
 /* Initial value of the CPU clock.  */
-#ifndef HP_TIMING_NONAVAIL
+#if HP_TIMING_INLINE
 hp_timing_t _dl_cpuclock_offset;
 #endif
 
@@ -314,8 +314,9 @@  _dl_non_dynamic_init (void)
   _dl_main_map.l_phdr = GL(dl_phdr);
   _dl_main_map.l_phnum = GL(dl_phnum);
 
-  if (HP_SMALL_TIMING_AVAIL)
-    HP_TIMING_NOW (_dl_cpuclock_offset);
+#if HP_TIMING_INLINE
+  HP_TIMING_NOW (_dl_cpuclock_offset);
+#endif
 
   _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
 
diff --git a/elf/rtld.c b/elf/rtld.c
index 5d97f41b7bccb61592e7fb84521f869475587734..77cfd00e7e804fabe73f98529c9dc597c67cba69 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -46,6 +46,10 @@ 
 
 #include <assert.h>
 
+#if !HP_TIMING_INLINE
+# define HP_TIMING_NONAVAIL 1
+#endif
+
 /* Avoid PLT use for our local calls at startup.  */
 extern __typeof (__mempcpy) __mempcpy attribute_hidden;
 
@@ -335,7 +339,7 @@  static ElfW(Addr) _dl_start_final (void *arg);
 struct dl_start_final_info
 {
   struct link_map l;
-#if !defined HP_TIMING_NONAVAIL && HP_TIMING_INLINE
+#ifndef HP_TIMING_NONAVAIL
   hp_timing_t start_time;
 #endif
 };
@@ -371,16 +375,9 @@  _dl_start_final (void *arg, struct dl_start_final_info *info)
 {
   ElfW(Addr) start_addr;
 
-  if (HP_SMALL_TIMING_AVAIL)
-    {
-      /* If it hasn't happen yet record the startup time.  */
-      if (! HP_TIMING_INLINE)
-	HP_TIMING_NOW (start_time);
 #if !defined DONT_USE_BOOTSTRAP_MAP && !defined HP_TIMING_NONAVAIL
-      else
-	start_time = info->start_time;
+  start_time = info->start_time;
 #endif
-    }
 
   /* Transfer data about ourselves to the permanent link_map structure.  */
 #ifndef DONT_USE_BOOTSTRAP_MAP
@@ -403,7 +400,9 @@  _dl_start_final (void *arg, struct dl_start_final_info *info)
 # endif
 #endif
 
+#if HP_TIMING_INLINE
   HP_TIMING_NOW (GL(dl_cpuclock_offset));
+#endif
 
   /* Initialize the stack end variable.  */
   __libc_stack_end = __builtin_frame_address (0);
@@ -416,16 +415,13 @@  _dl_start_final (void *arg, struct dl_start_final_info *info)
 
 #ifndef HP_TIMING_NONAVAIL
   hp_timing_t rtld_total_time;
-  if (HP_SMALL_TIMING_AVAIL)
-    {
-      hp_timing_t end_time;
+  hp_timing_t end_time;
 
-      /* Get the current time.  */
-      HP_TIMING_NOW (end_time);
+  /* Get the current time.  */
+  HP_TIMING_NOW (end_time);
 
-      /* Compute the difference.  */
-      HP_TIMING_DIFF (rtld_total_time, start_time, end_time);
-    }
+  /* Compute the difference.  */
+  HP_TIMING_DIFF (rtld_total_time, start_time, end_time);
 #endif
 
   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS))
@@ -459,11 +455,12 @@  _dl_start (void *arg)
 #define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
 #include "dynamic-link.h"
 
-  if (HP_TIMING_INLINE && HP_SMALL_TIMING_AVAIL)
-#ifdef DONT_USE_BOOTSTRAP_MAP
+#ifndef HP_TIMING_NONAVAIL
+# ifdef DONT_USE_BOOTSTRAP_MAP
     HP_TIMING_NOW (start_time);
-#else
+# else
     HP_TIMING_NOW (info.start_time);
+# endif
 #endif
 
   /* Partly clean the `bootstrap_map' structure up.  Don't use
@@ -1050,12 +1047,16 @@  of this helper program; chances are you did not intend to run this program.\n\
 	}
       else
 	{
+#ifndef HP_TIMING_NONAVAIL
 	  HP_TIMING_NOW (start);
+#endif
 	  _dl_map_object (NULL, rtld_progname, lt_executable, 0,
 			  __RTLD_OPENEXEC, LM_ID_BASE);
+#ifndef HP_TIMING_NONAVAIL
 	  HP_TIMING_NOW (stop);
 
 	  HP_TIMING_DIFF (load_time, start, stop);
+#endif
 	}
 
       /* Now the map for the main executable is available.  */
@@ -1619,11 +1620,15 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 
   if (__glibc_unlikely (preloadlist != NULL))
     {
+#ifndef HP_TIMING_NONAVAIL
       HP_TIMING_NOW (start);
+#endif
       npreloads += handle_ld_preload (preloadlist, main_map);
+#ifndef HP_TIMING_NONAVAIL
       HP_TIMING_NOW (stop);
       HP_TIMING_DIFF (diff, start, stop);
       HP_TIMING_ACCUM_NT (load_time, diff);
+#endif
     }
 
   /* There usually is no ld.so.preload file, it should only be used
@@ -1682,9 +1687,9 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 	      problem = NULL;
 	      file[file_size - 1] = '\0';
 	    }
-
+#ifndef HP_TIMING_NONAVAIL
 	  HP_TIMING_NOW (start);
-
+#endif
 	  if (file != problem)
 	    {
 	      char *p;
@@ -1700,11 +1705,11 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 
 	      npreloads += do_preload (p, main_map, preload_file);
 	    }
-
+#ifndef HP_TIMING_NONAVAIL
 	  HP_TIMING_NOW (stop);
 	  HP_TIMING_DIFF (diff, start, stop);
 	  HP_TIMING_ACCUM_NT (load_time, diff);
-
+#endif
 	  /* We don't need the file anymore.  */
 	  __munmap (file, file_size);
 	}
@@ -1727,12 +1732,15 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
   /* Load all the libraries specified by DT_NEEDED entries.  If LD_PRELOAD
      specified some libraries to load, these are inserted before the actual
      dependencies in the executable's searchlist for symbol resolution.  */
+#ifndef HP_TIMING_NONAVAIL
   HP_TIMING_NOW (start);
+#endif
   _dl_map_object_deps (main_map, preloads, npreloads, mode == trace, 0);
+#ifndef HP_TIMING_NONAVAIL
   HP_TIMING_NOW (stop);
   HP_TIMING_DIFF (diff, start, stop);
   HP_TIMING_ACCUM_NT (load_time, diff);
-
+#endif
   /* Mark all objects as being in the global scope.  */
   for (i = main_map->l_searchlist.r_nlist; i > 0; )
     main_map->l_searchlist.r_list[--i]->l_global = 1;
@@ -2127,9 +2135,8 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 #ifndef HP_TIMING_NONAVAIL
 	  hp_timing_t start;
 	  hp_timing_t stop;
-#endif
-
 	  HP_TIMING_NOW (start);
+#endif
 	  assert (main_map->l_info [VALIDX (DT_GNU_CONFLICTSZ)] != NULL);
 	  conflict = (ElfW(Rela) *)
 	    main_map->l_info [ADDRIDX (DT_GNU_CONFLICT)]->d_un.d_ptr;
@@ -2137,8 +2144,10 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 	    ((char *) conflict
 	     + main_map->l_info [VALIDX (DT_GNU_CONFLICTSZ)]->d_un.d_val);
 	  _dl_resolve_conflicts (main_map, conflict, conflictend);
+#ifndef HP_TIMING_NONAVAIL
 	  HP_TIMING_NOW (stop);
 	  HP_TIMING_DIFF (relocate_time, start, stop);
+#endif
 	}
 
 
@@ -2169,12 +2178,12 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 #ifndef HP_TIMING_NONAVAIL
       hp_timing_t start;
       hp_timing_t stop;
+      HP_TIMING_NOW (start);
 #endif
 
       /* If we are profiling we also must do lazy reloaction.  */
       GLRO(dl_lazy) |= consider_profiling;
 
-      HP_TIMING_NOW (start);
       unsigned i = main_map->l_searchlist.r_nlist;
       while (i-- > 0)
 	{
@@ -2201,10 +2210,11 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 	  if (l->l_tls_blocksize != 0 && tls_init_tp_called)
 	    _dl_add_to_slotinfo (l);
 	}
+#ifndef HP_TIMING_NONAVAIL
       HP_TIMING_NOW (stop);
 
       HP_TIMING_DIFF (relocate_time, start, stop);
-
+#endif
       /* Now enable profiling if needed.  Like the previous call,
 	 this has to go here because the calls it makes should use the
 	 rtld versions of the functions (particularly calloc()), but it
@@ -2250,15 +2260,17 @@  ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
       hp_timing_t start;
       hp_timing_t stop;
       hp_timing_t add;
+      HP_TIMING_NOW (start);
 #endif
 
-      HP_TIMING_NOW (start);
       /* Mark the link map as not yet relocated again.  */
       GL(dl_rtld_map).l_relocated = 0;
       _dl_relocate_object (&GL(dl_rtld_map), main_map->l_scope, 0, 0);
+#ifndef HP_TIMING_NONAVAIL
       HP_TIMING_NOW (stop);
       HP_TIMING_DIFF (add, start, stop);
       HP_TIMING_ACCUM_NT (relocate_time, add);
+#endif
     }
 
   /* Do any necessary cleanups for the startup OS interface code.
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 670cb8ffe65c4ee93e65f79c036229362da03f55..318d08e9ea55e484561629570ca8e1b72506d428 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -962,7 +962,7 @@  __reclaim_stacks (void)
 }
 
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 # undef __find_thread_by_id
 /* Find a thread given the thread ID.  */
 attribute_hidden
diff --git a/nptl/descr.h b/nptl/descr.h
index 9c54cbc8f2bb0d7cb8ec62d21c70ddbab762a483..a114656d99239c0084b83986f756e233e8a7530f 100644
--- a/nptl/descr.h
+++ b/nptl/descr.h
@@ -342,7 +342,7 @@  struct pthread
   /* Lock for synchronizing setxid calls.  */
   unsigned int setxid_futex;
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
   /* Offset of the CPU clock at start thread start time.  */
   hp_timing_t cpuclock_offset;
 #endif
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index b5895fabf32026182434cb1d92e3f7a6431653ea..5e4527cc4dc91138568d7606f4f8e03850621ee5 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -276,7 +276,7 @@  __pthread_initialize_minimal_internal (void)
   THREAD_SETMEM (pd, user_stack, true);
   if (LLL_LOCK_INITIALIZER != 0)
     THREAD_SETMEM (pd, lock, LLL_LOCK_INITIALIZER);
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
   THREAD_SETMEM (pd, cpuclock_offset, GL(dl_cpuclock_offset));
 #endif
 
diff --git a/nptl/pthread_clock_gettime.c b/nptl/pthread_clock_gettime.c
index f1d9104b24a00d45d192011ea530360a522d3157..7d1008e21f4e541261fcc95c6dc004bb24efa33a 100644
--- a/nptl/pthread_clock_gettime.c
+++ b/nptl/pthread_clock_gettime.c
@@ -21,7 +21,7 @@ 
 #include "pthreadP.h"
 
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 int
 __pthread_clock_gettime (clockid_t clock_id, hp_timing_t freq,
 			 struct timespec *tp)
diff --git a/nptl/pthread_clock_settime.c b/nptl/pthread_clock_settime.c
index 0fe6482f7898d1976a78c6f4fc91996d87859f69..0fee8721d2c5771e4cc1964d5c0ed488720cbd35 100644
--- a/nptl/pthread_clock_settime.c
+++ b/nptl/pthread_clock_settime.c
@@ -21,7 +21,7 @@ 
 #include "pthreadP.h"
 
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 int
 __pthread_clock_settime (clockid_t clock_id, hp_timing_t offset)
 {
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 2bd2b10727812f277e51fa0b681a7b802f18516f..bb4b001ae901aa84e541b1a28b3539f19bfb4634 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -379,7 +379,7 @@  START_THREAD_DEFN
 {
   struct pthread *pd = START_THREAD_SELF;
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
   /* Remember the time when the thread was started.  */
   hp_timing_t now;
   HP_TIMING_NOW (now);
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 37cab6f06b29335f942d7e1a9d9af20daef36908..78658e2d4d35ea2d052d2107e2d0675b5e0b28f6 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -352,7 +352,7 @@  struct rtld_global
   /* The object to be initialized first.  */
   EXTERN struct link_map *_dl_initfirst;
 
-#if HP_SMALL_TIMING_AVAIL
+#if HP_TIMING_INLINE
   /* Start time on CPU clock.  */
   EXTERN hp_timing_t _dl_cpuclock_offset;
 #endif
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index a58338c9302d13baea014fa3cb3c63c3d0f1ae0e..ea55726151f75a33f02c738a51efe44135ae0353 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -62,7 +62,7 @@  int __libc_multiple_libcs = 0;	/* Defining this here avoids the inclusion
 void *__libc_stack_end = NULL;
 rtld_hidden_data_def(__libc_stack_end)
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 hp_timing_t _dl_cpuclock_offset;
 #endif
 
@@ -246,7 +246,7 @@  unfmh();			/* XXX */
   /* Initialize frequently used global variable.  */
   GLRO(dl_pagesize) = __getpagesize ();
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
   HP_TIMING_NOW (_dl_cpuclock_offset);
 #endif
 
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index bd68f18b459c1ffd25b2a66584dd741ab2061b18..839df1a9a929ea4a33963fd66a30429c4e9fa7aa 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -83,7 +83,7 @@  __libc_fork (void)
       if (__fork_generation_pointer != NULL)
 	*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
       /* The CPU clock of the thread and process have to be set to zero.  */
       hp_timing_t now;
       HP_TIMING_NOW (now);
diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
index dac4761fcc2c86cb0d53425cab4e88d587696540..9365e0edaf5601f5d1e039203977f0d965ac7d28 100644
--- a/sysdeps/posix/clock_getres.c
+++ b/sysdeps/posix/clock_getres.c
@@ -24,7 +24,7 @@ 
 #include <libc-internal.h>
 
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 static long int nsec;		/* Clock frequency of the processor.  */
 
 static int
@@ -87,7 +87,7 @@  __clock_getres (clockid_t clock_id, struct timespec *res)
       break;
 
     default:
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
       if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))
 	  == CLOCK_THREAD_CPUTIME_ID)
 	retval = hp_timing_getres (res);
@@ -96,7 +96,7 @@  __clock_getres (clockid_t clock_id, struct timespec *res)
 	__set_errno (EINVAL);
       break;
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
     case CLOCK_PROCESS_CPUTIME_ID:
     case CLOCK_THREAD_CPUTIME_ID:
       retval = hp_timing_getres (res);
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 33a1f3335c269eec2b4f01fb927e3836a191b5eb..c21a530d21eee81d2d36793431973c646904615c 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -24,7 +24,7 @@ 
 #include <ldsodefs.h>
 
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 /* Clock frequency of the processor.  We make it a 64-bit variable
    because some jokers are already playing with processors with more
    than 4GHz.  */
@@ -105,7 +105,7 @@  __clock_gettime (clockid_t clock_id, struct timespec *tp)
       break;
 
     default:
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
       if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))
 	  == CLOCK_THREAD_CPUTIME_ID)
 	retval = hp_timing_gettime (clock_id, tp);
@@ -114,7 +114,7 @@  __clock_gettime (clockid_t clock_id, struct timespec *tp)
 	__set_errno (EINVAL);
       break;
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
     case CLOCK_PROCESS_CPUTIME_ID:
       retval = hp_timing_gettime (clock_id, tp);
       break;
diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c
index 7722d1111c7908463cd0b71b2c5e53012dabfa86..9d7497272dc4efd0643df5d5cfc1c6b2dfd35086 100644
--- a/sysdeps/unix/clock_nanosleep.c
+++ b/sysdeps/unix/clock_nanosleep.c
@@ -22,7 +22,7 @@ 
 #include <hp-timing.h>
 #include <sysdep-cancel.h>
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 # define CPUCLOCK_P(clock) \
   ((clock) == CLOCK_PROCESS_CPUTIME_ID					      \
    || ((clock) & ((1 << CLOCK_IDFIELD_SIZE) - 1)) == CLOCK_THREAD_CPUTIME_ID)
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
index 24d73b048c1b891906dacdf0c199544b85d924d2..166bc5aadb8e09d3fdfbe3078aef8dbbcfb6eba2 100644
--- a/sysdeps/unix/clock_settime.c
+++ b/sysdeps/unix/clock_settime.c
@@ -21,7 +21,7 @@ 
 #include <ldsodefs.h>
 
 
-#if HP_TIMING_AVAIL
+#if HP_TIMING_INLINE
 /* Clock frequency of the processor.  We make it a 64-bit variable
    because some jokers are already playing with processors with more
    than 4GHz.  */
@@ -93,7 +93,7 @@  __clock_settime (clockid_t clock_id, const struct timespec *tp)
       break;
 
     default:
-# if HP_TIMING_AVAIL
+# if HP_TIMING_INLINE
       if (CPUCLOCK_WHICH (clock_id) == CLOCK_PROCESS_CPUTIME_ID
 	  || CPUCLOCK_WHICH (clock_id) == CLOCK_THREAD_CPUTIME_ID)
 	retval = hp_timing_settime (clock_id, tp);
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index 4b297ba35fccdb92a02f0071efbe9fe84dd8e0e5..320b5f64e45068cbc213d69abdfc9f14c6ad4de7 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -39,10 +39,10 @@  static long int posix_sysconf (int name);
 static long int
 has_cpuclock (int name)
 {
-# if defined __NR_clock_getres || HP_TIMING_AVAIL
+# if defined __NR_clock_getres || HP_TIMING_INLINE
   /* If we have HP_TIMING, we will fall back on that if the system
      call does not work, so we support it either way.  */
-#  if !HP_TIMING_AVAIL
+#  if !HP_TIMING_INLINE
   /* Check using the clock_getres system call.  */
   struct timespec ts;
   INTERNAL_SYSCALL_DECL (err);