Overview
magic-trace provides unparalleled insight into your running processes, capturing high-resolution traces of their activity. It allows you to precisely understand what your code is actually doing, not just what you think it's doing, revealing the intricate flow of execution with ~40ns resolution. Unlike traditional sampling profilers, magic-trace leverages Intel Processor Trace (Intel PT) to record all control flow, enabling you to reconstruct detailed call stacks and analyze events leading up to specific points in time.
Key Features
- High-Resolution Tracing: Captures every function call with approximately 40 nanosecond resolution.
- Non-Intrusive: Requires no application modifications to start tracing.
- Low Overhead: Maintains a low performance impact, typically between 2% and 10% overhead.
- Interactive Timeline Visualization: Renders an interactive timeline of call stacks, allowing you to zoom into periods as short as ~10ms.
- Intel Processor Trace (Intel PT) Powered: Utilizes advanced hardware tracing capabilities for comprehensive execution flow capture.
- Flexible Snapshot Triggers: Easily trigger snapshots via Ctrl+C, specific function calls using
-trigger, or a dedicatedmagic_trace_stop_indicatorsymbol. - Post-Mortem Analysis: Provides a historical view of application behavior before crashes, going beyond simple stack traces.
Typical Use Cases
- Performance Bottleneck Identification: Pinpoint the exact causes of slow request handling in production environments, even amidst high volumes of seemingly unrelated activity.
- Deep Code Understanding: Visualize the actual execution path of your code, offering a precise understanding of function calls and their relationships.
- Debugging Complex Failures: Reconstruct the sequence of events leading up to a program crash, providing crucial context for debugging.
- Investigating Asynchronous Operations: Analyze the behavior of asynchronous runtimes, identifying long-running scheduler cycles.
- Server Request Analysis: Understand the detailed execution of individual server requests, especially those exhibiting unexpected latency.
