Expand description
Helpers for tracing and troubleshooting multithreaded code.

§Usage
Import RwLock and Mutex from this crate instead of parking_lot directly.
After this, you can instrument a section of code like this:
let condition = true;
if condition {
unlock::capture();
}
/* do some work */
if condition {
let events = unlock::drain();
unlock::html::write("trace.html", &events)?;
println!("Wrote trace.html");
}§How does it work
This library provides two facade types:
These integrate with a high performance concurrent tracing system to capture events. While this will have some overhead, we aim to make it as small as possible.
Once a workload has been instrumented, the drain function can be called to
collect these events, which then can be formatted using either built-in
methods such as html::write, or serialized as you please using serde
for processing later.
§Features
trace- Enable real tracing support. If this feature is disabled, this library will be replaced by a stub that can easily be optimized away.parking_lot(default) - Enable support forparking_lottypes. If this feature is enabled andtraceis disabled, this will re-exportparking_lotprimitives.serde- Enable serialization for events.
Modules§
- html
- Module to format captured lock events as html.
Structs§
- Event
- A recorded opening event.
- Events
- Collection of collected events.
- Mutex
- Wrapper for
parking_lot::Mutex<T>. - Mutex
Guard - Wrapper for
parking_lot::MutexGuard<T>. - RwLock
- Wrapper for
parking_lot::RwLock<T>. - RwLock
Read Guard - Wrapper for
parking_lot::RwLockReadGuard<T>. - RwLock
Write Guard - Wrapper for
parking_lot::RwLockWriteGuard<T>.