Skip to content

SecurityLab-UCD/ReportFunctionExecutedPass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Report Function Execution

Requirements

  • llvm-14 and clang-14
  • cmake 3.1

Build

Building the Pass

mkdir build && cd build
cmake ..
make
cd ..

Building the Reporter

# get json lib
mkdir -p include
mkdir -p include/nlohmann
wget https://github.com/nlohmann/json/releases/download/v3.11.2/json.hpp -O include/nlohmann/json.hpp
make

Usage

Pass instrumentation happens at optimazation step. Compile source code into llvm-IR, instrument IR with the opt, then compile instrumented IR into exec.

cd example
clang -S -emit-llvm -Xclang -disable-O0-optnone example.c -o example.ll
opt -load ../build/report/libReportPass.so -report -enable-new-pm=0 -S example.ll > example2.ll
clang example2.ll

This implimentation is largely inspired by Runtime Execution Profiling using LLVM.

About

report executed function when called

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages