Understanding the runtime behaviors of C++ programs using uftrace tool
summary
uftrace instruments binaries using compiler-provided function hooks to record every call, arguments and return values without source changes, emits console summaries, chrome trace viewer JSON and flamegraphs, and supports filters (depth, name, time) plus Python postprocessing. Examples show surprising runtime behavior: a constexpr Fibonacci runs at runtime, std::string constructors appear unless string_view is used, and an STL pushback benchmark reveals 2.1s vs 0.7s vs 2.4s for vector,deque,list caused by repeated memcpy and malloc patterns. Kernel tracing, library PLT hooking and per-call overhead mitigations are demonstrated.
AI-written summary · about
chapters (12)
- 0:00Introduction to uftrace
- 1:25Basics of function tracing
- 4:03Event tracing and filters
- 5:26Reporting and analysis
- 6:30Viewing arguments and return values
- 7:34Chrome tracing format
- 8:38Tracing pre-built binaries
- 11:25C++ constexpr behavior
- 13:54STL container performance
- 18:58C++17 parallel algorithms
- 20:49Python scripting feature
- 25:15Q&A session
related talks
44mObservability Tools C++: Beyond GDB and printf - Tools to Understand the Behavior of Your Program
46mbpftrace internals
05mPerformance analysis using Systrace
27mLow-Overhead Tracing Using eBPF for Observability into Kubernetes Apps and Services
46mReal World Debugging with eBPF
41mLinux Tracing Techniques
31mFantastic tracepoints and where to find them
22mImproving Garbage Collection Observability with Performance Tracing
