Fix sustained performance CTS test failures.

Two problems:
1)  Dhrystone loop count is too low causing too much deviation in
performance across runs

2) It is possible that dhrystone instances can shuffle
between heterogeneous cores introducing performance variabilities.

Fix to the test is two fold:
1) Increase the number of loop iterations.
2) Pin Dhrystone instances on one of the clusters.

bug: 30711691
Change-Id: Ifc07d8c3999c38465a96d7105a05091888bda9b0

Signed-off-by: Christian Bejram <cbejram@google.com>
diff --git a/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java b/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java
index dcbcce1..d12f3db 100644
--- a/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java
+++ b/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java
@@ -60,9 +60,11 @@
     public class Dhrystone implements Runnable {
         private boolean modeEnabled;
         private long startTime;
-        private long loopCount = 3000000;
+        private long loopCount = 300000000;
+        private long cpumask = 1;
 
-        public Dhrystone(boolean enabled) {
+        public Dhrystone(boolean enabled, long cm) {
+            cpumask = cm;
             modeEnabled = enabled;
             startTime = System.currentTimeMillis();
         }
@@ -73,7 +75,8 @@
             try {
                 device.executeShellCommand("cd " + DHRYSTONE + " ; chmod 777 dhry");
                 while (true) {
-                    String result = device.executeShellCommand("echo " + loopCount + " | " + DHRYSTONE + "dhry");
+                    String result = device.executeShellCommand("echo " + loopCount
+                          + " | taskset -a " + cpumask + " " + DHRYSTONE + "dhry");
                     if (Math.abs(System.currentTimeMillis() - startTime) >= testDuration) {
                         break;
                     } else if (result.contains("Measured time too small")) {
@@ -191,7 +194,6 @@
         appResultsWithMode.clear();
         dhrystoneResultsWithoutMode.clear();
         dhrystoneResultsWithMode.clear();
-
         /*
          * Run the test without the mode.
          * Start the application and collect stats.
@@ -199,8 +201,8 @@
          */
         setUpEnvironment();
         device.executeShellCommand(START_COMMAND);
-        Thread dhrystone = new Thread(new Dhrystone(false));
-        Thread dhrystone1 = new Thread(new Dhrystone(false));
+        Thread dhrystone = new Thread(new Dhrystone(false, 1));
+        Thread dhrystone1 = new Thread(new Dhrystone(false, 2));
         dhrystone.start();
         dhrystone1.start();
         Thread.sleep(testDuration);
@@ -213,7 +215,6 @@
         dhrystoneResultsWithoutMode.add(0, dhryMin);
         dhrystoneResultsWithoutMode.add(1, dhryMax);
         dhrystoneResultsWithoutMode.add(2, diff);
-
         /*
          * Run the test with the mode.
          * Start the application and collect stats.
@@ -221,8 +222,8 @@
          */
         setUpEnvironment();
         device.executeShellCommand(START_COMMAND_MODE);
-        dhrystone = new Thread(new Dhrystone(true));
-        dhrystone1 = new Thread(new Dhrystone(true));
+        dhrystone = new Thread(new Dhrystone(true, 1));
+        dhrystone1 = new Thread(new Dhrystone(true, 2));
         dhrystone.start();
         dhrystone1.start();
         Thread.sleep(testDuration);