Title: [213859] trunk/Source/_javascript_Core
Revision
213859
Author
[email protected]
Date
2017-03-13 12:09:07 -0700 (Mon, 13 Mar 2017)

Log Message

[JSC][Linux] Allow profilers to demangle C++ names
https://bugs.webkit.org/show_bug.cgi?id=169559

Reviewed by Michael Catanzaro.

Linux also offers dladdr & demangling feature.
Thus, we can use it to show the names in profilers.
For example, SamplingProfiler tells us the C function names.

* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::StackFrame::displayName):
* tools/CodeProfile.cpp:
(JSC::symbolName):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (213858 => 213859)


--- trunk/Source/_javascript_Core/ChangeLog	2017-03-13 18:56:54 UTC (rev 213858)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-03-13 19:09:07 UTC (rev 213859)
@@ -1,5 +1,21 @@
 2017-03-13  Yusuke Suzuki  <[email protected]>
 
+        [JSC][Linux] Allow profilers to demangle C++ names
+        https://bugs.webkit.org/show_bug.cgi?id=169559
+
+        Reviewed by Michael Catanzaro.
+
+        Linux also offers dladdr & demangling feature.
+        Thus, we can use it to show the names in profilers.
+        For example, SamplingProfiler tells us the C function names.
+
+        * runtime/SamplingProfiler.cpp:
+        (JSC::SamplingProfiler::StackFrame::displayName):
+        * tools/CodeProfile.cpp:
+        (JSC::symbolName):
+
+2017-03-13  Yusuke Suzuki  <[email protected]>
+
         [WTF] Clean up RunLoop and WorkQueue with Seconds and Function
         https://bugs.webkit.org/show_bug.cgi?id=169537
 

Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (213858 => 213859)


--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2017-03-13 18:56:54 UTC (rev 213858)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2017-03-13 19:09:07 UTC (rev 213859)
@@ -51,7 +51,7 @@
 #include <wtf/RefPtr.h>
 #include <wtf/text/StringBuilder.h>
 
-#if OS(DARWIN)
+#if OS(DARWIN) || OS(LINUX)
 #include <cxxabi.h>
 #include <dlfcn.h>
 #endif
@@ -746,7 +746,7 @@
     }
 
     if (frameType == FrameType::Unknown || frameType == FrameType::C) {
-#if OS(DARWIN)
+#if OS(DARWIN) || OS(LINUX)
         if (frameType == FrameType::C) {
             const char* mangledName = nullptr;
             const char* cxaDemangled = nullptr;

Modified: trunk/Source/_javascript_Core/tools/CodeProfile.cpp (213858 => 213859)


--- trunk/Source/_javascript_Core/tools/CodeProfile.cpp	2017-03-13 18:56:54 UTC (rev 213858)
+++ trunk/Source/_javascript_Core/tools/CodeProfile.cpp	2017-03-13 19:09:07 UTC (rev 213859)
@@ -32,7 +32,7 @@
 #include "ProfileTreeNode.h"
 #include <wtf/text/WTFString.h>
 
-#if OS(DARWIN)
+#if OS(DARWIN) || OS(LINUX)
 #include <cxxabi.h>
 #include <dlfcn.h>
 #include <execinfo.h>
@@ -55,7 +55,7 @@
 // Helper function, find the symbol name for a pc in JSC.
 static const char* symbolName(void* address)
 {
-#if OS(DARWIN)
+#if OS(DARWIN) || OS(LINUX)
     Dl_info info;
     if (!dladdr(address, &info) || !info.dli_sname)
         return "<unknown>";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to