The document discusses Windows native stack profiling. It describes how stack profiling works by sampling callstacks periodically to analyze CPU usage. It provides details on how to enable and perform stack profiling in Windows using tools like the Windows Performance Recorder and Windows Performance Analyzer. Recent work in 2022 has improved the Windows V8 stack walk functionality to make it work better with tools like Perfetto and improve profiling performance.
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Windows native stack profiling
1. Windows native stack profiling
2022 update
José Dapena Paz
BlinkOn 17 lightning talks
2. Callstack profiling
Performance analysis tool: sample periodically the call stacks of all
threads, for a workload.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
3. Why?
Better understanding of CPU-bound performance problems:
● Provides a break down of the code that is exhausting CPU resources.
● Good for initial analysis for the problem, but also deep dives later.
● It allows to compare different implementations to understand the
improvements or regressions.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
4. How does it work?
Compilation stage: add functions information and frame pointers.
Runtime stage:
● JIT compilation generates function information.
● Performance sampler extracts the callstack for all processes and
threads, periodically.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
5. System native callstack profiling
Callstack profiling can benefit from system-wide sampling:
● Include system libraries and dependencies in analysis.
● Integrate with other metrics provided by system.
Many CPU-bound problems are not constrained to a single component.
We may need system-wide data.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
6. Stack profiling in Windows
Recording
Compile with enable_profiling=true.
Run with
chrome --js-flags="--enable-etw-stack-walking
--interpreted-frames-native-stack"
Use Windows Perfomance Recorder or UIForETW, and record a session.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
7. Stack profiling in Windows
Analysis
Analyze it with Windows Performance Analyzer:
● Add paths for PDB symbol files.
● Use sampled CPU profile mode.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
8. Windows V8 stack walk
2022 work
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
9. Windows V8 stack walk
2022 work
🎉 It is working again! 🎉
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
10. Windows V8 stack walk
2022 work
● Enabled with --enable-etw-stack-walking, independent
from --interpreted-frames-native-stack.
● Built by default. But no performance penalty when not profiling.
● Now it works with Perfetto enabled.
● Profiling performance improved.
● Simplified method names.
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks
11. Windows V8 stack walk
2022 work
Contributors: paolosev@microsoft.com jdapena@igalia.com
henrika@chromium.org surshar@microsoft.com
My work has been sponsored by Bloomberg.
Try on V8 10.9.0. Thanks!
Windows native stack profiling. 2022 update
José Dapena Paz, Igalia. BlinkOn 17 lightning talks