Bug 1497985: Allow for MergeStacks() not writing any stacks within a sample r=mstange
authorRandell Jesup <rjesup@jesup.org>
Mon, 15 Oct 2018 23:16:05 -0400
changeset 489671 ec837a14f8e8dff8056ee633c9a318073d25cda5
parent 489670 ff4002836b9b87c8bcf0db5023a2147b33d7ac67
child 489672 30eee1bc0e6ce185f19a99828bca515b722aec4d
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmstange
bugs1497985
milestone64.0a1
Bug 1497985: Allow for MergeStacks() not writing any stacks within a sample r=mstange
tools/profiler/core/ProfileBufferEntry.cpp
--- a/tools/profiler/core/ProfileBufferEntry.cpp
+++ b/tools/profiler/core/ProfileBufferEntry.cpp
@@ -1094,17 +1094,20 @@ ProfileBuffer::StreamSamplesToJSON(Splic
         e.Next();
 
       } else {
         break;
       }
     }
 
     if (numFrames == 0) {
-      ERROR_AND_CONTINUE("expected one or more frame entries");
+      // It is possible to have empty stacks if native stackwalking is
+      // disabled. Skip samples with empty stacks. (See Bug 1497985).
+      // Thus, don't use ERROR_AND_CONTINUE, but just continue.
+      continue;
     }
 
     sample.mStack = aUniqueStacks.GetOrAddStackIndex(stack);
 
     // Skip over the markers. We process them in StreamMarkersToJSON().
     while (e.Has()) {
       if (e.Get().IsMarker()) {
         e.Next();