aboutsummaryrefslogtreecommitdiff
path: root/libgcc/libgcov.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-01-22 11:27:16 +0100
committerMartin Liska <mliska@suse.cz>2021-01-25 13:30:34 +0100
commit5089df534b85b795bfcdca8f4f1957ad15a60558 (patch)
treef21b8220b0cd8cbcba3210bd32e229a3b62cacce /libgcc/libgcov.h
parentdefc40db9e09ecceb2d71727031fe9579bce1b11 (diff)
downloadgcc-5089df534b85b795bfcdca8f4f1957ad15a60558.zip
gcc-5089df534b85b795bfcdca8f4f1957ad15a60558.tar.gz
gcc-5089df534b85b795bfcdca8f4f1957ad15a60558.tar.bz2
Restore profile reproducibility.
gcc/ChangeLog: PR gcov-profile/98739 * common.opt: Add missing sign symbol. * value-prof.c (get_nth_most_common_value): Restore handling of PROFILE_REPRODUCIBILITY_PARALLEL_RUNS and PROFILE_REPRODUCIBILITY_MULTITHREADED. libgcc/ChangeLog: PR gcov-profile/98739 * libgcov-merge.c (__gcov_merge_topn): Mark when merging ends with a dropped counter. * libgcov.h (gcov_topn_add_value): Add return value.
Diffstat (limited to 'libgcc/libgcov.h')
-rw-r--r--libgcc/libgcov.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index b4a7e94..df08e88 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -435,9 +435,10 @@ allocate_gcov_kvp (void)
/* Add key value pair VALUE:COUNT to a top N COUNTERS. When INCREMENT_TOTAL
is true, add COUNT to total of the TOP counter. If USE_ATOMIC is true,
- do it in atomic way. */
+ do it in atomic way. Return true when the counter is full, otherwise
+ return false. */
-static inline void
+static inline unsigned
gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count,
int use_atomic, int increment_total)
{
@@ -453,7 +454,7 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count,
if (current_node->value == value)
{
gcov_counter_add (&current_node->count, count, use_atomic);
- return;
+ return 0;
}
if (minimal_node == NULL
@@ -471,12 +472,14 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count,
minimal_node->value = value;
minimal_node->count = count;
}
+
+ return 1;
}
else
{
struct gcov_kvp *new_node = allocate_gcov_kvp ();
if (new_node == NULL)
- return;
+ return 0;
new_node->value = value;
new_node->count = count;
@@ -515,6 +518,8 @@ gcov_topn_add_value (gcov_type *counters, gcov_type value, gcov_type count,
if (success)
gcov_counter_add (&counters[1], 1, use_atomic);
}
+
+ return 0;
}
#endif /* !inhibit_libc */