Commit c4129727 authored by Paul's avatar Paul
Browse files

Fix perf report

parent d4b83ad4
...@@ -907,19 +907,16 @@ void program::perf_report(std::ostream& os, ...@@ -907,19 +907,16 @@ void program::perf_report(std::ostream& os,
print_title(os, max_ins_len); print_title(os, max_ins_len);
this->print(names, [&](auto ins, auto ins_names) { this->print(names, [&](auto ins, auto ins_names) {
std::stringstream ss; instruction::print(std::cout, ins, ins_names);
instruction::print(ss, ins, ins_names);
os << ss.str();
// skip return instruction // skip return instruction
if(ins->name() == "@return") if(ins->name() == "@return")
return; return;
// insert space to align double avg = common_average(ins_vec[ins]);
print_space(os, max_ins_len - ss.str().length()); double percent = std::ceil(100.0 * avg / total_instruction_time);
os << "\t"; os << ": " << avg << "ms, " << percent << "%";
double avg = common_average(ins_vec[ins]); os << std::endl;
print_ins_perf(os, titles, ins, avg, total_instruction_time);
}); });
os << std::endl; os << std::endl;
......
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