Commit Graph

1293 Commits (f3c8423382a27b4a93bd434cbff1fa5cfa7bff6b)

Author SHA1 Message Date
Joe Groff 8cf18d1a82 remove BSD,solaris,etc. misc platform support code 2011-11-02 17:13:51 -07:00
Joe Groff 82a62181ce vm: count samples during unoptimized compiler 2011-11-02 13:23:21 -07:00
Joe Groff e0c68d5a3f vm: fix scrub-league assert abuse 2011-11-02 13:23:21 -07:00
Joe Groff 2fc6b0b9be vm: forgot to add atomic.hpp 2011-11-02 13:23:20 -07:00
Joe Groff 73845fdad9 vm: separate 'current_gc_p' from 'current_gc'
The 'current_gc' handle doesn't need to be volatile, just the state of GC-ness
2011-11-02 13:23:19 -07:00
Joe Groff 4d39e59054 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 be8db5aed3 vm: sample thread object rather than raw context 2011-11-02 13:23:18 -07:00
Joe Groff 7da8a9776f vm: sample code block owners instead of blocks 2011-11-02 13:23:17 -07:00
Joe Groff e880095da3 vm: fix data roots in get-samples primitive 2011-11-02 13:23:17 -07:00
Joe Groff 4037c981eb vm: die if we fault in a fault 2011-11-02 13:23:16 -07:00
Joe Groff 29fa23c40a vm: quell MSVC warnings 2011-11-02 13:23:16 -07:00
Joe Groff 30ed9b535b vm: parameterize sampling rate 2011-11-02 13:23:15 -07:00
Joe Groff 799053661e vm: better organize atomics and sample counter 2011-11-02 13:23:15 -07:00
Joe Groff 89ea69b61b vm: fix comments mangled by find & replace 2011-11-02 13:23:14 -07:00
Joe Groff 27ac4c60f4 vm: factor out sample counting code 2011-11-02 13:23:13 -07:00
Joe Groff baebb317e4 whitespace 2011-11-02 13:23:13 -07:00
Joe Groff 34ea20beca vm: only show factorbug help the first time 2011-11-02 13:23:13 -07:00
Joe Groff 1a665f3eac vm: more accurate sample timing on windows 2011-11-02 13:23:12 -07:00
Joe Groff d9afe92c97 get sampler working under windows 2011-11-02 13:23:12 -07:00
Joe Groff 252915a37c fix platform dependency in leaf-signal-handler 2011-11-02 13:23:12 -07:00
Joe Groff abaa051768 vm: fix build on windows 2011-11-02 13:23:12 -07:00
Joe Groff 1351e30e52 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 125c46c10f vm: stub out windows sampling timer implementation
AFAIK Windows has no equivalent to setitimer. We'll probably need to use a thread that periodically pauses and samples the main VM thread.
2011-11-02 13:23:10 -07:00
Joe Groff f5cdfaeb2a 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 27d7e4af53 vm: actually collect samples and add primitives... 2011-11-02 13:23:10 -07:00
Joe Groff e10c3183c8 vm: add primitives to lift sample data to factor 2011-11-02 13:23:09 -07:00
Joe Groff 3dd17537eb vm: write back fixed-up code address to samples 2011-11-02 13:23:09 -07:00
Joe Groff e3e2788414 vm: walk code roots from sample callstacks 2011-11-02 13:23:08 -07:00
Joe Groff 1089816b21 vm: release memory used by sampler vectors 2011-11-02 13:23:08 -07:00
Joe Groff 40bc8459db 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 be5c7476d7 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 b341b0ce13 vm: only show factorbug basic commands at first
"help" brings up the entire command list.
2011-11-02 13:23:07 -07:00
Joe Groff 80fb7788d9 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
Joe Groff cdfb1b1b94 vm: change "profiler" names to "counting_profiler" 2011-11-02 13:23:05 -07:00
Joe Groff 186bf65a00 constants for special object hardcoded literals 2011-11-02 12:54:50 -07:00
Joe Groff 23208e5697 vm: give factorbug a help command
Also change the prompt to "> _" instead of "READY\n_" since it's not 1970 anymore
2011-10-27 21:18:23 -07:00
Joe Groff 2d5360778f cleanups from code review 2011-10-27 21:18:23 -07:00
Joe Groff 9eee44ce4a vm: remove half-assed signal queueing scaffolding
Should implement it right later. See #297.
2011-10-27 21:18:22 -07:00
Joe Groff fb2d105e83 vm: remove some debugging crumbs 2011-10-27 21:18:22 -07:00
Joe Groff 27c43ea6a3 vm: add "gc" command to factorbug 2011-10-27 21:18:22 -07:00
Joe Groff 8e66c7abee vm: clean up windows ctrl-handler 2011-10-27 21:18:22 -07:00
Joe Groff 331e4264b3 vm: some typos in debug.cpp 2011-10-27 21:18:21 -07:00
Joe Groff ca0dfc5730 vm: get CtrlHandler working on windows 2011-10-27 21:18:21 -07:00
Joe Groff 6d57eb4f59 vm: update windows for resumable signals 2011-10-27 21:18:21 -07:00
Joe Groff 9541bf14f5 vm: win32 GetCurrentThread is a fake thread handle
Open a real thread handle with the necessary permissions to dispatch a handler from the the Ctrl-C handler thread.
2011-10-27 21:18:21 -07:00
Joe Groff af0f021a94 vm: change factorbug "q" to quit process
Also change the docs around so the useful commands are all listed under "Basic commands", and rename the more arcane "s" and "r" dumps to "ds" and "dr".
2011-10-27 21:18:20 -07:00
Joe Groff 5d59faa7d1 vm: move dispatch_signal_handler to cpu-x86.cpp
The new signal handler dispatch is logic is CISC-centric; defer fixing it until we find someone who cares
2011-10-27 21:18:20 -07:00
Joe Groff a6b80f3efa vm: code_block_for_address method -> code_heap 2011-10-27 21:18:20 -07:00
Joe Groff 03ebb91170 vm: remove signal_from_leaf flag
Now that the resuming from the signal handler works within leaf procedures, the flag is no longer necessary.
2011-10-27 21:18:20 -07:00
Joe Groff 11ffea55fc vm: sniff leaf words walking code heap, not data 2011-10-27 21:18:19 -07:00