Bug 741242 - Fix profiler address output broken by bug 739800 on Mac 64 bit. r=bgirard
authorVladan Djeric <vdjeric@mozilla.com>
Mon, 02 Apr 2012 14:34:39 -0400
changeset 94166 d4f6c908dc1758de7a79d717aae57806552d07e5
parent 94165 4abc7c28b048d7ef0832b8c82b109696935d0528
child 94167 d0a67d911787c7d01e5fcb0c165ebb3476453c0f
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)
reviewersbgirard
bugs741242, 739800
milestone14.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 741242 - Fix profiler address output broken by bug 739800 on Mac 64 bit. r=bgirard
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -286,18 +286,18 @@ public:
           b.ArrayPush(samples, sample);
           break;
         case 'c':
         case 'l':
           {
             if (sample) {
               JSObject *frame = b.CreateObject();
               char tagBuff[1024];
-              void* pc = (void*)entry.mTagData;
-              snprintf(tagBuff, 1024, "%p", pc);
+              unsigned long long pc = (unsigned long long)entry.mTagData;
+              snprintf(tagBuff, 1024, "%#llx", pc);
               b.DefineProperty(frame, "location", tagBuff);
               b.ArrayPush(frames, frame);
             }
           }
       }
     }
     mReadPos = oldReadPos;
 
@@ -668,18 +668,18 @@ std::ostream& operator<<(std::ostream& s
 std::ostream& operator<<(std::ostream& stream, const ProfileEntry& entry)
 {
   if (entry.mTagName == 'r') {
     stream << entry.mTagName << "-" << std::fixed << entry.mTagFloat << "\n";
   } else if (entry.mTagName == 'l') {
     // Bug 739800 - Force l-tag addresses to have a "0x" prefix on all platforms
     // Additionally, stringstream seemed to be ignoring formatter flags.
     char tagBuff[1024];
-    Address pc = entry.mTagAddress;
-    snprintf(tagBuff, 1024, "l-%#x\n", pc);
+    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";