6. Trace Analysis
Our code
CLR COM WinRT
Windows
Win32 API Perf
Counters
Operating System
HDD RAM CPU LAN CPU
Counters
www.devreach.com
7. Windows Performance Counters
• They are …counters
• Min interval – 1sec
• Apps and kernel send Increment signals
• Accessed by Windows API
www.devreach.com
9. Trace Analysis
Our code
CLR COM WinRT
Windows
Event
Win32 API Perf
Tracing
Counters
for Operating System
Windows
HDD RAM CPU LAN CPU
Counters
www.devreach.com
10. Event 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)
www.devreach.com
16. Trace Analysis
Profiler
Our code
CLR COM WinRT
Windows
Event
Win32 API Perf
Tracing
Counters
for Operating System
Windows
HDD RAM CPU LAN CPU
Counters
www.devreach.com
18. Profiler setup
• There can be only one
• Uses environment variables
– COR_ENABLE_PROFILING
– COR_PROFILER
– COR_XXX…
• Profiler API
www.devreach.com
19. Instrumentation
• Profiler based
• Requires full code recompilation
• Best during development phase
• Complete execution path
www.devreach.com
20. Sampling
• Profiler based
• Data collection on sample intervals
• Suitable for long runs
• Call Stack
www.devreach.com
21. Concurrency
• Show resource contention
• Based on Detours
• Microsoft Research project now sold for
$10k
• http://research.microsoft.com/en-us/projects/detours/
• Stack Walking
www.devreach.com
22. Profiling extras
• GC, Allocation
• Tier Interaction
• JavaScript
• Production use
• Licensing
www.devreach.com
Hardware configuration events CPUs, hard drives, NICs, video card, and ACPI power statesDisk-level I/O every I/O on the system, IRP flags, operation time in ms, number of bytes, diskFile-level I/O every access to every file on the system (tie it to the disk I/Os above)Image layoutsfilenames, locations in memory, and PIDs for every image in the systemPage faultspointers to instructions and pages whenever a fault occursNetwork I/O all TCP and UDP actions, including connects/accepts, transmits, recieves, etc.Registry I/O all Registry key/value creation/deletions/changes, registry flushes, etc.Process and thread info all creations/deletions of processes and threads