Revert "lists: Add list literal doc example."
[factor.git] / vm / sampling_profiler.hpp
blob161adc37e0668f222349de6af5b158b991502767
1 namespace factor {
3 struct profiling_sample {
4 // Active thread during sample
5 cell thread;
6 // The callstack at safepoint time. Indexes to the beginning and ending
7 // word entries in the vm sample_callstacks array.
8 cell callstack_begin, callstack_end;
10 // Number of samples taken before the safepoint that recorded the sample
11 fixnum sample_count;
12 // Number of samples taken during GC
13 fixnum gc_sample_count;
14 // Number of samples taken during unoptimized compiler
15 fixnum jit_sample_count;
16 // Number of samples taken during foreign code execution
17 fixnum foreign_sample_count;
18 // Number of samples taken during code execution in non-Factor threads
19 fixnum foreign_thread_sample_count;
21 profiling_sample(fixnum sample_count, fixnum gc_sample_count,
22 fixnum jit_sample_count, fixnum foreign_sample_count,
23 fixnum foreign_thread_sample_count)
24 : thread(0),
25 callstack_begin(0),
26 callstack_end(0),
27 sample_count(sample_count),
28 gc_sample_count(gc_sample_count),
29 jit_sample_count(jit_sample_count),
30 foreign_sample_count(foreign_sample_count),
31 foreign_thread_sample_count(foreign_thread_sample_count) {}
33 profiling_sample record_counts() volatile;
34 void clear_counts() volatile;
35 bool empty() const {
36 return sample_count + gc_sample_count + jit_sample_count +
37 foreign_sample_count + foreign_thread_sample_count ==