diff options
author | David Edelsohn <dje.gcc@gmail.com> | 1997-05-02 00:32:05 +0000 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 1997-05-02 00:32:05 +0000 |
commit | 2317a49939905f8aeb16b62ee6bd5e1f661f1357 (patch) | |
tree | df20e2ea7999f8c468bda6f24938ebc163f65007 /sim/common/cgen-scache.c | |
parent | 3e324f89cd814b515a6de171197708c3c4dcac73 (diff) | |
download | gdb-2317a49939905f8aeb16b62ee6bd5e1f661f1357.zip gdb-2317a49939905f8aeb16b62ee6bd5e1f661f1357.tar.gz gdb-2317a49939905f8aeb16b62ee6bd5e1f661f1357.tar.bz2 |
* sim-utils.c (sim_add_commas): New function.
* sim-basics.h (sim_add_commas): Add prototype.
* cgen-scache.c (scache_print_profile): Print commas in numbers.
* sim-profile.c (COMMAS): New macro.
(print_*): Use it to print commas in numbers.
Diffstat (limited to 'sim/common/cgen-scache.c')
-rw-r--r-- | sim/common/cgen-scache.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c index 05ce399..e205c9b 100644 --- a/sim/common/cgen-scache.c +++ b/sim/common/cgen-scache.c @@ -182,13 +182,17 @@ scache_print_profile (SIM_CPU *cpu, int verbose) SIM_DESC sd = CPU_STATE (cpu); unsigned long hits = CPU_SCACHE_HITS (cpu); unsigned long misses = CPU_SCACHE_MISSES (cpu); + char buf[20]; sim_io_printf (sd, "Simulator Cache Statistics\n\n"); /* One could use PROFILE_LABEL_WIDTH here. I chose not to. */ - sim_io_printf (sd, " Cache size: %d\n", CPU_SCACHE_SIZE (cpu)); - sim_io_printf (sd, " Hits: %d\n", hits); - sim_io_printf (sd, " Misses: %d\n", misses); + sim_io_printf (sd, " Cache size: %d\n", + sim_add_commas (buf, sizeof (buf), CPU_SCACHE_SIZE (cpu))); + sim_io_printf (sd, " Hits: %s\n", + sim_add_commas (buf, sizeof (buf), hits)); + sim_io_printf (sd, " Misses: %s\n", + sim_add_commas (buf, sizeof (buf), misses)); if (hits + misses != 0) sim_io_printf (sd, " Hit rate: %.2f%%\n", ((double) hits / ((double) hits + (double) misses)) * 100); |