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