[compiler-rt] r330391 - [LibFuzzer] Report when custom counters are available.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 23:46:19 PDT 2018


Author: delcypher
Date: Thu Apr 19 23:46:19 2018
New Revision: 330391

URL: http://llvm.org/viewvc/llvm-project?rev=330391&view=rev
Log:
[LibFuzzer] Report when custom counters are available.

This upstreams a feature from the JFS solver's fork of LibFuzzer.

Differential Revision: https://reviews.llvm.org/D45675

Modified:
    compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp
    compiler-rt/trunk/test/fuzzer/extra-counters.test

Modified: compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp?rev=330391&r1=330390&r2=330391&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp Thu Apr 19 23:46:19 2018
@@ -134,6 +134,9 @@ void TracePC::PrintModuleInfo() {
   }
   if (size_t NumClangCounters = ClangCountersEnd() - ClangCountersBegin())
     Printf("INFO: %zd Clang Coverage Counters\n", NumClangCounters);
+
+  if (size_t NumExtraCounters = ExtraCountersEnd() - ExtraCountersBegin())
+    Printf("INFO: %zd Extra Counters\n", NumExtraCounters);
 }
 
 ATTRIBUTE_NO_SANITIZE_ALL

Modified: compiler-rt/trunk/test/fuzzer/extra-counters.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/extra-counters.test?rev=330391&r1=330390&r2=330391&view=diff
==============================================================================
--- compiler-rt/trunk/test/fuzzer/extra-counters.test (original)
+++ compiler-rt/trunk/test/fuzzer/extra-counters.test Thu Apr 19 23:46:19 2018
@@ -2,6 +2,7 @@ REQUIRES: linux
 
 RUN: %cpp_compiler %S/TableLookupTest.cpp -o %t-TableLookupTest
 RUN: not %t-TableLookupTest -print_final_stats=1 2>&1 | FileCheck %s
+CHECK: INFO: {{[0-9]+}} Extra Counters
 CHECK: BINGO
 // Expecting >= 4096 new_units_added
 CHECK: stat::new_units_added:{{.*[4][0-9][0-9][0-9]}}




More information about the llvm-commits mailing list