Bug 831133 - Record only the basename. r=vladan.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Wed, 16 Jan 2013 21:02:32 -0500
changeset 119099 8d0071573033713e96dc1ad9deeb884e07cbb533
parent 119098 2510df9be883afc0950c7dcabd0670d8984a44d0
child 119100 4d2f27cdef9173ba8ac3a088ed66f57d58b3eb7c
push id24189
push useremorley@mozilla.com
push dateThu, 17 Jan 2013 10:42:06 +0000
treeherdermozilla-central@712eca11a04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladan
bugs831133
milestone21.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 831133 - Record only the basename. r=vladan.
toolkit/components/telemetry/Telemetry.cpp
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -2240,18 +2240,29 @@ GetStackAndModules(const std::vector<uin
     const StackFrame &rawFrame = *i;
     ProcessedStack::Frame frame = { rawFrame.mPC, rawFrame.mModIndex };
     Ret.AddFrame(frame);
   }
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
   for (unsigned i = 0, n = rawModules.GetSize(); i != n; ++i) {
     const SharedLibrary &info = rawModules.GetEntry(i);
+    const std::string &name = info.GetName();
+    std::string basename = name;
+#ifdef XP_MACOSX
+    // FIXME: We want to use just the basename as the libname, but the
+    // current profiler addon needs the full path name, so we compute the
+    // basename in here.
+    size_t pos = name.rfind('/');
+    if (pos != std::string::npos) {
+      basename = name.substr(pos + 1);
+    }
+#endif
     ProcessedStack::Module module = {
-      info.GetName(),
+      basename,
       info.GetBreakpadId()
     };
     Ret.AddModule(module);
   }
 #endif
 
   return Ret;
 }