Last updated on

Introduction

This tutorial provides a step-by-step guide on how to trace cyclictest using LiME. We'll cover:

  1. Installing cyclictest on Ubuntu
  2. Building LiME from source
  3. Running cyclictest with LiME tracing

Installing Cyclictest on Ubuntu

cyclictest is part of the rt-tests package. Install it using:

sudo apt-get update
sudo apt-get install rt-tests

Verify the installation:

cyclictest --help

Building LiME

Prerequisites

First, install the required dependencies:

sudo apt-get update
sudo apt-get install -y libbpf-dev libelf-dev zlib1g-dev pkg-config clang protobuf-compiler git

Building Steps

  1. Clone the LiME repository:
git clone https://github.com/LiME-org/lime-rtw.git
cd lime-rtw
  1. Build LiME:
cargo build --release

Tracing Cyclictest with LiME

  1. Run and trace cyclictest:
sudo target/release/lime-rtw trace -o trace_cyclictest -- cyclictest -Ss -p 99

You should see the standard cyclictest output displayed in the console.

Pressing Ctrl-C will stop both cyclictest and tracing. Afterward, the console will show the message: Results saved in trace_cyclictest.

  1. Extract models from traced results:
# Extract jobs
sudo target/release/lime-rtw extract-jobs -f trace_cyclictest --inplace 

# Extract models
sudo target/release/lime-rtw extract -f trace_cyclictest --inplace 

After running the extraction commands, you should see the following files under the trace_cyclictest directory. Each file corresponds to a specific process and version, following the naming pattern $(pid)-$(version).*.json:

trace_cyclictest
├── $(pid)-0.events.json
├── $(pid)-0.infos.json
├── $(pid)-1.events.json # Generated by the `trace` command
├── $(pid)-1.infos.json # Generated by the `trace` command
├── $(pid)-1.jobs.json # Generated by the `extract-jobs` command
├── $(pid)-1.models.json # Generated by the `extract` command

Note: Sometimes, no jobs or models JSON files are generated. This indicates that LiME was unable to extract models from the tracing results.

Understanding the Results

The trace results are stored in three different JSON files for each process (identified by its PID):

  1. $(pid).events.json

    • Contains raw events traced by LiME
    • Includes detailed timing information for:
      • Scheduling events
      • Interrupt handling
      • Context switches
      • System calls
  2. $(pid).jobs.json

    • Describes each process's job releases
    • Contains information about:
      • Job release times
      • Job completion times
      • Job execution patterns
      • Periodic job information
  3. $(pid).models.json

    • Contains extracted models for each process
    • Includes:
      • Process timing models
      • Execution patterns
      • Resource usage models
      • Scheduling behavior models

Next Steps

You can analyze these files to:

  • Conduct schedulability analysis
  • Detect scheduling delays
  • Analyze job release patterns
  • Validate process models

Additional Resources