persil-0.1.1 has been yanked.
Persil
Table of Contents
About
Persil is a minimal and simple library for profiling events.
It's based on rust's measureme and
is just a simple, but powerful layer ontop of measureme.
Getting Started
Prerequisites
- Rust (I don't have any minimun required rust version, just try one of the latest)
- Tools for reading the serialized data. (See here)
- Obviously an application that you want to profile.
Installing
Add this to your Cargo.toml
[dependencies]
persil = "0.1.0"
If you have cargo-edit installed
cargo add persil
Usage
// You have to call `init` at the start of the program,
// with the name of your application.
//
// Your results will be stored in `./trace/{app-name}-{pid}`
init;
// To store the results in a custom path, use the `init_with_path` function.
init_with_path;
// `trace` will start tracing an event.
// An event is composed of a `category` and a `label`.
// The `trace` function returns guard, that will stop tracing,
// if it's dropped.
let profiler = trace;
parse_item.unwrap;
// You can also drop the guard manually to stop tracing.
drop;
Enable the profiler in your binary.
To enable profiling, you have to enable the profiler
feature in this crate. Otherwise the trace function will do nothing.
Analyze the results
To analye and display the results, you can use one of the tools in the measureme repo.
For example to use summarize, just do:
# if you changed the path to the results, use the new path
For more information checkout the measureme repository.