John Benediktsson
6e83e00d22
vm: rename primitive_sampling_profiler to primitive_set_profiling.
...
also rename the private primitives words in tools.profiler.sampling.
2020-08-14 10:40:54 -07:00
John Benediktsson
e1085ffef4
vm: add some allocates memory comments.
2020-08-14 10:27:54 -07:00
John Benediktsson
f21deee3df
vm: change some bools from cell to bool.
2020-08-14 10:27:18 -07:00
Doug Coleman
2a409c79e0
vm: Fix unused variable warnings on Windows.
2018-07-13 00:48:58 -05:00
Björn Lindqvist
abbf8f8f1f
VM: merging the profiling_sample and profiling_sample_count classes
...
This refactoring makes the code a bit simpler.
2017-06-25 01:17:12 +02:00
Björn Lindqvist
0590ebf914
VM: storing some sample data in the heap ( #337 )
...
This is the first half of it. In the second half the samples array
should also be stored in the heap.
2016-11-23 09:44:17 +01:00
Björn Lindqvist
9927c92cbd
VM: better to use a "normal" for-loop here
2016-11-23 06:42:06 +01:00
Björn Lindqvist
55e6ccb708
VM: remove the reversing from sampling profiler callstack collection #452
2016-10-13 01:34:55 +02:00
Alexander Iljin
0d57734dab
vm: replace block comments /**/ with line comments //
2016-09-09 05:47:52 +02:00
Alexander Iljin
e0acf4f328
Revert "vm: replace line comments // with block comments /**/ for consintency"
...
This reverts commit 7ee4e5dea5
.
2016-09-09 05:47:52 +02:00
Björn Lindqvist
b5c6658ae5
VM: removing the safepoint_state class
...
The code reads better if the safepoint_state methods and
attributes (sample_counts and safepoint_fep_p) are moved to the vm
class.
2016-08-15 15:16:41 +02:00
Björn Lindqvist
2f6f69eb5b
VM: trying to simplify record_sample and the profiling_sample constructor
2016-08-15 15:16:41 +02:00
Alexander Iljin
7ee4e5dea5
vm: replace line comments // with block comments /**/ for consintency
...
Fix #1651 .
2016-08-03 09:19:48 -07:00
Alexander Iljin
e302928510
vm: fix a typo in a comment
2016-05-30 12:11:56 -07:00
Alexander Iljin
3ea7fe616e
vm: fix warning C4800: forcing value to bool
...
The warning is issued by the Visual Studio 2015, treated as error.
2016-05-30 12:11:56 -07:00
Björn Lindqvist
08c2e3a32d
VM: better logic in factor_vm::set_sampling_profiler
...
It avoids the double-negation.
2016-05-19 01:25:53 +02:00
Björn Lindqvist
7f8d5cbef4
VM: when starting the sampling profiler, the data needs to be cleared
2016-05-06 19:56:13 +02:00
Björn Lindqvist
9824be8714
VM: The C++11 method shrink_to_fit() can be used to release memory
2016-05-05 14:22:57 +02:00
Björn Lindqvist
5826394573
VM: the (clear-samples) primitive is unused
2016-05-05 02:33:35 +02:00
Björn Lindqvist
bc9f62efde
VM: using a c++ lambda over a struct
2016-05-05 01:57:52 +02:00
Björn Lindqvist
eb7a5ab1ba
VM: some more fixing to make the types match better, converting void* to cell
2015-01-15 09:29:13 +00:00
Erik Charlebois
b2929acff6
VM: Refactor sampling_profiler.cpp/hpp to Factor style
2013-05-12 13:24:47 -04:00
Doug Coleman
aad70160f0
vm: Add more comments about functions that allocate.
2012-08-15 22:00:08 -07:00
Joe Groff
604ceb957c
vm: replace remaining stack_frame-based logic
2011-12-14 09:56:49 -08:00
Joe Groff
0a1a252cdb
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
6c0ecf631a
vm: charge samples collected in prolog to parent
...
Fixes #379
2011-11-23 11:11:26 -08:00
Joe Groff
72d335f2b5
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
212d012cb1
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
2d87b68a56
vm: sample pc on windows
2011-11-02 21:18:31 -07:00
Joe Groff
1833beea52
vm: fix MSVC warnings
2011-11-02 20:26:53 -07:00
Joe Groff
82a62181ce
vm: count samples during unoptimized compiler
2011-11-02 13:23:21 -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
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
27ac4c60f4
vm: factor out sample counting code
2011-11-02 13:23:13 -07:00
Joe Groff
d9afe92c97
get sampler working under windows
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
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
e10c3183c8
vm: add primitives to lift sample data to factor
2011-11-02 13:23:09 -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
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