aboutsummaryrefslogtreecommitdiff
path: root/libcpp/symtab.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-02-26 18:27:52 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-02-26 17:27:52 +0000
commit60448173c4fc67032eb30e6e189055d7c97ceafd (patch)
tree4418776fc5d2c76154a2e422ee0e2dbd0379bf37 /libcpp/symtab.c
parent24f0c84247c433826b6309b59151985d1e8893d5 (diff)
downloadgcc-60448173c4fc67032eb30e6e189055d7c97ceafd.zip
gcc-60448173c4fc67032eb30e6e189055d7c97ceafd.tar.gz
gcc-60448173c4fc67032eb30e6e189055d7c97ceafd.tar.bz2
Improve memory statistics report readability.
2019-02-26 Martin Liska <mliska@suse.cz> * alloc-pool.h (struct pool_usage): Remove extra print_dash_line. * bitmap.h (struct bitmap_usage): Likewise. * ggc-common.c (struct ggc_usage): Likewise. * mem-stats.h (struct mem_usage): Likewise. (mem_alloc_description::dump): Print dash lines here and repeat header at the end of a table report. It's then more readable. * tree-phinodes.c (phinodes_print_statistics): Make horizontal alignment. * tree-ssanames.c (ssanames_print_statistics): Likewise. * vec.c (struct vec_usage): Remove extra print_dash_line. * vec.h (vec_safe_grow_cleared): Pass PASS_MEM_STAT. 2019-02-26 Martin Liska <mliska@suse.cz> * symtab.c (ht_dump_statistics): Make horizontal alignment for statistics. From-SVN: r269221
Diffstat (limited to 'libcpp/symtab.c')
-rw-r--r--libcpp/symtab.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libcpp/symtab.c b/libcpp/symtab.c
index 26c094e..5048b47 100644
--- a/libcpp/symtab.c
+++ b/libcpp/symtab.c
@@ -306,39 +306,41 @@ ht_dump_statistics (cpp_hash_table *table)
nelts = table->nelements;
headers = table->nslots * sizeof (hashnode);
- fprintf (stderr, "\nString pool\nentries\t\t%lu\n",
+ fprintf (stderr, "\nString pool\n%-32s%lu\n", "entries:",
(unsigned long) nelts);
- fprintf (stderr, "identifiers\t%lu (%.2f%%)\n",
+ fprintf (stderr, "%-32s%lu (%.2f%%)\n", "identifiers:",
(unsigned long) nids, nids * 100.0 / nelts);
- fprintf (stderr, "slots\t\t%lu\n",
+ fprintf (stderr, "%-32s%lu\n", "slots:",
(unsigned long) table->nslots);
- fprintf (stderr, "deleted\t\t%lu\n",
+ fprintf (stderr, "%-32s%lu\n", "deleted:",
(unsigned long) deleted);
if (table->alloc_subobject)
- fprintf (stderr, "GGC bytes\t%lu%c\n",
+ fprintf (stderr, "%-32s%lu%c\n", "GGC bytes:",
SCALE (total_bytes), LABEL (total_bytes));
else
{
overhead = obstack_memory_used (&table->stack) - total_bytes;
- fprintf (stderr, "obstack bytes\t%lu%c (%lu%c overhead)\n",
+ fprintf (stderr, "%-32s%lu%c (%lu%c overhead)\n",
+ "obstack bytes:",
SCALE (total_bytes), LABEL (total_bytes),
SCALE (overhead), LABEL (overhead));
}
- fprintf (stderr, "table size\t%lu%c\n",
+ fprintf (stderr, "%-32s%lu%c\n", "table size:",
SCALE (headers), LABEL (headers));
exp_len = (double)total_bytes / (double)nelts;
exp2_len = exp_len * exp_len;
exp_len2 = (double) sum_of_squares / (double) nelts;
- fprintf (stderr, "coll/search\t%.4f\n",
+ fprintf (stderr, "%-32s%.4f\n", "coll/search:",
(double) table->collisions / (double) table->searches);
- fprintf (stderr, "ins/search\t%.4f\n",
+ fprintf (stderr, "%-32s%.4f\n", "ins/search:",
(double) nelts / (double) table->searches);
- fprintf (stderr, "avg. entry\t%.2f bytes (+/- %.2f)\n",
+ fprintf (stderr, "%-32s%.2f bytes (+/- %.2f)\n",
+ "avg. entry:",
exp_len, approx_sqrt (exp_len2 - exp2_len));
- fprintf (stderr, "longest entry\t%lu\n",
+ fprintf (stderr, "%-32s%lu\n", "longest entry:",
(unsigned long) longest);
#undef SCALE
#undef LABEL