Bug 799638 - Export profiler markers when saving profiler profiles. r=ehsan
☠☠ backed out by dfbaea0d50d1 ☠ ☠
authorBenoit Girard <b56girard@gmail.com>
Sat, 13 Oct 2012 21:03:22 -0400
changeset 118146 a57ade621efb04143daaa21c148cf4fd58605fe7
parent 118145 2a8fef2bd2285e5b8f41f8f53770c951bc2a78af
child 118147 dfbaea0d50d1e032f9d879d0d03f6998087683b1
push id1997
push userakeybl@mozilla.com
push dateMon, 07 Jan 2013 21:25:26 +0000
treeherdermozilla-beta@4baf45cdcf21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs799638
milestone19.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 799638 - Export profiler markers when saving profiler profiles. r=ehsan
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -285,16 +285,17 @@ public:
     JSObjectBuilder b(aCx);
 
     JSObject *profile = b.CreateObject();
     JSObject *samples = b.CreateArray();
     b.DefineProperty(profile, "samples", samples);
 
     JSObject *sample = NULL;
     JSObject *frames = NULL;
+    JSObject *marker = NULL;
 
     int readPos = mReadPos;
     while (readPos != mLastFlushPos) {
       // Number of tag consumed
       int incBy = 1;
       ProfileEntry entry = mEntries[readPos];
 
       // Read ahead to the next tag, if it's a 'd' tag process it now
@@ -310,16 +311,29 @@ public:
 
       switch (entry.mTagName) {
         case 's':
           sample = b.CreateObject();
           b.DefineProperty(sample, "name", tagStringData);
           frames = b.CreateArray();
           b.DefineProperty(sample, "frames", frames);
           b.ArrayPush(samples, sample);
+          // Created lazily
+          marker = NULL;
+          break;
+        case 'm':
+          {
+            if (sample) {
+              if (!marker) {
+                marker = b.CreateArray();
+                b.DefineProperty(sample, "marker", marker);
+              }
+              b.ArrayPush(marker, tagStringData);
+            }
+          }
           break;
         case 'r':
           {
             if (sample) {
               b.DefineProperty(sample, "responsiveness", entry.mTagFloat);
             }
           }
           break;