"매 performance bug 의 95% 는 'where is CPU time spent?' — 매 call stack sampling 이 답한다.". 매 stack trace 를 statistical 하게 sampling → flame graph 로 visualize 하면 hot path 가 즉시 보임. 매 2026 표준 stack 은 Linux perf + eBPF, 매 inferno / pyroscope / Datadog Continuous Profiler.
매 핵심
매 sampling vs instrumentation
Sampling profiler: 매 N Hz (보통 99/999Hz) 마다 stack capture → low overhead, statistical.
Instrumented profiler: 매 every entry/exit hook → exact, but 10-100x overhead.
현대 default: 매 sampling — 매 production-safe.
매 stack source
Frame pointer (RBP) walk: 매 fastest, requires -fno-omit-frame-pointer.
DWARF unwind: 매 .eh_frame 사용 — frame pointer 불필요하나 expensive.
ORC unwinder: 매 Linux kernel 의 lightweight DWARF subset.
eBPF stackmap: 매 user+kernel stack 통합.
매 visualization
Flame graph (Brendan Gregg): 매 x=share of samples, y=stack depth, width=hot.
Icicle graph: 매 flipped flame — root at top.
Differential flame graph: 매 두 profile diff — perf regression 사냥.
매 응용
CPU bottleneck 진단: 매 hot function 식별.
Lock contention: 매 off-CPU profile + futex stack.
GC pressure: 매 alloc-stack profile.
Cold start: 매 startup phase flame graph.
Continuous profiling: 매 prod 24/7 sample → regression alerting.