Browse Source

Sort histogram printout count, rather than address

pull/1192/head
Andrew Waterman 3 years ago
parent
commit
ea70167d28
  1. 8
      riscv/processor.cc

8
riscv/processor.cc

@ -75,8 +75,12 @@ processor_t::~processor_t()
#ifdef RISCV_ENABLE_HISTOGRAM
if (histogram_enabled)
{
fprintf(stderr, "PC Histogram size:%zu\n", pc_histogram.size());
for (auto it : pc_histogram)
std::vector<std::pair<reg_t, uint64_t>> ordered_histo(pc_histogram.begin(), pc_histogram.end());
std::sort(ordered_histo.begin(), ordered_histo.end(),
[](auto& lhs, auto& rhs) { return lhs.second < rhs.second; });
fprintf(stderr, "PC Histogram size:%zu\n", ordered_histo.size());
for (auto it : ordered_histo)
fprintf(stderr, "%0" PRIx64 " %" PRIu64 "\n", it.first, it.second);
}
#endif

Loading…
Cancel
Save