[compiler-rt] r352263 - [libFuzzer] print uncovered functions when doing -print_coverage=1
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 25 17:33:09 PST 2019
Author: kcc
Date: Fri Jan 25 17:33:09 2019
New Revision: 352263
URL: http://llvm.org/viewvc/llvm-project?rev=352263&view=rev
Log:
[libFuzzer] print uncovered functions when doing -print_coverage=1
Modified:
compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp
compiler-rt/trunk/test/fuzzer/coverage.test
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp?rev=352263&r1=352262&r2=352263&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.cpp Fri Jan 25 17:33:09 2019
@@ -245,8 +245,7 @@ void TracePC::IterateCoveredFunctions(Ca
do {
NextFE++;
} while (NextFE < M.Stop && !(NextFE->PCFlags & 1));
- if (ObservedFuncs.count(FE->PC))
- CB(FE, NextFE, ObservedFuncs[FE->PC]);
+ CB(FE, NextFE, ObservedFuncs[FE->PC]);
}
}
}
@@ -311,12 +310,13 @@ void TracePC::PrintCoverage() {
for (auto TE = First; TE < Last; TE++)
if (!ObservedPCs.count(TE->PC))
UncoveredPCs.push_back(TE->PC);
- Printf("COVERED_FUNC: hits: %zd", Counter);
+ Printf("%sCOVERED_FUNC: hits: %zd", Counter ? "" : "UN", Counter);
Printf(" edges: %zd/%zd", NumEdges - UncoveredPCs.size(), NumEdges);
Printf(" %s %s:%zd\n", FunctionStr.c_str(), FileStr.c_str(), Line);
- for (auto PC: UncoveredPCs)
- Printf(" UNCOVERED_PC: %s\n",
- DescribePC("%s:%l", GetNextInstructionPc(PC)).c_str());
+ if (Counter)
+ for (auto PC : UncoveredPCs)
+ Printf(" UNCOVERED_PC: %s\n",
+ DescribePC("%s:%l", GetNextInstructionPc(PC)).c_str());
};
IterateCoveredFunctions(CoveredFunctionCallback);
Modified: compiler-rt/trunk/test/fuzzer/coverage.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/coverage.test?rev=352263&r1=352262&r2=352263&view=diff
==============================================================================
--- compiler-rt/trunk/test/fuzzer/coverage.test (original)
+++ compiler-rt/trunk/test/fuzzer/coverage.test Fri Jan 25 17:33:09 2019
@@ -17,3 +17,4 @@ DSO-DAG: COVERED_FUNC:{{.*}}LLVMFuzzerTe
DSO-DAG: UNCOVERED_PC:{{.*}}1
DSO-DAG: UNCOVERED_PC:{{.*}}2
DSO-DAG: UNCOVERED_PC:{{.*}}DSOTestMain
+DSO-DAG: UNCOVERED_FUNC:{{.*}}Uncovered1
More information about the llvm-commits
mailing list