]> gitweb.factorcode.org Git - factor.git/commitdiff
kernel.private: adding OBJ-SAMPLE-CALLSTACKS + test case
authorBjörn Lindqvist <bjourne@gmail.com>
Thu, 24 Nov 2016 04:11:46 +0000 (05:11 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Thu, 24 Nov 2016 04:11:46 +0000 (05:11 +0100)
basis/tools/profiler/sampling/sampling-tests.factor
core/kernel/kernel-docs.factor
core/kernel/kernel.factor

index 06c1ff9f18100be7ddb161437ca348a53b095d4d..ac5cd5fd6fb57b3e9248a8be47b6b5dbdba1e6b2 100644 (file)
@@ -1,5 +1,5 @@
-USING: assocs byte-arrays calendar kernel math memory namespaces
-parser random sequences threads tools.profiler.sampling
+USING: assocs byte-arrays calendar kernel kernel.private math memory
+namespaces parser random sequences threads tools.profiler.sampling
 tools.profiler.sampling.private tools.test ;
 IN: tools.profiler.sampling.tests
 
@@ -27,6 +27,10 @@ gc
     ! Seed the samples data
     [ "resource:basis/tools/memory/memory.factor" run-file ] profile
     (get-samples) length 0 >
+    OBJ-SAMPLE-CALLSTACKS special-object first 0 >
+] unit-test
+
+{ t } [
     ! 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.
index a8dfa08e50423e32932f948469aa64f1338fd904..f3c57776af4f71dcda51049fd75e5c322fb62d03 100644 (file)
@@ -1,16 +1,24 @@
-USING: alien arrays classes combinators help.markup help.syntax
-kernel.private layouts math quotations system threads words ;
+USING: alien arrays classes combinators heaps help.markup help.syntax
+kernel.private layouts math quotations sequences system threads words
+;
 IN: kernel
 
+HELP: OBJ-CURRENT-THREAD
+{ $description "Contains a reference to the running " { $link thread } " instance." } ;
+
 HELP: JIT-PUSH-LITERAL
 { $description "JIT code template for pushing literals unto the datastack." } ;
 
+HELP: OBJ-SAMPLE-CALLSTACKS
+{ $description "A " { $link sequence } " that contains all call frames that is being captured during sampling profiling. See the " { $vocab-link "tools.profiler.sampling" } " vocab." } ;
+
+HELP: OBJ-SLEEP-QUEUE
+{ $description "A " { $link min-heap } " containing sleeping threads." }
+{ $see-also sleep-queue } ;
+
 HELP: OBJ-UNDEFINED
 { $description "Default definition for undefined words" } ;
 
-HELP: OBJ-CURRENT-THREAD
-{ $description "Contains a reference to the running " { $link thread } " instance." } ;
-
 HELP: WIN-EXCEPTION-HANDLER
 { $description "This special object is an " { $link alien } " containing a pointer to the processes global exception handler. Only applicable on " { $link windows } "." } ;
 
index 4471432dfccc25466d58fe062ae9c5d8c5f4f2cb..8e3158bde86a0ac74a633bf4145fcf1e346b2b60 100644 (file)
@@ -365,6 +365,8 @@ CONSTANT: SIGNAL-HANDLER-WORD 48
 CONSTANT: LEAF-SIGNAL-HANDLER-WORD 49
 CONSTANT: WIN-EXCEPTION-HANDLER 50
 
+CONSTANT: OBJ-SAMPLE-CALLSTACKS 51
+
 CONSTANT: REDEFINITION-COUNTER 52
 
 CONSTANT: CALLBACK-STUB 53