From 8638a292d55f48f6c2071e70f611bb6641d9952a Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Sun, 2 Oct 2022 13:07:18 +1100 Subject: [PATCH] cleaning tools dir --- README.md | 15 +++++++++++++++ tools/CMakeLists.txt | 18 +++--------------- tools/{inst-stats.cpp => dataflow-stats.cpp} | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) rename tools/{inst-stats.cpp => dataflow-stats.cpp} (95%) diff --git a/README.md b/README.md index 80c2b0a..9e71917 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,21 @@ number of tagged variables, number of instrumented use sites, etc. coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html) from an instrumented binary. +### `dua-cov-json` + +Generate data-flow coverage over time from an AFL++ queue output directory. +Relies on a version of the target program instrumented with trace mode (i.e., +setting `FUZZALLOC_INST=trace`) to replay the queue through, generating JSON +reports logging covered def-use chains. + +### `llvm-cov-json` + +Generate control-flow coverage over time from an AFL++ queue output directory. +Relies on a version of the target program instrumented with Clang's source-based +coverage (as described [here](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html); +i.e., compiled using Clang's `-fprofile-instr-generate -fcoverage-mapping` flags) +to replay the queue through, generating JSON reports logging covered def-use chains. + # Evaluation Reproduction See [README.magma.md](evaluation/README.magma.md) and diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 9a121e4..4d575b4 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -25,11 +25,6 @@ configure_file(dataflow-cc.py.in dataflow-c++ @ONLY) install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/dataflow-cc" TYPE BIN) install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/dataflow-c++" TYPE BIN) -install(PROGRAMS ddg-ratio.py - RENAME ddg-ratio - TYPE BIN -) - add_executable(dua-cov-json dua-cov-json.cpp CovJSONCommon.cpp @@ -41,12 +36,12 @@ target_link_libraries(dua-cov-json PRIVATE ) install(TARGETS dua-cov-json RUNTIME DESTINATION bin) -add_executable(inst-stats inst-stats.cpp) -target_link_libraries(inst-stats PRIVATE +add_executable(dataflow-stats dataflow-stats.cpp) +target_link_libraries(dataflow-stats PRIVATE CollectStats ${LLVM_LIBS} ) -install(TARGETS inst-stats RUNTIME DESTINATION bin) +install(TARGETS dataflow-stats RUNTIME DESTINATION bin) add_executable(llvm-cov-json llvm-cov-json.cpp @@ -70,13 +65,6 @@ target_link_libraries(static-llvm-cov PRIVATE ) install(TARGETS static-llvm-cov RUNTIME DESTINATION bin) -add_executable(dua-subsumption dua-subsumption.cpp) -target_link_libraries(dua-subsumption PRIVATE - DefUseChain - Svf - ${LLVM_LIBS} -) - install(PROGRAMS timestamp-angora-queue.py RENAME timestamp-angora-queue TYPE BIN diff --git a/tools/inst-stats.cpp b/tools/dataflow-stats.cpp similarity index 95% rename from tools/inst-stats.cpp rename to tools/dataflow-stats.cpp index 1c66d92..660a282 100644 --- a/tools/inst-stats.cpp +++ b/tools/dataflow-stats.cpp @@ -1,4 +1,4 @@ -//===-- inst-stats.cpp - Collect instrumentation statistics -----*- C++ -*-===// +//===-- dataflow-stats.cpp - Collect instrumentation stats ------*- C++ -*-===// /// /// \file /// Get some instrumentation stats