aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov-io.h
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2013-04-03 20:51:28 +0000
committerTeresa Johnson <tejohnson@gcc.gnu.org>2013-04-03 20:51:28 +0000
commitf57ddb5b51e1fe78398c3006f383540eacdc1118 (patch)
treeadc203a589f57f6641e15408a2579a630f743208 /gcc/gcov-io.h
parent5e0919f1eecbb00fdcf16ff7e064be122fd0bbfc (diff)
downloadgcc-f57ddb5b51e1fe78398c3006f383540eacdc1118.zip
gcc-f57ddb5b51e1fe78398c3006f383540eacdc1118.tar.gz
gcc-f57ddb5b51e1fe78398c3006f383540eacdc1118.tar.bz2
This patch enables the gcov-dump tool to optionally compute and dump the working set information from the counter histogram...
This patch enables the gcov-dump tool to optionally compute and dump the working set information from the counter histogram, via a new -w option. This is useful to help understand and tune how the compiler will use the counter histogram, since it first computes the working set and selects thresholds based on that. This required moving the bulk of the compute_working_sets functionality into gcov-io.c so that it was accessible by gcov-dump.c. 2013-04-03 Teresa Johnson <tejohnson@google.com> * gcov-io.c (compute_working_sets): Moved most of body of old compute_working_sets here from profile.c. * gcov-io.h (NUM_GCOV_WORKING_SETS): Moved here from profile.c. (gcov_working_set_t): Moved typedef here from basic-block.h (compute_working_set): Declare. * profile.c (NUM_GCOV_WORKING_SETS): Moved to gcov-io.h. (get_working_sets): Renamed from compute_working_set, replace most of body with call to new compute_working_sets. (get_exec_counts): Replace call to compute_working_sets to get_working_sets. * profile.h (get_working_sets): Renamed from compute_working_set. * lto-cgraph.c (input_symtab): Replace call to compute_working_sets to get_working_sets. * basic-block.h (gcov_working_set_t): Moved to gcov-io.h. * gcov-dump.c (dump_working_sets): New function. From-SVN: r197457
Diffstat (limited to 'gcc/gcov-io.h')
-rw-r--r--gcc/gcov-io.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index 98efa76..08fe7b9 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -617,6 +617,28 @@ GCOV_LINKAGE gcov_position_t gcov_write_tag (gcov_unsigned_t);
GCOV_LINKAGE void gcov_write_length (gcov_position_t /*position*/);
#endif
+#if IN_GCOV <= 0 && !IN_LIBGCOV
+/* Available in gcov-dump and the compiler. */
+
+/* Number of data points in the working set summary array. Using 128
+ provides information for at least every 1% increment of the total
+ profile size. The last entry is hardwired to 99.9% of the total. */
+#define NUM_GCOV_WORKING_SETS 128
+
+/* Working set size statistics for a given percentage of the entire
+ profile (sum_all from the counter summary). */
+typedef struct gcov_working_set_info
+{
+ /* Number of hot counters included in this working set. */
+ unsigned num_counters;
+ /* Smallest counter included in this working set. */
+ gcov_type min_counter;
+} gcov_working_set_t;
+
+GCOV_LINKAGE void compute_working_sets (const struct gcov_ctr_summary *summary,
+ gcov_working_set_t *gcov_working_sets);
+#endif
+
#if IN_GCOV > 0
/* Available in gcov */
GCOV_LINKAGE time_t gcov_time (void);