Contents
Execution tracers are S2E analysis plugins that record various information along the execution of each path. Here is a list of currently available plugins:
Most of the tracers record information only for the configured modules (except ExecutionTracer, which records forks anywhere in the system). For this, tracers need to know when execution enters and leaves the modules of interest. Tracers rely on the ModuleExecutionDetector plugin to obtain this information. ModuleExecutionDetector relies itself on OS monitor plugins to be notified whenever the OS loads or unloads the modules.
Here is an end-to-end example of how to generate an execution trace for the echo utility using the init_env.so library. The trace will contain all memory accesses done by echo, as well as the list of executed translation blocks and test cases.
s2e = { kleeArgs = {} } plugins = { "BaseInstructions", "ExecutionTracer", "ModuleTracer", "RawMonitor", "ModuleExecutionDetector", --The following plugins can be enabled as needed "MemoryTracer", "TestCaseGenerator", "TranslationBlockTracer" } pluginsConfig = {} pluginsConfig.MemoryTracer = { monitorMemory = true, monitorModules = true, }
Preparing the guest program for tracing is easy. The init_env.so library will instruct S2E to trace the program as specified in the configuration file.
$ LD_PRELOAD=/home/s2e/init_env.so /bin/echo abc ab > /dev/null
S2E comes with several tools that parse and display the execution traces. They are located in the tools folder of the source distribution. You can find the documentation for them on the main page.
Here is an example that prints the list of executed translation blocks and all memory accesses performed in paths #0 and #34.
$ $S2EDIR/build/tools/Release+Asserts/bin/tbtrace -trace=s2e-last/ExecutionTracer.dat \ -outputdir=s2e-last/traces -pathId=0 -pathId=34 -printMemory