Bug 1368915 (part 5) - Introduce MAX_JS_FRAMES. r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 02 Jun 2017 09:41:58 +1000
changeset 362634 0145ab10f5cc62bdf5cee9453be305809e5f7840
parent 362633 2f636eeb949d07746a412fbf327ce4e4015f2aad
child 362635 3853c5543f6e4e8ef24cc1ac47be5a65e4b672e0
child 362681 fb40bcb6155bd1e3ac5468ff4575cce171efbc12
push id91127
push usernnethercote@mozilla.com
push dateWed, 07 Jun 2017 04:20:44 +0000
treeherdermozilla-inbound@0145ab10f5cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1368915
milestone55.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 1368915 (part 5) - Introduce MAX_JS_FRAMES. r=mstange.
tools/profiler/core/platform.cpp
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -791,19 +791,22 @@ AddPseudoEntry(PSLockRef aLock, ProfileB
 
   if (lineno != -1) {
     aBuffer->addTag(ProfileBufferEntry::LineNumber(lineno));
   }
 
   aBuffer->addTag(ProfileBufferEntry::Category(uint32_t(entry.category())));
 }
 
-// The maximum number of native frames obtained. Setting it too high risks the
-// unwinder wasting a lot of time looping on corrupted stacks.
+// Setting MAX_NATIVE_FRAMES too high risks the unwinder wasting a lot of time
+// looping on corrupted stacks.
+//
+// The PseudoStack frame size is found in PseudoStack::MaxEntries.
 static const size_t MAX_NATIVE_FRAMES = 1024;
+static const size_t MAX_JS_FRAMES     = 1024;
 
 struct NativeStack
 {
   void* mPCs[MAX_NATIVE_FRAMES];
   void* mSPs[MAX_NATIVE_FRAMES];
   size_t mCount;  // Number of entries filled.
 
   NativeStack()
@@ -845,17 +848,17 @@ MergeStacksIntoProfile(PSLockRef aLock, 
   // ProfilingFrameIterator to avoid incorrectly resetting the generation of
   // sampled JIT entries inside the JS engine. See note below concerning 'J'
   // entries.
   uint32_t startBufferGen;
   startBufferGen = aSample.mIsSynchronous
                  ? UINT32_MAX
                  : aBuffer->mGeneration;
   uint32_t jsCount = 0;
-  JS::ProfilingFrameIterator::Frame jsFrames[1000];
+  JS::ProfilingFrameIterator::Frame jsFrames[MAX_JS_FRAMES];
 
   // Only walk jit stack if profiling frame iterator is turned on.
   if (context && JS::IsProfilingEnabledForContext(context)) {
     AutoWalkJSStack autoWalkJSStack;
     const uint32_t maxFrames = ArrayLength(jsFrames);
 
     if (autoWalkJSStack.walkAllowed) {
       JS::ProfilingFrameIterator::RegisterState registerState;