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 110343 a57ade621efb04143daaa21c148cf4fd58605fe7
parent 110342 2a8fef2bd2285e5b8f41f8f53770c951bc2a78af
child 110344 dfbaea0d50d1e032f9d879d0d03f6998087683b1
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs799638
milestone19.0a1
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;