Backed out changeset a0a669819300 (bug 929529) for failed Mochitests/Crashes on an CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 25 Oct 2013 12:59:10 +0200
changeset 165953 4bec45755a434572f8b2e7716cf6ae98142dad77
parent 165952 ba27b9e35d13d8d80f28a2b30eca2d1186b5b617
child 165954 b09700a25a86effcb5722353c2251d9f1cdf76cd
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs929529
milestone27.0a1
backs outa0a6698193002f77042dfa1ad4f3a2a3cde22109
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
Backed out changeset a0a669819300 (bug 929529) for failed Mochitests/Crashes on an CLOSED TREE
dom/indexedDB/ProfilerHelpers.h
dom/indexedDB/TransactionThreadPool.cpp
--- a/dom/indexedDB/ProfilerHelpers.h
+++ b/dom/indexedDB/ProfilerHelpers.h
@@ -4,22 +4,21 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_indexeddb_profilerhelpers_h__
 #define mozilla_dom_indexeddb_profilerhelpers_h__
 
 #include "GeckoProfiler.h"
 
-// Comment this if you do not want IndexedDB operations to be marked in the
-// profiler.
-#define IDB_PROFILER_USE_MARKS
+// Uncomment this if you want IndexedDB operations to be marked in the profiler.
+//#define IDB_PROFILER_USE_MARKS
 
-// Comment this if you do not want extended details to appear in profiler marks.
-#define IDB_PROFILER_MARK_DETAILS
+// Uncomment this if you want extended details to appear in profiler marks.
+//#define IDB_PROFILER_MARK_DETAILS 0
 
 // Sanity check the options above.
 #if defined(IDB_PROFILER_USE_MARKS) && !defined(MOZ_ENABLE_PROFILER_SPS)
 #error Cannot use IDB_PROFILER_USE_MARKS without MOZ_ENABLE_PROFILER_SPS!
 #endif
 
 #if defined(IDB_PROFILER_MARK_DETAILS) && !defined(IDB_PROFILER_USE_MARKS)
 #error Cannot use IDB_PROFILER_MARK_DETAILS without IDB_PROFILER_USE_MARKS!
