/trace-analysis-lab

Analyze CTF traces with Python in a Jupyter Lab environment

Primary LanguageJupyter NotebookMIT LicenseMIT

Trace Analysis Lab

This is a portable lab for trace analysis. That is, it should work in various operating systems (i.e. Windows, Mac, Linux) via Docker.

Use this lab to analyze traces in Common Trace Format (CTF) in Jupyter notebooks using the Babeltrace 2 Python Bindings. To help with data wrangling and analysis, the Pandas and Matplotlib Python libraries are installed.

Instructions

  • Install Docker via Getting Started with Docker
  • On a Mac, you may want to use OrbStack instead of Docker as it tends to be faster.
  • From the terminal in this project directory, build and run the Jupyter Lab server by running docker compose -f docker-compose.dev.yml up --build -d.
  • Visit http://127.0.0.1:9000/lab in your browser.
  • Open the syscall_durations.ipynb file and try running it (see note about copying a trace into the project and editing the path to the trace in the Notes section).
  • When you are done, run docker compose -f docker-compose.dev.yml down to stop and remove containers, volumes, and images.

How to Use

Notes

If you're using the example syscall_durations.ipynb, make sure to put a kernel trace that has syscall events captured into notes/traces and update this line:

msg_it = bt2.TraceCollectionMessageIterator("traces/example")

Replace example with the name of your trace directory.

Sample traces were not included in this repository due to their large size.