Lockless multi-core high-throughput buffering scheme for kernel tracing

  • Authors:
  • Mathieu Desnoyers;Michel R. Dagenais

  • Affiliations:
  • EfficiOS Inc.;Ecole Polytechnique de Montreal, Montreal, Quebec, Canada

  • Venue:
  • ACM SIGOPS Operating Systems Review
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Studying execution of concurrent real-time online systems, to identify far-reaching and hard to reproduce latency and performance problems, requires a mechanism able to cope with voluminous information extracted from execution traces. Furthermore, the workload must not be disturbed by tracing, thereby causing the problematic behavior to become unreproducible. In order to satisfy this low-disturbance constraint, we created the LTTng kernel tracer. It is designed to enable safe and race-free attachment of probes virtually anywhere in the operating system, including sites executed in non-maskable interrupt context. In addition to being reentrant with respect to all kernel execution contexts, LTTng offers good performance and scalability, mainly due to its use of per-CPU data structures, local atomic operations as main buffer synchronization primitive, and RCU (Read-Copy Update) mechanism to control tracing. Given that kernel infrastructure used by the tracer could lead to infinite recursion if traced, and typically requires non-atomic synchronization, this paper proposes an asynchronous mechanism to inform the kernel that a buffer is ready to read. This ensures that tracing sites do not require any kernel primitive, and therefore protects from infinite recursion. This paper presents the core of LTTng's buffering algorithms and measures its performance.