This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-622-gbb7cf68


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  bb7cf681e90d5aa2d867aeff4948ac605447de7d (commit)
      from  ba8539473296645ef5e710e506534682f9eb5572 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bb7cf681e90d5aa2d867aeff4948ac605447de7d

commit bb7cf681e90d5aa2d867aeff4948ac605447de7d
Author: Ondrej Bilka <neleai@seznam.cz>
Date:   Wed May 8 08:21:05 2013 +0200

    Preheat CPU in benchtests.
    
    A benchmark could be skewed by CPU initialy working on minimal
    frequency and speeding up later. We first run code in loop
    to partialy fix this issue.

diff --git a/ChangeLog b/ChangeLog
index fa12634..c681271 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-08  OndÅ?ej Bílka  <neleai@seznam.cz>
+
+	* benchtests/bench-skeleton.c (main): Preheat CPU.
+
 2013-05-07  Aurelien Jarno <aurelien@aurel32.net>
 
 	* misc/sys/param.h (DEV_BSIZE): Define only if not already defined.
diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index 7359184..a13ad02 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -22,6 +22,21 @@
 #include <time.h>
 #include <inttypes.h>
 
+volatile unsigned int dontoptimize = 0;
+void startup ()
+{
+  /* This loop should cause CPU to switch to maximal freqency.
+     This makes subsequent measurement more accurate.  We need a side effect
+     to prevent the loop being deleted by compiler.
+     This should be enough to cause CPU to speed up and it is simpler than
+     running loop for constant time. This is used when user does not have root
+     access to set a constant freqency.  */
+
+  int k;
+  for (k = 0; k < 10000000; k++)
+    dontoptimize += 23 * dontoptimize + 2;
+}
+
 #define TIMESPEC_AFTER(a, b) \
   (((a).tv_sec == (b).tv_sec) ?						      \
      ((a).tv_nsec > (b).tv_nsec) :					      \
@@ -32,6 +47,8 @@ main (int argc, char **argv)
   unsigned long i, k;
   struct timespec start, end, runtime;
 
+  startup();
+
   memset (&runtime, 0, sizeof (runtime));
   memset (&start, 0, sizeof (start));
   memset (&end, 0, sizeof (end));

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |    4 ++++
 benchtests/bench-skeleton.c |   17 +++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]