@@ -36,25 +35,31 @@
 #include "IDBObjectStore.h"
 #include "IDBTransaction.h"
 #include "Key.h"
 
 BEGIN_INDEXEDDB_NAMESPACE
 
 class ProfilerString : public nsAutoCString
 {
+  static const char kQuote = '\"';
+  static const char kOpenBracket = '[';
+  static const char kCloseBracket = ']';
+  static const char kOpenParen = '(';
+  static const char kCloseParen = ')';
+
 public:
   explicit
   ProfilerString(IDBDatabase* aDatabase)
   {
     MOZ_ASSERT(aDatabase);
 
-    Append('"');
+    Append(kQuote);
     AppendUTF16toUTF8(aDatabase->Name(), *this);
-    Append('"');
+    Append(kQuote);
   }
 
   explicit
   ProfilerString(IDBTransaction* aTransaction)
   {
     MOZ_ASSERT(aTransaction);
 
     switch (aTransaction->GetMode()) {
@@ -72,44 +77,44 @@ public:
     };
   }
 
   explicit
   ProfilerString(IDBObjectStore* aObjectStore)
   {
     MOZ_ASSERT(aObjectStore);
 
-    Append('"');
+    Append(kQuote);
     AppendUTF16toUTF8(aObjectStore->Name(), *this);
-    Append('"');
+    Append(kQuote);
   }
 
   explicit
   ProfilerString(IDBIndex* aIndex)
   {
     MOZ_ASSERT(aIndex);
 
-    Append('"');
+    Append(kQuote);
     AppendUTF16toUTF8(aIndex->Name(), *this);
-    Append('"');
+    Append(kQuote);
   }
 
   explicit
   ProfilerString(IDBKeyRange* aKeyRange)
   {
     if (aKeyRange) {
       if (aKeyRange->IsOnly()) {
         Append(ProfilerString(aKeyRange->Lower()));
       }
       else {
-        Append(aKeyRange->IsLowerOpen() ? '(' : '[');
+        Append(aKeyRange->IsLowerOpen() ? kOpenParen : kOpenBracket);
         Append(ProfilerString(aKeyRange->Lower()));
         AppendLiteral(", ");
         Append(ProfilerString(aKeyRange->Upper()));
-        Append(aKeyRange->IsUpperOpen() ? ')' : ']');
+        Append(aKeyRange->IsUpperOpen() ? kCloseParen : kCloseBracket);
       }
     }
   }
 
   explicit
   ProfilerString(const Key& aKey)
   {
     if (aKey.IsUnset()) {
@@ -155,29 +160,29 @@ public:
 };
 
 END_INDEXEDDB_NAMESPACE
 
 #define IDB_PROFILER_MARK(_detailedFmt, _conciseFmt, ...)                      \
   do {                                                                         \
     nsAutoCString _mark;                                                       \
     _mark.AppendPrintf(_detailedFmt, ##__VA_ARGS__);                           \
-    profiler_tracing("IndexedDB", _mark.get());                                \
+    PROFILER_MARKER(_mark.get());                                              \
   } while (0)
 
 #define IDB_PROFILER_STRING(_arg)                                              \
   mozilla::dom::indexedDB::ProfilerString((_arg)).get()
 
 #else // IDB_PROFILER_MARK_DETAILS
 
 #define IDB_PROFILER_MARK(_detailedFmt, _conciseFmt, ...)                      \
   do {                                                                         \
     nsAutoCString _mark;                                                       \
     _mark.AppendPrintf(_conciseFmt, ##__VA_ARGS__);                            \
-    profiler_tracing("IndexedDB", _mark.get());                                \
+    PROFILER_MARKER(_mark.get());                                              \
   } while (0)
 
 #define IDB_PROFILER_STRING(_arg) ""
 
 #endif // IDB_PROFILER_MARK_DETAILS
 
 #define IDB_PROFILER_MARK_IF(_cond, _detailedFmt, _conciseFmt, ...)            \
   do {                                                                         \
--- a/dom/indexedDB/TransactionThreadPool.cpp
+++ b/dom/indexedDB/TransactionThreadPool.cpp
@@ -11,37 +11,31 @@
 
 #include "nsComponentManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsXPCOMCIDInternal.h"
 
 #include "ProfilerHelpers.h"
 
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "mozilla/Atomics.h"
-#endif
-
 using mozilla::MonitorAutoLock;
 
 USING_INDEXEDDB_NAMESPACE
 
 namespace {
 
 const uint32_t kThreadLimit = 20;
 const uint32_t kIdleThreadLimit = 5;
 const uint32_t kIdleThreadTimeoutMs = 30000;
 
 TransactionThreadPool* gInstance = nullptr;
 bool gShutdown = false;
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
 
-mozilla::Atomic<uint32_t> gNextThreadSerial(0);
-
 class TransactionThreadPoolListener : public nsIThreadPoolListener
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITHREADPOOLLISTENER
 
 private:
   virtual ~TransactionThreadPoolListener()
@@ -670,24 +664,18 @@ FinishTransactionRunnable::Run()
 #ifdef MOZ_ENABLE_PROFILER_SPS
 
 NS_IMPL_ISUPPORTS1(TransactionThreadPoolListener, nsIThreadPoolListener)
 
 NS_IMETHODIMP
 TransactionThreadPoolListener::OnThreadCreated()
 {
   MOZ_ASSERT(!NS_IsMainThread());
-
-  char stackBaseGuess;
-
-  nsAutoCString name;
-  name.AssignLiteral("IndexedDB Transaction ");
-  name.AppendInt(gNextThreadSerial++);
-
-  profiler_register_thread(name.get(), &stackBaseGuess);
+  char aLocal;
+  profiler_register_thread("IndexedDB Transaction", &aLocal);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TransactionThreadPoolListener::OnThreadShuttingDown()
 {
   MOZ_ASSERT(!NS_IsMainThread());
   profiler_unregister_thread();