This is an archive of the discontinued LLVM Phabricator instance.

Comprehensive static instrumentation (1/3): LLVM pass
AbandonedPublic

Authored by tdenniston on Jun 16 2016, 12:51 PM.

Details

Summary

The Comprehensive Static Instrumentation (CSI) framework provides static instrumentation that a compiler inserts into a program-under-test so that dynamic-analysis tools -- memory checkers, race detectors, cache simulators, performance profilers, code-coverage analyzers, etc. -- can observe and investigate runtime behavior. Heretofore, tools based on compiler instrumentation would each separately modify the compiler to insert their own instrumentation. In contrast, CSI inserts a standard collection of instrumentation hooks into the program-under-test. Each CSI-tool is implemented as a library that defines relevant hooks, and the remaining hooks are "nulled'" out and elided during link-time optimization (LTO), resulting in instrumented runtimes on par with custom instrumentation. CSI allows many compiler-based tools to be written as simple libraries without modifying the compiler, greatly lowering the bar for developing dynamic-analysis tools.

This diff encompasses the compiler pass for CSI. For an extended usage doc, please see the docs/CSI.rst document submitted with the clang diff.

We know that this code requires changes, additions, more tests, cleanup, etc. We've asked our Google sponsors for help on these points, but any additional help would be greatly appreciated.

Diff Detail

Repository
rL LLVM

Event Timeline

tdenniston retitled this revision from to Comprehensive static instrumentation (1/3): LLVM pass.
tdenniston updated this object.
tdenniston added reviewers: kcc, zhaoqin, bruening.
tdenniston set the repository for this revision to rL LLVM.
tdenniston added a project: Restricted Project.
tdenniston added subscribers: eugenis, pcc, vitalybuka and 2 others.
kcc edited edge metadata.Jun 16 2016, 2:35 PM

(only have time for a shallow scan, may do another one tomorrow)

lib/Transforms/Instrumentation/ComprehensiveStaticInstrumentation.cpp
38

watch for redundant {}

48
if (DISubprogram *Subprog = ...) {
    ...
}

here and below

340

nullptr

neboat updated this object.Jun 16 2016, 2:52 PM
neboat edited edge metadata.
tdenniston abandoned this revision.Jun 27 2016, 7:53 AM

Abandoning. We are resubmitting the CSI patches in smaller increments.