]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: rename primitive_sampling_profiler to primitive_set_profiling.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 14 Aug 2020 17:40:54 +0000 (10:40 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 14 Aug 2020 17:40:54 +0000 (10:40 -0700)
also rename the private primitives words in tools.profiler.sampling.

basis/bootstrap/image/primitives/primitives.factor
basis/tools/profiler/sampling/sampling-tests.factor
basis/tools/profiler/sampling/sampling.factor
vm/primitives.hpp
vm/sampling_profiler.cpp
vm/vm.hpp

index 6554f741628a97d9b0c3700f92fc5e612fbf9a5e..f2bffd9b88351978ca729e0fdf2bdc74e03d73b6 100644 (file)
@@ -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 }
         }
     }
     {
index 6493f3c9bdc22b4540f781d5ff0a2083c3983184..765da7af14e42bbfdeca861aadc65011acf93f3c 100644 (file)
@@ -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
index c0ba754fe9ab88eb54313ba7bd3fcaa6b9c91394..5ee805c4d5d701d9b79d9c578ab111b996d971cc 100644 (file)
@@ -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 ;
index 8c88658f718d43548de85f1f9128967bb36596a9..ea45a3faa40d3761b98baf5918e5e86cc785b00e 100644 (file)
@@ -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)                              \
index 4bf74729cb0aefacf8351572a66fdad1dcf73512..0388feaf070e78d46ee9d08f1400385caa756a3b 100644 (file)
@@ -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
index ba92de3592225af5051310e6d647f2a52bc09aa5..dd10a05f6b1c7e154bcf43400fb0f6124e2f3559 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -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);