diff options
author | Martin Liska <mliska@suse.cz> | 2018-06-05 10:13:31 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-06-05 08:13:31 +0000 |
commit | 7f3577f5285957c1aa48823ce6c691f8c212b219 (patch) | |
tree | 5127bd697a20fb3805447c7cd1857b52f04112ae /gcc/gcov-dump.c | |
parent | 632b10e14156db1e429f623628ad4f270c1550c4 (diff) | |
download | gcc-7f3577f5285957c1aa48823ce6c691f8c212b219.zip gcc-7f3577f5285957c1aa48823ce6c691f8c212b219.tar.gz gcc-7f3577f5285957c1aa48823ce6c691f8c212b219.tar.bz2 |
Simplify gcov_histogram as it's used only for ARCS counters.
2018-06-05 Martin Liska <mliska@suse.cz>
* auto-profile.c (read_autofdo_file): Do not use
gcov_ctr_summary struct.
(afdo_callsite_hot_enough_for_early_inline): Likewise.
* coverage.c (struct counts_entry): Likewise.
(read_counts_file): Read just single summary entry.
(get_coverage_counts): Use gcov_summary struct.
* coverage.h (get_coverage_counts): Likewise.
* gcov-dump.c (dump_working_sets): Likewise.
(tag_summary): Dump just single summary.
* gcov-io.c (gcov_write_summary): Write just histogram
summary.
(gcov_read_summary): Read just single summary.
(compute_working_sets): Use gcov_summary struct.
* gcov-io.h (GCOV_TAG_SUMMARY_LENGTH): Remove usage
of GCOV_COUNTERS_SUMMABLE.
(GCOV_COUNTERS_SUMMABLE): Remove.
(GCOV_FIRST_VALUE_COUNTER): Replace with
GCOV_COUNTER_V_INTERVAL.
(struct gcov_ctr_summary): Remove.
(struct gcov_summary): Directly use fields of former
gcov_ctr_summary.
(compute_working_sets): Use gcov_summary struct.
* gcov.c (read_count_file): Do not use ctrs fields.
* lto-cgraph.c (merge_profile_summaries): Use gcov_summary
struct.
* lto-streamer.h (struct GTY): Make profile_info gcov_summary
struct.
* profile.c: Likewise.
* profile.h: Likewise.
2018-06-05 Martin Liska <mliska@suse.cz>
* libgcov-driver.c (gcov_compute_histogram): Remove usage
of gcov_ctr_summary.
(compute_summary): Do it just for a single summary.
(merge_one_data): Likewise.
(merge_summary): Simplify as we read just single summary.
(dump_one_gcov): Pass proper argument.
* libgcov-util.c (compute_one_gcov): Simplify as we have just
single summary.
(gcov_info_count_all_cold): Likewise.
(calculate_overlap): Likewise.
From-SVN: r261189
Diffstat (limited to 'gcc/gcov-dump.c')
-rw-r--r-- | gcc/gcov-dump.c | 63 |
1 files changed, 29 insertions, 34 deletions
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c index 0ae7e94..3ff11a6 100644 --- a/gcc/gcov-dump.c +++ b/gcc/gcov-dump.c @@ -39,7 +39,7 @@ static void tag_lines (const char *, unsigned, unsigned, unsigned); static void tag_counters (const char *, unsigned, unsigned, unsigned); static void tag_summary (const char *, unsigned, unsigned, unsigned); static void dump_working_sets (const char *filename ATTRIBUTE_UNUSED, - const struct gcov_ctr_summary *summary, + const gcov_summary *summary, unsigned depth); extern int main (int, char **); @@ -467,52 +467,47 @@ tag_summary (const char *filename ATTRIBUTE_UNUSED, unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED, unsigned depth) { - struct gcov_summary summary; - unsigned ix, h_ix; + gcov_summary summary; + unsigned h_ix; gcov_bucket_type *histo_bucket; gcov_read_summary (&summary); printf (" checksum=0x%08x", summary.checksum); - for (ix = 0; ix != GCOV_COUNTERS_SUMMABLE; ix++) + printf ("\n"); + print_prefix (filename, depth, 0); + printf (VALUE_PADDING_PREFIX "counts=%u, runs=%u", + summary.num, summary.runs); + + printf (", sum_all=%" PRId64, + (int64_t)summary.sum_all); + printf (", run_max=%" PRId64, + (int64_t)summary.run_max); + printf (", sum_max=%" PRId64, + (int64_t)summary.sum_max); + printf ("\n"); + print_prefix (filename, depth, 0); + printf (VALUE_PADDING_PREFIX "counter histogram:"); + for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++) { + histo_bucket = &summary.histogram[h_ix]; + if (!histo_bucket->num_counters) + continue; printf ("\n"); print_prefix (filename, depth, 0); - printf (VALUE_PADDING_PREFIX "counts=%u, runs=%u", - summary.ctrs[ix].num, summary.ctrs[ix].runs); - - printf (", sum_all=%" PRId64, - (int64_t)summary.ctrs[ix].sum_all); - printf (", run_max=%" PRId64, - (int64_t)summary.ctrs[ix].run_max); - printf (", sum_max=%" PRId64, - (int64_t)summary.ctrs[ix].sum_max); - if (ix != GCOV_COUNTER_ARCS) - continue; - printf ("\n"); - print_prefix (filename, depth, 0); - printf (VALUE_PADDING_PREFIX "counter histogram:"); - for (h_ix = 0; h_ix < GCOV_HISTOGRAM_SIZE; h_ix++) - { - histo_bucket = &summary.ctrs[ix].histogram[h_ix]; - if (!histo_bucket->num_counters) - continue; - printf ("\n"); - print_prefix (filename, depth, 0); - printf (VALUE_PADDING_PREFIX VALUE_PREFIX "num counts=%u, " - "min counter=%" PRId64 ", cum_counter=%" PRId64, - h_ix, histo_bucket->num_counters, - (int64_t)histo_bucket->min_value, - (int64_t)histo_bucket->cum_value); - } - if (flag_dump_working_sets) - dump_working_sets (filename, &summary.ctrs[ix], depth); + printf (VALUE_PADDING_PREFIX VALUE_PREFIX "num counts=%u, " + "min counter=%" PRId64 ", cum_counter=%" PRId64, + h_ix, histo_bucket->num_counters, + (int64_t)histo_bucket->min_value, + (int64_t)histo_bucket->cum_value); } + if (flag_dump_working_sets) + dump_working_sets (filename, &summary, depth); } static void dump_working_sets (const char *filename ATTRIBUTE_UNUSED, - const struct gcov_ctr_summary *summary, + const gcov_summary *summary, unsigned depth) { gcov_working_set_t gcov_working_sets[NUM_GCOV_WORKING_SETS]; |