CSI Guide
← Prev Next →

CSI Output: Metadata


General

To extract static instrumentation metadata, use the extract-cfg and extract-section tools in the Tools directory of this release. The tools requires the following non-standard packages:

They also require the application objdump, which is standard on most Unix-based operating systems.

Control-flow Graph

CSI embeds the LLVM bitcode necessary to extract an annotated representation of the program's control-flow graph from generated object files and executables. Note that in the case of multiple object files linked into a single executable, the executable contains the complete bitcode necessary to build the whole-program control-flow graph. To extract the graph, use a command similar to
Tools/extract-cfg myexe output-file

The graph is extracted in GraphML format, with appropriate node and edge annotations for running CSI analysis tools.

Path Tracing

Path Tracing metadata is stored as text in the debug section .debug_PT of the object file or executable. Note that in the case of multiple object files linked into a single executable, the executable contains the complete metadata consolidated from all object files. To extract this data, use a command similar to
Tools/extract-section --require .debug_PT myexe

For details about the format of the Path Tracing metadata, please see the Path Tracing page.

Program Coverage

csi-cc currently supports three variants of program coverage instrumentation: function coverage, call-site coverage, and statement coverage. The metadata for each granularity of program coverage is stored as text in the respective debug section:

Note that in the case of multiple object files linked into a single executable, the executable contains the complete metadata consolidated from all object files. As an example, to extract call coverage data, use a command similar to
Tools/extract-section --require .debug_CC myexe

For details about the format of the Program Coverage metadata, please see the Program Coverage page.

OSX

Section names in Mach-O executables are named slightly differently than those in ELF executables. Specifically, all section names should be preceded by __CSI. Thus, the metadata sections above are named as follows:


← Prev Next →