WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit add023eb authored by Andreas Sewe's avatar Andreas Sewe
Browse files

Moved time-taking out of Callback into Benchmark. (A callback shouldn't be able to screw this up.)

parent a24b5766
......@@ -83,6 +83,7 @@ public class DelayCallback extends Callback {
super(args);
}
@Override
protected void start(String benchmark, boolean warmup) {
if (!warmup) {
if (sleepTimeVerbose)
......@@ -96,8 +97,9 @@ public class DelayCallback extends Callback {
super.start(benchmark,warmup);
}
public void stop(boolean warmup) {
super.stop(warmup);
@Override
public void stop(long duration, boolean warmup) {
super.stop(duration, warmup);
if (!warmup) {
try {
Thread.currentThread().sleep(sleepTime*1000);
......
......@@ -22,6 +22,7 @@ public class MMTkCallback extends Callback {
}
/* Immediately prior to start of the benchmark */
@Override
public void start(String benchmark) {
if (!isWarmup())
harness.harnessBegin();
......@@ -29,8 +30,9 @@ public class MMTkCallback extends Callback {
};
/* Immediately after the end of the benchmark */
public void stop() {
super.stop();
@Override
public void stop(long duration) {
super.stop(duration);
if (!isWarmup())
harness.harnessEnd();
}
......
......@@ -20,18 +20,21 @@ public class MyCallback extends Callback {
}
/* Immediately prior to start of the benchmark */
@Override
public void start(String benchmark) {
System.err.println("my hook starting " + (isWarmup() ? "warmup " : "") + benchmark);
super.start(benchmark);
};
/* Immediately after the end of the benchmark */
public void stop() {
super.stop();
@Override
public void stop(long duration) {
super.stop(duration);
System.err.println("my hook stopped " + (isWarmup() ? "warmup" : ""));
System.err.flush();
};
@Override
public void complete(String benchmark, boolean valid) {
super.complete(benchmark, valid);
System.err.println("my hook " + (valid ? "PASSED " : "FAILED ") + (isWarmup() ? "warmup " : "") + benchmark);
......
......@@ -174,6 +174,8 @@ public abstract class Benchmark {
callback.start(config.name);
final long start = System.currentTimeMillis();
startIteration();
try {
iterate(size);
......@@ -181,7 +183,9 @@ public abstract class Benchmark {
stopIteration();
}
callback.stop();
final long duration = System.currentTimeMillis() - start;
callback.stop(duration);
boolean valid = validate(size);
callback.complete(config.name, valid);
......
......@@ -41,11 +41,6 @@ public class Callback {
*/
protected long[] times;
/**
* The start time of the most recent benchmark run.
*/
protected long timer;
/**
*
*/
......@@ -163,19 +158,17 @@ public class Callback {
};
protected void start(String benchmark, boolean warmup) {
timer = System.currentTimeMillis();
System.err.print("===== DaCapo " + TestHarness.getBuildVersion() + " " + benchmark + " starting ");
System.err.println((warmup ? ("warmup " + (iterations + 1) + " ") : "") + "=====");
System.err.flush();
}
/* Stop the timer */
public void stop() {
stop(mode == Mode.WARMUP);
public void stop(long duration) {
stop(duration, mode == Mode.WARMUP);
}
public void stop(boolean warmup) {
elapsed = System.currentTimeMillis() - timer;
public void stop(long duration, boolean warmup) {
elapsed = duration;
}
/* Announce completion of the benchmark (pass or fail) */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment