diff options
author | Andrew Waterman <andrew@sifive.com> | 2023-01-05 07:47:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-05 07:47:07 -0800 |
commit | 32742924154a41e457f5b64e745485a3ebcd0daf (patch) | |
tree | 6e43b6860f983be0fe6bdd053458d2fdefe0e0bf | |
parent | 0eec0c911933ccc722d4b4479a6c4b8ac68f2f52 (diff) | |
parent | 571945ca6e55191866aefe62ec4d9d17145cc174 (diff) | |
download | riscv-isa-sim-32742924154a41e457f5b64e745485a3ebcd0daf.zip riscv-isa-sim-32742924154a41e457f5b64e745485a3ebcd0daf.tar.gz riscv-isa-sim-32742924154a41e457f5b64e745485a3ebcd0daf.tar.bz2 |
Merge pull request #1211 from riscv-software-src/speed-up-slow-path
Only update histogram when histogramming
-rw-r--r-- | riscv/execute.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index cd6ae1a..b093e72 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -150,9 +150,10 @@ static void commit_log_print_insn(processor_t *p, reg_t pc, insn_t insn) fprintf(log_file, "\n"); } -inline void processor_t::update_histogram(reg_t UNUSED pc) +inline void processor_t::update_histogram(reg_t pc) { - pc_histogram[pc]++; + if (histogram_enabled) + pc_histogram[pc]++; } // These two functions are expected to be inlined by the compiler separately in |