[svn:parrot] r42161 - in trunk/config: gen/platform/generic init init/hints

darbelo at svn.parrot.org darbelo at svn.parrot.org
Thu Oct 29 01:51:10 UTC 2009


Author: darbelo
Date: Thu Oct 29 01:51:08 2009
New Revision: 42161
URL: https://trac.parrot.org/parrot/changeset/42161

Log:
Make CLOCK_BEST selection in hires_timer.c check if the desired clockid is #defined. 
This selection can still be overridden via the hints files, but the ordering of the options has rendered it unnecessary on most platforms.
This should fix the Solaris 8 problems on TT#985 while still providing correct clockid selection in later solaris versions.

Modified:
   trunk/config/gen/platform/generic/hires_timer.c
   trunk/config/init/defaults.pm
   trunk/config/init/hints/linux.pm
   trunk/config/init/hints/solaris.pm

Modified: trunk/config/gen/platform/generic/hires_timer.c
==============================================================================
--- trunk/config/gen/platform/generic/hires_timer.c	Thu Oct 29 01:32:40 2009	(r42160)
+++ trunk/config/gen/platform/generic/hires_timer.c	Thu Oct 29 01:51:08 2009	(r42161)
@@ -30,6 +30,16 @@
 
 #define TIME_IN_NS(n) ((n).tv_sec * 1000*1000*1000 + (n).tv_nsec)
 
+#ifndef CLOCK_BEST
+#  if defined(CLOCK_PROCESS_CPUTIME_ID)
+#    define CLOCK_BEST CLOCK_PROCESS_CPUTIME_ID
+#  elif defined(CLOCK_PROF)
+#    define CLOCK_BEST CLOCK_PROF
+#  else
+#    define CLOCK_BEST CLOCK_REALTIME
+#  endif
+#endif
+
 /*
 
 =item C<UHUGEINTVAL Parrot_hires_get_time(void)>

Modified: trunk/config/init/defaults.pm
==============================================================================
--- trunk/config/init/defaults.pm	Thu Oct 29 01:32:40 2009	(r42160)
+++ trunk/config/init/defaults.pm	Thu Oct 29 01:51:08 2009	(r42161)
@@ -257,9 +257,6 @@
         );
     }
 
-    #clock_id used to call the clock_gettime() in the profiling runcore.
-    $conf->data->set( clock_best => '-DCLOCK_BEST=CLOCK_PROF' );
-
     $conf->data->set( 'archname', $Config{archname});
     # adjust archname, cc and libs for e.g. --m=32
     # RT#41499 this is maybe gcc only

Modified: trunk/config/init/hints/linux.pm
==============================================================================
--- trunk/config/init/hints/linux.pm	Thu Oct 29 01:32:40 2009	(r42160)
+++ trunk/config/init/hints/linux.pm	Thu Oct 29 01:51:08 2009	(r42161)
@@ -152,8 +152,6 @@
         libparrot_soname       => "-Wl,-soname=libparrot$share_ext.$version",
     );
 
-    $conf->data->set( clock_best => '-DCLOCK_BEST=CLOCK_PROCESS_CPUTIME_ID' );
-
      if ( ( split( m/-/, $conf->data->get_p5('archname'), 2 ) )[0] eq 'ia64' ) {
 
         $conf->data->set( platform_asm => 1 );

Modified: trunk/config/init/hints/solaris.pm
==============================================================================
--- trunk/config/init/hints/solaris.pm	Thu Oct 29 01:32:40 2009	(r42160)
+++ trunk/config/init/hints/solaris.pm	Thu Oct 29 01:51:08 2009	(r42161)
@@ -17,7 +17,6 @@
         $libs .= ' -lrt';    # Needed for sched_yield.
     }
     $conf->data->set( libs => $libs );
-    $conf->data->set( clock_best => '-DCLOCK_BEST=CLOCK_PROCESS_CPUTIME_ID' );
 
     ################################################################
     # If we're going to be using ICU (or any other C++-compiled library) we


More information about the parrot-commits mailing list