Bug 792302 - Add a more useful pseudo stack entry for flushing to FlushPendingNotifications; r=roc,BenWa
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Thu, 20 Sep 2012 19:19:48 -0400
changeset 107696 78ff52eb09d996600a297ae1dba091177df43953
parent 107695 7d077641695596c33bf9401b28b24fa8236174fd
child 107697 a05fdefc02140950017e8916341adefe7407fae4
push id23507
push userryanvm@gmail.com
push dateSat, 22 Sep 2012 02:38:57 +0000
treeherdermozilla-central@8f359a9d1f19 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, BenWa
bugs792302
milestone18.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 792302 - Add a more useful pseudo stack entry for flushing to FlushPendingNotifications; r=roc,BenWa
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -3709,17 +3709,31 @@ void
 PresShell::FlushPendingNotifications(mozFlushType aType)
 {
   /**
    * VERY IMPORTANT: If you add some sort of new flushing to this
    * method, make sure to add the relevant SetNeedLayoutFlush or
    * SetNeedStyleFlush calls on the document.
    */
 
-  SAMPLE_LABEL("layout", "FlushPendingNotifications");
+#ifdef MOZ_ENABLE_PROFILER_SPS
+  static const char flushTypeNames[][20] = {
+    "Content",
+    "ContentAndNotify",
+    "Style",
+    "InterruptibleLayout",
+    "Layout",
+    "Display"
+  };
+  // Make sure that we don't miss things added to mozFlushType!
+  MOZ_ASSERT(aType <= ArrayLength(flushTypeNames));
+
+  SAMPLE_LABEL_PRINTF("layout", "Flush", "(Flush_%s)",
+                      flushTypeNames[aType - 1]);
+#endif
 
 #ifdef ACCESSIBILITY
 #ifdef DEBUG
   nsAccessibilityService* accService = GetAccService();
   if (accService) {
     NS_ASSERTION(!accService->IsProcessingRefreshDriverNotification(),
                  "Flush during accessible tree update!");
   }