This is an archive of the discontinued LLVM Phabricator instance.

[sancov] add tracing for loads and store
ClosedPublic

Authored by kcc on Nov 8 2021, 5:57 PM.

Details

Summary

add tracing for loads and stores.

The primary goal is to have more options for data-flow-guided fuzzing,
i.e. use data flow insights to perform better mutations or more agressive corpus expansion.
But the feature is general puspose, could be used for other things too.

Pipe the flag though clang and clang driver, same as for the other SanitizerCoverage flags.
While at it, change some plain arrays into std::array.

Tests: clang flags test, LLVM IR test, compiler-rt executable test.

Diff Detail

Unit TestsFailed

Event Timeline

kcc created this revision.Nov 8 2021, 5:57 PM
kcc requested review of this revision.Nov 8 2021, 5:57 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptNov 8 2021, 5:57 PM
Herald added subscribers: llvm-commits, Restricted Project, cfe-commits. · View Herald Transcript
morehouse accepted this revision.Nov 9 2021, 8:04 AM
morehouse added inline comments.
clang/test/Driver/autocomplete.c
73

This check is failing in the harbormaster build: https://reviews.llvm.org/harbormaster/unit/view/1482705/

compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_loads_stores.cpp
5

According to the documentation update in this patch, these flags don't work without trace-pc or inline-8bit-counters.

llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
719–720

nit

This revision is now accepted and ready to land.Nov 9 2021, 8:04 AM
kcc updated this revision to Diff 385883.Nov 9 2021, 10:26 AM

addressed review comments

kcc marked an inline comment as done.Nov 9 2021, 10:29 AM
kcc added inline comments.
clang/test/Driver/autocomplete.c
73

removed

compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_loads_stores.cpp
5

Right.
"func" is sort of synonym for trace-pc,func, but it's not worth the confusion in the test.
changed to trace-pc

This revision was landed with ongoing or failed builds.Nov 9 2021, 2:35 PM
This revision was automatically updated to reflect the committed changes.