From 2317a49939905f8aeb16b62ee6bd5e1f661f1357 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Fri, 2 May 1997 00:32:05 +0000 Subject: * 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. --- sim/common/cgen-scache.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sim/common/cgen-scache.c') 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); -- cgit v1.1