Commit 5bc23e86 authored by Benoit Perrot's avatar Benoit Perrot
Browse files

2005-03-06 Benoît Perrot <benoit@lrde.epita.fr>

	Provide `--profile' option.

	* src/vm/virtual_machine.hh: Add accessor to control coprocessor.
	* src/vm-tasks.hh, src/vm-tasks.cc: Declare and define the
	`profile' task. For the moment, simply print on stderr the number
	of executed cyles at the end of the program's execution.
parent 7952c3c7
2005-03-06 Benoît Perrot <benoit@lrde.epita.fr>
Provide `--profile' option.
* src/vm/virtual_machine.hh: Add accessor to control coprocessor.
* src/vm-tasks.hh, src/vm-tasks.cc: Declare and define the
`profile' task. For the moment, simply print on stderr the number
of executed cyles at the end of the program's execution.
2005-02-15 Benoît Perrot <benoit@lrde.epita.fr>
Implement print_err.
......
......@@ -38,12 +38,19 @@ namespace vm
if (exit_status != exit_success)
exit(exit_status);
vm.execute();
if (profile_p)
{
std::cerr << "Number of cycles: "
<< vm.get_cp0().get_count()
<< std::endl;
}
// FIXME: Quick and dirty, this should not be done here
delete parse::tasks::program;
parse::tasks::program = 0;
}
} // namespace tasks
} // namespace vm
......@@ -33,6 +33,9 @@ namespace vm
"Warn if a callee save register "
"is not preserved across a call",
check_callee_save_p, "");
BOOLEAN_TASK_DECLARE ("profile", "Enable program profiling",
profile_p, "");
BOOLEAN_TASK_DECLARE ("E|trace-exec", "Trace the execution",
trace_exec_p, "");
......
......@@ -147,6 +147,11 @@ namespace vm
return cpu_.get_pc();
}
const Cp0 &get_cp0() const
{
return cp0_;
}
protected:
/// The virtual machine mode.
mode_type mode_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment