Joe Groff
00f00663ad
vm: replace assert with FACTOR_ASSERT
...
Factor is finally a real C++ project and has a custom assert macro. Assertion failures were still getting caught as exceptions and causing failure loops. Write our own macro that calls factor::abort on failure.
2011-11-23 11:11:26 -08:00
Joe Groff
ba88cbbe51
vm: charge samples collected in prolog to parent
...
Fixes #379
2011-11-23 11:11:26 -08:00
Joe Groff
ceeb9f36d8
vm: write async signals to pipe for multiplexer
...
also factor out safepoint logic into its own file
2011-11-08 08:42:46 -08:00
Joe Groff
9c055136a7
vm: switch atomic::add to atomic::fetch_add
...
Win32 only provides fetch-and-add, not add-and-fetch, and we don't really care. Rename the functions so the order of operations is clear.
2011-11-07 17:58:53 -08:00
Joe Groff
ac2fcd1ee0
vm: sample pc on windows
2011-11-02 21:18:31 -07:00
Joe Groff
8d2e4fbda2
vm: fix MSVC warnings
2011-11-02 20:26:53 -07:00
Joe Groff
6b2a34fdc6
vm: count samples during unoptimized compiler
2011-11-02 13:23:21 -07:00
Joe Groff
9fb10f60b5
vm: add atomic::load and atomic::store functions
...
Abstract out the fence-and-load and store-and-fence patterns
2011-11-02 13:23:19 -07:00
Joe Groff
b0f6dbddec
vm: sample thread object rather than raw context
2011-11-02 13:23:18 -07:00
Joe Groff
2a64c3ed69
vm: sample code block owners instead of blocks
2011-11-02 13:23:17 -07:00
Joe Groff
bef4444f53
vm: fix data roots in get-samples primitive
2011-11-02 13:23:17 -07:00
Joe Groff
fdeb6ddbaa
vm: quell MSVC warnings
2011-11-02 13:23:16 -07:00
Joe Groff
d7bc7ae4bf
vm: parameterize sampling rate
2011-11-02 13:23:15 -07:00
Joe Groff
66356c1d24
vm: better organize atomics and sample counter
2011-11-02 13:23:15 -07:00
Joe Groff
52bcbe55cf
vm: factor out sample counting code
2011-11-02 13:23:13 -07:00
Joe Groff
6d922c70a9
get sampler working under windows
2011-11-02 13:23:12 -07:00
Joe Groff
c0e4458733
vm: fix build on windows
2011-11-02 13:23:12 -07:00
Joe Groff
bec71e9ae2
vm: sampling profiler timer for windows
...
Spawn a thread and have it spin on the performance counter, triggering safepoints on the main thread every sample time
2011-11-02 13:23:11 -07:00
Joe Groff
1c68bbf8a6
vm: count samples from foreign threads
...
On OS X it appears the mach exception thread and libdispatch queue threads occasionally get the SIGALRM from the itimer. Count those as foreign_thread_samples instead of letting the signal kill the process.
2011-11-02 13:23:10 -07:00
Joe Groff
1ab4871fcc
vm: add primitives to lift sample data to factor
2011-11-02 13:23:09 -07:00
Joe Groff
cb2e87ecde
vm: release memory used by sampler vectors
2011-11-02 13:23:08 -07:00
Joe Groff
29e652f67e
vm: bottom_frame method for contexts
...
ctx->callstack_bottom - 1 -- the fuck does that mean?!
2011-11-02 13:23:07 -07:00
Joe Groff
1604c503ab
vm: don't allocate callstack samples on data heap
...
Invoking a GC during a safepoint has some complications, so stuff the callstack samples in a vector instead.
2011-11-02 13:23:07 -07:00
Joe Groff
2ddfdda7b5
vm: groundwork for sampling profiler
...
Set up the state necessary to collect samples. We still need to add GC support for walking the sample set, and the compiler needs to register GC roots before safepoints as well. We also need primitives to expose the data to Factor for reporting.
2011-11-02 13:23:06 -07:00