def print(output = STDOUT, options = {})
@output = output
setup_options(options)
@output << "events: "
case RubyProf.measure_mode
when RubyProf::PROCESS_TIME
@value_scale = RubyProf::CLOCKS_PER_SEC;
@output << 'process_time'
when RubyProf::WALL_TIME
@value_scale = 1_000_000
@output << 'wall_time'
when RubyProf.const_defined?(:CPU_TIME) && RubyProf::CPU_TIME
@value_scale = RubyProf.cpu_frequency
@output << 'cpu_time'
when RubyProf.const_defined?(:ALLOCATIONS) && RubyProf::ALLOCATIONS
@value_scale = 1
@output << 'allocations'
when RubyProf.const_defined?(:MEMORY) && RubyProf::MEMORY
@value_scale = 1
@output << 'memory'
when RubyProf.const_defined?(:GC_RUNS) && RubyProf::GC_RUNS
@value_scale = 1
@output << 'gc_runs'
when RubyProf.const_defined?(:GC_TIME) && RubyProf::GC_TIME
@value_scale = 1000000
@output << 'gc_time'
else
raise "Unknown measure mode: #{RubyProf.measure_mode}"
end
@output << "\n\n"
print_threads
end