5. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
Mobile
Operating System
Trace Analysis
HDD RAM CPU LAN
Win32 API
CLR WinRT
CPU
Counters
COM
Our code
6. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileCPU Counters
• Hardware events – portable and platform
– Instructions Retired
– Non Halted Cycles
– ITLB Misses
– Branches Retired
– Mis-predicted Branches
– L2 Cache Read Misses
– L2 Cache Read References
7. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
Mobile
Operating System
Trace Analysis
HDD RAM CPU LAN
Win32 API
CLR WinRT
Windows
Perf
Counters
CPU
Counters
COM
Our code
8. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
Mobile
• They are …counters
• Min interval – 1sec
• Apps and kernel send Increment signals
• Accessed by Windows API
Windows Performance Counters
10. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
Mobile
Operating System
Trace Analysis
HDD RAM CPU LAN
Win32 API
CLR WinRT
Windows
Perf
Counters
CPU
Counters
Event
Tracing
for
Windows
COM
Our code
11. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileEvent Tracing for Windows
• General purpose, high speed tracing
• Buffering and logging in kernel
• Faster than printf
– 20,000 events per second while only using 5% CPU load on a P3 500MHz!
• Provider, Consumer, Controller model
• Over 700 providers in Win7, ~900 in Win8!
• Aggregates all sources
• Stack walking (on kernel events)
12. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileETW Kernel Providers
• Hardware Configuration Events
• Disk-level I/O
• File-level I/O
• Image Layouts
• Page Faults
• Network I/O
• Registry I/O
• Process and Thread info
13. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileETW Application Providers
• Windows Firewall
• WLAN, LAN
• USB, Bluetooth
• IIS, ASP.NET, CLR, HTTP.SYS
• Security
• … many more
15. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileSide note: Symbols
• _NT_SYMBOL_PATH=SRV*c:mss*http://msdl.
microsoft.com/download/symbols
• Call stack information
• Private managed code fields
• Link to source code repository
16. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileConcurrency Visualizer
• Utilization
• Threads
• Cores
• Stack Walking
17. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
Mobile
Operating System
Trace Analysis
HDD RAM CPU LAN
Win32 API
CLR WinRT
Windows
Perf
Counters
CPU
Counters
Event
Tracing
for
Windows
COM
Our code
Profiler
18. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileProfiler
• Instrumentation
• Sampling
• Concurrency
• Stack Walking
19. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileProfiler setup
• There can be only one
• Uses environment variables
– COR_ENABLE_PROFILING
– COR_PROFILER
– COR_XXX…
• Profiler API
20. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileInstrumentation
• Profiler based
• Requires full code recompilation
• Best during development phase
• Complete execution path
21. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileSampling
• Profiler based
• Data collection on sample intervals
• Suitable for long runs
• Call Stack
22. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileConcurrency
• Show resource contention
• Based on Detours
• Microsoft Research project now sold for $10k
• http://research.microsoft.com/en-us/projects/detours/
• Stack Walking
23. itcampro@ itcamp13# Premium conference on Microsoft technologies
Development &
MobileProfiling extras
• GC, Allocation
• Tier Interaction
• JavaScript
• Production use
• Licensing