Linux OS Internals (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
When should you use Linux Performance Profiling with `perf` and Flame Graphs?
senior LevelFormsPerformanceData Structures
In Simple Words: When CPU usage is pinned at 100% and you need to know which exact code functions are responsible:
perf record -F 99 -p <PID> -g -- sleep 30: Samples CPU stack traces at 99Hz.- Generate Brendan Gregg Flame Graphs:
- Horizontal axis: Shows the proportion of CPU time spent in each function.
- Vertical axis: Shows call stack depth.
- The widest plateaus highlight the exact code bottleneck consuming CPU! `