The Linux Model Extractor (aka LiME) observes and describes the timing behavior of real-time threads.
The crate is named lime-rtw to avoid name clashes with existing crates and
respect rust naming conventions.
The tracing infrastructure is based on eBPF. Therefore a few dependencies are required to compile the project.
On Ubuntu, you can install these dependencies with these commands:
apt-get update
apt-get install -y libbpf-dev libelf-dev zlib1g-dev pkg-config clang protobuf-compilerLiME has been tested and is supported on Linux kernel versions from 5.15 to 6.12. Using LiME with kernel versions outside this range may result in unexpected behavior.
The tool requires a Linux kernel with eBPF features enabled. Additionally, the kernel must be compiled with CONFIG_DEBUG_INFO_BTF=y as LiME utilizes eBPF's CO-RE (Compile Once - Run Everywhere) feature. Without this configuration, the eBPF programs will fail to load.
The tool is built like any rust project with cargo build.
To run the tool use the following:
sudo target/debug/lime-rtwRoot privileges are required to load eBPF programs, therefore cargo run cannot
be used.
Traces can be recorded and stored in the JSON format with the trace subcommand.
sudo target/debug/lime-rtw traceIf you want to trace only one specific program, trace can be followed by a command line.
For instance to trace top scheduled with the SCHED_FIFO policy, one can run:
sudo target/debug lime trace -- chrt -f 99 htopTo launch the tracer and extract models, use the extract command.
sudo target/debug/lime-rtw extractYou can also extract models from JSON traces generated by offline tracing mode with the --from option.
sudo target/debug/lime-rtw extract --from <path_to_trace>Succesfully extracted models will be recorded in <task-identifier>.models.json. A task-identifier is <pid>-<version>, where the same process with different scheduling policy and priority changed on the fly will be considered as different versions.
The output directory can be specified with the -o options. If no path is specified
a directory will be created. If models are extracted from a recorded trace, the output
directory can be set to the trace folder with the --inplace flag.
sudo target/debug/lime-rtw extract --from <path_to_trace> --inplace