int undo_all (void) { int failures = 0; htab_traverse (prelink_filename_htab, undo_one, &failures); return failures != 0; }
void dump_vec_loc_statistics (void) { int nentries = 0; char s[4096]; size_t allocated = 0; size_t times = 0; int i; if (! GATHER_STATISTICS) return; loc_array = XCNEWVEC (struct vec_descriptor *, vec_desc_hash->n_elements); fprintf (stderr, "Heap vectors:\n"); fprintf (stderr, "\n%-48s %10s %10s %10s\n", "source location", "Leak", "Peak", "Times"); fprintf (stderr, "-------------------------------------------------------\n"); htab_traverse (vec_desc_hash, add_statistics, &nentries); qsort (loc_array, nentries, sizeof (*loc_array), cmp_statistic); for (i = 0; i < nentries; i++) { struct vec_descriptor *d = loc_array[i]; allocated += d->allocated; times += d->times; } for (i = 0; i < nentries; i++) { struct vec_descriptor *d = loc_array[i]; const char *s1 = d->file; const char *s2; while ((s2 = strstr (s1, "gcc/"))) s1 = s2 + 4; sprintf (s, "%s:%i (%s)", s1, d->line, d->function); s[48] = 0; fprintf (stderr, "%-48s %10li:%4.1f%% %10li %10li:%4.1f%% \n", s, (long)d->allocated, (d->allocated) * 100.0 / allocated, (long)d->peak, (long)d->times, (d->times) * 100.0 / times); } fprintf (stderr, "%-48s %10ld %10ld\n", "Total", (long)allocated, (long)times); fprintf (stderr, "\n%-48s %10s %10s %10s\n", "source location", "Leak", "Peak", "Times"); fprintf (stderr, "-------------------------------------------------------\n"); }
/* Output per-varray memory usage statistics. */ void dump_varray_statistics (void) { #ifdef GATHER_STATISTICS struct output_info info; fprintf (stderr, "\nVARRAY Kind Count Bytes Resized copied\n"); fprintf (stderr, "-------------------------------------------------------\n"); info.count = 0; info.size = 0; htab_traverse (varray_hash, print_statistics, &info); fprintf (stderr, "-------------------------------------------------------\n"); fprintf (stderr, "%-20s %7d %10d\n", "Total", info.count, info.size); fprintf (stderr, "-------------------------------------------------------\n"); #endif }
/* Write out the complete conditions table, its size, and a flag indicating that gensupport.c can now do insn elision. */ static void write_conditions (void) { puts ("\ /* This table lists each condition found in the machine description.\n\ Each condition is mapped to its truth value (0 or 1), or -1 if that\n\ cannot be calculated at compile time. */\n\ \n\ const struct c_test insn_conditions[] = {"); htab_traverse (condition_table, write_one_condition, 0); puts ("};\n"); printf ("const size_t n_insn_conditions = %lu;\n", (unsigned long) htab_elements (condition_table)); puts ("const int insn_elision_unavailable = 0;\n#endif"); }