1111// ===----------------------------------------------------------------------===//
1212
1313#include " rtsan/rtsan_stats.h"
14+ #include " rtsan/rtsan_flags.h"
1415
1516#include " sanitizer_common/sanitizer_atomic.h"
1617#include " sanitizer_common/sanitizer_common.h"
@@ -20,6 +21,7 @@ using namespace __rtsan;
2021
2122static atomic_uint32_t rtsan_total_error_count{0 };
2223static atomic_uint32_t rtsan_unique_error_count{0 };
24+ static atomic_uint32_t rtsan_suppressed_count{0 };
2325
2426void __rtsan::IncrementTotalErrorCount () {
2527 atomic_fetch_add (&rtsan_total_error_count, 1 , memory_order_relaxed);
@@ -37,9 +39,20 @@ static u32 GetUniqueErrorCount() {
3739 return atomic_load (&rtsan_unique_error_count, memory_order_relaxed);
3840}
3941
42+ void __rtsan::IncrementSuppressedCount () {
43+ atomic_fetch_add (&rtsan_suppressed_count, 1 , memory_order_relaxed);
44+ }
45+
46+ static u32 GetSuppressedCount () {
47+ return atomic_load (&rtsan_suppressed_count, memory_order_relaxed);
48+ }
49+
4050void __rtsan::PrintStatisticsSummary () {
4151 ScopedErrorReportLock l;
4252 Printf (" RealtimeSanitizer exit stats:\n " );
4353 Printf (" Total error count: %u\n " , GetTotalErrorCount ());
4454 Printf (" Unique error count: %u\n " , GetUniqueErrorCount ());
55+
56+ if (flags ().ContainsSuppresionFile ())
57+ Printf (" Suppression count: %u\n " , GetSuppressedCount ());
4558}
0 commit comments