Backout acefe9a94a63 - Bug 735262 because of B2G breakage.
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 13 Apr 2012 14:55:13 -0400
changeset 94946 aaa7f8a1945cc4e16cf41cd1b57f51cad85619cf
parent 94945 33552f5d803d7983325f893562a0e3e3591e617d
child 94947 eabff322e404cae2ae9f639816afb1f8265fed4f
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs735262
milestone14.0a1
backs outacefe9a94a63a014a26e95a5784c7aeddb787b95
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
Backout acefe9a94a63 - Bug 735262 because of B2G breakage.
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -114,50 +114,57 @@ TimeStamp sLastTracerEvent;
 
 class ThreadProfile;
 
 class ProfileEntry
 {
 public:
   ProfileEntry()
     : mTagData(NULL)
+    , mLeafAddress(0)
     , mTagName(0)
   { }
 
   // aTagData must not need release (i.e. be a string from the text segment)
   ProfileEntry(char aTagName, const char *aTagData)
     : mTagData(aTagData)
+    , mLeafAddress(0)
+    , mTagName(aTagName)
+  { }
+
+  // aTagData must not need release (i.e. be a string from the text segment)
+  ProfileEntry(char aTagName, const char *aTagData, Address aLeafAddress)
+    : mTagData(aTagData)
+    , mLeafAddress(aLeafAddress)
     , mTagName(aTagName)
   { }
 
   ProfileEntry(char aTagName, double aTagFloat)
     : mTagFloat(aTagFloat)
+    , mLeafAddress(0)
     , mTagName(aTagName)
   { }
 
   ProfileEntry(char aTagName, uintptr_t aTagOffset)
     : mTagOffset(aTagOffset)
-    , mTagName(aTagName)
-  { }
-
-  ProfileEntry(char aTagName, Address aTagAddress)
-    : mTagAddress(aTagAddress)
+    , mLeafAddress(0)
     , mTagName(aTagName)
   { }
 
   friend std::ostream& operator<<(std::ostream& stream, const ProfileEntry& entry);
 
 private:
   friend class ThreadProfile;
   union {
     const char* mTagData;
     double mTagFloat;
     Address mTagAddress;
     uintptr_t mTagOffset;
   };
+  Address mLeafAddress;
   char mTagName;
 };
 
 #define PROFILE_MAX_ENTRY 100000
 class ThreadProfile
 {
 public:
   ThreadProfile(int aEntrySize, ProfileStack *aStack)
@@ -570,27 +577,25 @@ void TableTicker::doBacktrace(ThreadProf
 static
 void doSampleStackTrace(ProfileStack *aStack, ThreadProfile &aProfile, TickSample *sample)
 {
   // Sample
   // 's' tag denotes the start of a sample block
   // followed by 0 or more 'c' tags.
   for (mozilla::sig_safe_t i = 0; i < aStack->mStackPointer; i++) {
     if (i == 0) {
-      aProfile.addTag(ProfileEntry('s', aStack->mStack[i]));
+      Address pc = 0;
+      if (sample) {
+        pc = sample->pc;
+      }
+      aProfile.addTag(ProfileEntry('s', aStack->mStack[i], pc));
     } else {
       aProfile.addTag(ProfileEntry('c', aStack->mStack[i]));
     }
   }
-#ifdef ENABLE_SPS_LEAF_DATA
-  if (sample) {
-    Address pc = sample->pc;
-    aProfile.addTag(ProfileEntry('l', sample->pc));
-  }
-#endif
 }
 
 /* used to keep track of the last event that we sampled during */
 unsigned int sLastSampledEventGeneration = 0;
 
 /* a counter that's incremented everytime we get responsiveness event
  * note: it might also be worth tracking everytime we go around
  * the event loop */
@@ -669,16 +674,22 @@ std::ostream& operator<<(std::ostream& s
     // Additionally, stringstream seemed to be ignoring formatter flags.
     char tagBuff[1024];
     unsigned long long pc = (unsigned long long)entry.mTagData;
     snprintf(tagBuff, 1024, "l-%#llx\n", pc);
     stream << tagBuff;
   } else {
     stream << entry.mTagName << "-" << entry.mTagData << "\n";
   }
+
+#ifdef ENABLE_SPS_LEAF_DATA
+  if (entry.mLeafAddress) {
+    stream << entry.mTagName << "-" << entry.mLeafAddress << "\n";
+  }
+#endif
   return stream;
 }
 
 void mozilla_sampler_init()
 {
   // TODO linux port: Use TLS with ifdefs
   if (!mozilla::tls::create(&pkey_stack) ||
       !mozilla::tls::create(&pkey_ticker)) {