Monitoring real-time latencies
Debugging and monitoring real-time latencies can be a difficult task: monitoring too much adds significant overhead and produces a lot of data, while monitoring only a subset of the interrupt handling process gives a hint but does not necessarily provide enough information to understand the whole problem.
In this post, I present a workflow based on tools we have developed to find the right balance between overhead and quickly identifying latency-related problems. To illustrate the kind of problems we want to solve, we use the JACK Audio Connection Kit sound server, capture relevant data only when it is needed, and then analyse the data to identify the source of a high latency.
The following tools are presented in this post:
latency_tracker
to detect high interrupt-processing latencies on a running system (online),- LTTng in snapshot (flight-recorder) mode to collect background information efficiently,
- LTTng-analyses to extract relevant metrics from the collected trace (offline post-processing).