From 3c5ba9aed06cad54f9bc06c77d359fbfb83d2fb9 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Tue, 23 Nov 2010 22:23:33 +0000 Subject: Add a -t switch for varying the benchmark run time. I'll work on submitting this upstream. --- benchmarks/ubench/files/patch-timeout-cpubench.c | 45 ++++++++++++++ benchmarks/ubench/files/patch-timeout-diskbench.c | 45 ++++++++++++++ benchmarks/ubench/files/patch-timeout-membench.c | 45 ++++++++++++++ benchmarks/ubench/files/patch-timeout-netbench.c | 11 ++++ benchmarks/ubench/files/patch-timeout-ubench.c | 73 +++++++++++++++++++++++ 5 files changed, 219 insertions(+) create mode 100644 benchmarks/ubench/files/patch-timeout-cpubench.c create mode 100644 benchmarks/ubench/files/patch-timeout-diskbench.c create mode 100644 benchmarks/ubench/files/patch-timeout-membench.c create mode 100644 benchmarks/ubench/files/patch-timeout-netbench.c create mode 100644 benchmarks/ubench/files/patch-timeout-ubench.c (limited to 'benchmarks') diff --git a/benchmarks/ubench/files/patch-timeout-cpubench.c b/benchmarks/ubench/files/patch-timeout-cpubench.c new file mode 100644 index 000000000000..88ad0dfbfca4 --- /dev/null +++ b/benchmarks/ubench/files/patch-timeout-cpubench.c @@ -0,0 +1,45 @@ +--- cpubench.c.orig 2000-05-28 20:21:13.000000000 -0700 ++++ cpubench.c 2010-11-23 14:20:52.000000000 -0800 +@@ -114,7 +114,7 @@ + return i; + } + /*****************************************************************************/ +-int cpubench() ++int cpubench(int cpubench_time) + { + int sv[2],i; + int d=0; +@@ -126,7 +126,7 @@ + return 0; + } + cpu_score=0; +- alarm(CPUBENCH_TIME); ++ alarm(cpubench_time); + switch ( (i=sigsetjmp(env,0xffff)) ) + { + case 0: +@@ -136,7 +136,7 @@ + if ( child ) exit(0); + child_number=0; + close(sv[0]); +- dlt=(double )cpu_score*(double )itim; ++ dlt=(double )cpu_score * CPUBENCH_TIME * (double )itim / cpubench_time; + dlt=dlt/(double )CPUREFSCORE; + cpu_score=dlt; + fprintf(stdout,"Ubench CPU: %8d\n",cpu_score); +@@ -152,13 +152,13 @@ + itim=cpucalibrate(CPUREFTIME); + if ( ONEflag ) + { +- dlt=itim*(double )CPUBENCH_TIME/(double )CPUREFTIME/(double )CPUREFSCORE; ++ dlt=itim*(double )cpubench_time/(double )CPUREFTIME/(double )CPUREFSCORE; + cpu_score=dlt; + fprintf(stdout,"Ubench Single CPU: %8d (%.2fs)\n", + cpu_score,cpuload(itim)); + return cpu_score; + } +- alarm(CPUBENCH_TIME); ++ alarm(cpubench_time); + child_pid[child_number]=fork(); + if ( child_pid[child_number] == -1 ) + { diff --git a/benchmarks/ubench/files/patch-timeout-diskbench.c b/benchmarks/ubench/files/patch-timeout-diskbench.c new file mode 100644 index 000000000000..c8957bbb5b75 --- /dev/null +++ b/benchmarks/ubench/files/patch-timeout-diskbench.c @@ -0,0 +1,45 @@ +--- diskbench.c.orig 2000-07-31 10:24:10.000000000 -0700 ++++ diskbench.c 2010-11-23 14:20:52.000000000 -0800 +@@ -103,7 +103,7 @@ + return i; + } + /*****************************************************************************/ +-int diskbench() ++int diskbench(int diskbench_time) + { + int sv[2],i; + int d=0; +@@ -115,7 +115,7 @@ + return 0; + } + cpu_score=0; +- alarm(DISKBENCH_TIME); ++ alarm(diskbench_time); + switch ( (i=sigsetjmp(env,0xffff)) ) + { + case 0: +@@ -124,7 +124,7 @@ + for (i=0;i