2011-10-28 18:42:33 -04:00
|
|
|
namespace factor
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#define FACTOR_PROFILE_SAMPLES_PER_SECOND 1000
|
|
|
|
|
|
|
|
|
|
struct profiling_sample
|
|
|
|
|
{
|
|
|
|
|
// Number of samples taken before the safepoint that recorded the sample
|
|
|
|
|
cell sample_count;
|
|
|
|
|
// Number of samples taken during GC
|
|
|
|
|
cell gc_sample_count;
|
|
|
|
|
// Active context during sample
|
|
|
|
|
context *ctx;
|
2011-10-29 17:41:48 -04:00
|
|
|
/* The callstack at safepoint time. Indexes to the beginning and ending
|
|
|
|
|
code_block entries in the vm sample_callstacks array. */
|
|
|
|
|
cell callstack_begin, callstack_end;
|
2011-10-28 18:42:33 -04:00
|
|
|
|
2011-10-29 17:41:48 -04:00
|
|
|
profiling_sample(factor_vm *vm,
|
|
|
|
|
cell sample_count,
|
2011-10-28 18:42:33 -04:00
|
|
|
cell gc_sample_count,
|
2011-10-29 17:41:48 -04:00
|
|
|
context *ctx);
|
2011-10-28 18:42:33 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|