vm: rename primitive_sampling_profiler to primitive_set_profiling.
also rename the private primitives words in tools.profiler.sampling.master
parent
e1085ffef4
commit
6e83e00d22
|
@ -778,8 +778,8 @@ CONSTANT: all-primitives {
|
|||
{
|
||||
"tools.profiler.sampling.private"
|
||||
{
|
||||
{ "profiling" ( n -- ) "sampling_profiler" { object } { } f }
|
||||
{ "(get-samples)" ( -- samples/f ) "get_samples" { } { object } f }
|
||||
{ "set-profiling" ( n -- ) "set_profiling" { object } { } f }
|
||||
{ "get-samples" ( -- samples/f ) "get_samples" { } { object } f }
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ gc
|
|||
{ t t } [
|
||||
! Seed the samples data
|
||||
[ "resource:basis/tools/memory/memory.factor" run-file ] profile
|
||||
(get-samples) length 0 >
|
||||
get-samples length 0 >
|
||||
OBJ-SAMPLE-CALLSTACKS special-object first 0 >
|
||||
] unit-test
|
||||
|
||||
|
@ -57,5 +57,5 @@ gc
|
|||
! On x86.64, [ ] profile doesn't generate any samples at all
|
||||
! because it runs so quickly. On x86.32, one spurious sample is
|
||||
! sometimes generated for some unknown reason.
|
||||
gc [ ] profile (get-samples) length 1 <=
|
||||
gc [ ] profile get-samples length 1 <=
|
||||
] unit-test
|
||||
|
|
|
@ -8,8 +8,8 @@ sequences.generalizations sets sorting ;
|
|||
IN: tools.profiler.sampling
|
||||
|
||||
<PRIVATE
|
||||
PRIMITIVE: (get-samples) ( -- samples/f )
|
||||
PRIMITIVE: profiling ( n -- )
|
||||
PRIMITIVE: get-samples ( -- samples/f )
|
||||
PRIMITIVE: set-profiling ( n -- )
|
||||
PRIVATE>
|
||||
|
||||
SYMBOL: samples-per-second
|
||||
|
@ -28,8 +28,8 @@ PRIVATE>
|
|||
raw-profile-data get-global [ "No profile data" throw ] unless* ;
|
||||
|
||||
: profile ( quot -- )
|
||||
samples-per-second get-global profiling
|
||||
[ 0 profiling (get-samples) raw-profile-data set-global ]
|
||||
samples-per-second get-global set-profiling
|
||||
[ 0 set-profiling get-samples raw-profile-data set-global ]
|
||||
finally ; inline
|
||||
|
||||
: total-sample-count ( sample -- count ) 0 swap nth ;
|
||||
|
|
|
@ -32,8 +32,8 @@ namespace factor {
|
|||
_(minor_gc) _(modify_code_heap) _(nano_count) _(quotation_code) \
|
||||
_(quotation_compiled_p) _(reset_dispatch_stats) _(resize_array) \
|
||||
_(resize_byte_array) _(resize_string) _(retainstack_for) \
|
||||
_(sampling_profiler) _(save_image) _(set_context_object) \
|
||||
_(set_datastack) _(set_innermost_stack_frame_quotation) \
|
||||
_(save_image) _(set_context_object) _(set_datastack) \
|
||||
_(set_innermost_stack_frame_quotation) _(set_profiling) \
|
||||
_(set_retainstack) _(set_slot) _(set_special_object) \
|
||||
_(set_string_nth_fast) _(size) _(sleep) _(special_object) _(string) \
|
||||
_(strip_stack_traces) _(tuple) _(tuple_boa) \
|
||||
|
|
|
@ -93,7 +93,7 @@ void factor_vm::record_sample(bool prolog_p) {
|
|||
}
|
||||
|
||||
// Allocates memory
|
||||
void factor_vm::set_sampling_profiler(fixnum rate) {
|
||||
void factor_vm::set_profiling(fixnum rate) {
|
||||
bool running_p = atomic::load(&sampling_profiler_p);
|
||||
if (rate > 0 && !running_p)
|
||||
start_sampling_profiler(rate);
|
||||
|
@ -121,8 +121,8 @@ void factor_vm::end_sampling_profiler() {
|
|||
}
|
||||
|
||||
// Allocates memory
|
||||
void factor_vm::primitive_sampling_profiler() {
|
||||
set_sampling_profiler(to_fixnum(ctx->pop()));
|
||||
void factor_vm::primitive_set_profiling() {
|
||||
set_profiling(to_fixnum(ctx->pop()));
|
||||
}
|
||||
|
||||
// Allocates memory
|
||||
|
|
|
@ -189,8 +189,8 @@ struct factor_vm {
|
|||
void record_sample(bool prolog_p);
|
||||
void start_sampling_profiler(fixnum rate);
|
||||
void end_sampling_profiler();
|
||||
void set_sampling_profiler(fixnum rate);
|
||||
void primitive_sampling_profiler();
|
||||
void set_profiling(fixnum rate);
|
||||
void primitive_set_profiling();
|
||||
void primitive_get_samples();
|
||||
array* allot_growarr();
|
||||
void growarr_add(array *growarr_, cell value);
|
||||
|
|
Loading…
Reference in New Issue