]> gitweb.factorcode.org Git - factor.git/blob - vm/sampling_profiler.hpp
vm: groundwork for sampling profiler
[factor.git] / vm / sampling_profiler.hpp
1 namespace factor
2 {
3
4 #define FACTOR_PROFILE_SAMPLES_PER_SECOND 1000
5
6 struct profiling_sample
7 {
8         // Number of samples taken before the safepoint that recorded the sample
9         cell sample_count;
10         // Number of samples taken during GC
11         cell gc_sample_count;
12         // Active context during sample
13         context *ctx;
14         // The callstack at safepoint time
15         cell callstack;
16
17         profiling_sample(cell sample_count,
18                 cell gc_sample_count,
19                 context *ctx,
20                 cell callstack)
21                 :
22                 sample_count(sample_count),
23                 gc_sample_count(gc_sample_count),
24                 ctx(ctx),
25                 callstack(callstack)
26         {
27         }
28 };
29
30 }