Bug 805841 - test_pm.xul fails on EC2 VM because it can't measure CPU data. r=zwol
authorJoel Maher <jmaher@mozilla.com>
Tue, 12 Feb 2013 07:28:35 -0500
changeset 121629 d2175a963653c49d8331531c9586a84215f6c7f0
parent 121628 f67abd9e378aed3b4c9dd0783e66f85ea2cf2f70
child 121630 cccb528b3584316278b40dbb3da30c051e36b7ed
push id24301
push userryanvm@gmail.com
push dateWed, 13 Feb 2013 02:25:44 +0000
treeherdermozilla-central@84cb7aa96a52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszwol
bugs805841
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 805841 - test_pm.xul fails on EC2 VM because it can't measure CPU data. r=zwol
toolkit/components/perf/test_pm.xul
--- a/toolkit/components/perf/test_pm.xul
+++ b/toolkit/components/perf/test_pm.xul
@@ -17,33 +17,28 @@ function test()
 {
   SimpleTest.waitForExplicitFinish();
 
   Components.utils.import("resource://gre/modules/PerfMeasurement.jsm");
   let pm = new PerfMeasurement(PerfMeasurement.ALL);
   if (pm.eventsMeasured == 0) {
     todo(false, "stub, skipping test");
   } else {
-    is(pm.eventsMeasured, PerfMeasurement.ALL, "all events measurable");
-
     pm.start();
     for (let i = 0; i < 10000; i++) ;
       pm.stop();
 
-    isnot(pm.cpu_cycles, -1, "cpu_cycles");
-    isnot(pm.instructions, -1, "instructions");
-    isnot(pm.cache_references, -1, "cache_references");
-    isnot(pm.cache_misses, -1, "cache_misses");
-    isnot(pm.branch_instructions, -1, "branch_instructions");
-    isnot(pm.branch_misses, -1, "branch_misses");
-    isnot(pm.bus_cycles, -1, "bus_cycles");
-    isnot(pm.page_faults, -1, "page_faults");
-    isnot(pm.major_page_faults, -1, "major_page_faults");
-    isnot(pm.context_switches, -1, "context_switches");
-    isnot(pm.cpu_migrations, -1, "cpu_migrations");
+    events = ["cpu_cycles", "instructions", "cache_references", "cache_misses",
+              "branch_instructions", "branch_misses", "bus_cycles", "page_faults",
+              "major_page_faults", "context_switches", "cpu_migrations"];
+
+    for (var i = 0; i < events.length; i++) {
+        var e = events[i];
+        ((pm.eventsMeasured & PerfMeasurement[e.toUpperCase()]) ? isnot : todo_is)(pm[e], -1, e);
+    }
   }
   SimpleTest.finish();
 }
 ]]></script>
 
   <body xmlns="http://www.w3.org/1999/xhtml">
     <p id="display"></p>
     <div id="content" style="display:none;"></div>