Skip to content

A Semantic-Aware Log Automation Tool for Failure Diagnosis

Notifications You must be signed in to change notification settings

niuxu18/SmartLog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartLog

A Semantic-Aware Log Automation Tool for Failure Diagnosis.


Introduction

SmartLog is a log automation tool. Through learning logging rules from existing logs, SmartLog can decide whether to log a given code snippet or not , and finally inserts logging statement when necessary.

Usage

Compile
  • Change directory to Clang tools directory.
cd path/to/llvm-source-tree/tools/clang/tools
  • Download source code.
git clone https://github.com/ZhouyangJia/SmartLog.git
  • Add add_subdirectory(SmartLog) to CMakeList.txt.
echo "add_subdirectory(SmartLog)" >> CMakeLists.txt
ls path/to/llvm-build/Release/bin/clang-smartlog
Run
cd test/
tar zxvf bftpd-3.2.tar
cd bftpd/
./configure
bear make
  • Generate compiled_files.def, This file has all names of compiled source files.
../../script/extract_command.pl compile_commands.json
  • Generate call dependence before running SmartLog (Compiler CallDependence tool first).
../../script/call_dependence.sh
  • Generate logging_statement.out, logging_behavior.out, normalizes_behavior.out and logging_rules.out.
cat compiled_files.def | xargs clang-smartlog -find-logging-behavior > logging_rules.out

logging_statement.out. The logging statements, including function name and call location.

logging_behavior.out. The logging behavior, including error-prone function name, function call expression, function call location, argument index, log type (SA for sensitive argement, RV for return value and PA for pointer argument), check condition, check location, logging statement, log approach (LL for local log, RL for remote log and NL for no log), log location.

normalizes_behavior.out. The normalized behavior, including error-prone function name, argument index, log type, normalized check condition, log approach.

  • Generate patches.
python ../../script/patch.py > patch.out

About

A Semantic-Aware Log Automation Tool for Failure Diagnosis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.0%
  • Python 10.2%
  • Perl 2.3%
  • Other 0.5%