DescriptionReimplement profiler sampler on Mac OS X to get it working under Chromium.
Previous implementation of sampler for OS X was copied from the Linux one. But BSD (OS X) and Linux has a very important difference in signal handling. LinuxThreads doesn't support the notion of process-directed signals. So, the SIGPROF signal was directed to the thread that installed the handler---the V8 thread. But on BSD, signal handling is implemented according to POSIX spec, where process-directed signal is to be handled by an arbitrary selected thread. By a coincidence, in V8's sample shell and in Chromium's test shell, V8's thread was picked almost every time, so sampling seemed working. But not in case of Chromium.
So, I've changed the implementation of profiler sampler to use the same scheme as on Windows---a dedicated thread with high priority is used to periodically pause and sample V8's thread.
Committed: http://code.google.com/p/v8/source/detail?r=2315
Patch Set 1 #
Total comments: 7
Patch Set 2 : Fixes according to Ivan's comments #Patch Set 3 : Removed accidentally added lines #
Total comments: 2
Patch Set 4 : Factored out stack sampling and moved it under "thread_suspended" condition #Patch Set 5 : moved thread resuming and got rid of thread_suspended flag #
Messages
Total messages: 7 (0 generated)
|