Bug 153466

Summary: [GTK][EFL] JSC Sampling profiler is not enabled.
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: bugs-noreply, cgarcia, dpino, fpizlo, joepeck, mcatanzaro, ossy, saam, wingo, ysuzuki, zan
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 153638    
Bug Blocks: 153565    

Description Carlos Alberto Lopez Perez 2016-01-25 16:46:47 PST
Revision r194840 <http://trac.webkit.org/194840> implemented a Sampling profiler in JSC for the Inspector UI.

This feature is not enabled in the GTK+ port.

There are some layout tests regarding this feature that are timing out on the GTK+ bots.

I'm going to mark such tests as skipped on the GTK+ port.

I'm also opening this bug for anyone interested in enabling and testing this feature on the GTK+ port.
Comment 1 Carlos Alberto Lopez Perez 2016-01-25 18:02:21 PST
Skipped inspector/sampling-profiler tests on https://trac.webkit.org/r195573
Comment 2 Joseph Pecoraro 2016-01-27 15:38:52 PST
I think currently trunk Web Inspector will not be including any JavaScript profiling data in the Timeline without this.

Either the Sampling Profiler needs to be implemented / tests on Linux ports, or Web Inspector needs to fallback to the Legacy Profiler for these ports to get any JavaScript profiling.

Is there someone who might be interested in trying ENABLE(SAMPLING_PROFILER) on Linux ports?
Comment 3 Carlos Alberto Lopez Perez 2016-01-28 06:18:20 PST
(In reply to comment #2)
> Is there someone who might be interested in trying ENABLE(SAMPLING_PROFILER)
> on Linux ports?

I have just tested this patch on top of r195735:


--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -799,7 +799,7 @@
 
 /* The SamplingProfiler is the probabilistic and low-overhead profiler used by
  * JSC to measure where time is spent inside a JavaScript program. */
-#if (OS(DARWIN) || OS(WINDOWS)) && ENABLE(JIT)
+#if (OS(DARWIN) || OS(LINUX) || OS(WINDOWS)) && ENABLE(JIT)
 #define ENABLE_SAMPLING_PROFILER 1
 #else
 #define ENABLE_SAMPLING_PROFILER 0


And tried to build the GTK+ port (release). I got this build error:

../../Source/JavaScriptCore/heap/MachineStackMarker.cpp:528:2: error: Need a way to get the frame pointer for another thread on this platform
#error Need a way to get the frame pointer for another thread on this platform
 ^
../../Source/JavaScriptCore/heap/MachineStackMarker.cpp:577:2: error: Need a way to get the instruction pointer for another thread on this platform
#error Need a way to get the instruction pointer for another thread on this platform
 ^
2 errors generated.

Looking at where it fails, it looks this tries to do some OS/arch-specific low-level stuff with the instruction pointers that I'm afraid I won't have the time and expertise required to fix.

If somebody else is willing to take this, feel free.

Regards.
Comment 4 Saam Barati 2016-01-28 08:24:42 PST
I spoke to Yusuke last night on IRC
and he said he'd be willing to help
implement these few functions to make
the sampling profiler work on other
platforms. The only functions that need
to be implemented for it to work are the
ones behind ENABLE(SAMPLING_PROFILER)
guard in heap/MachineStackMarker
Comment 5 Michael Catanzaro 2016-01-28 11:30:05 PST
See also: https://lists.webkit.org/pipermail/webkit-dev/2016-January/027888.html
Comment 6 Saam Barati 2016-01-28 13:58:15 PST
see this patch:
https://bugs.webkit.org/show_bug.cgi?id=153584
Comment 7 Yusuke Suzuki 2016-02-07 17:36:39 PST
Landed! http://trac.webkit.org/changeset/196245

*** This bug has been marked as a duplicate of bug 153638 ***