5. Instrumentation
• The ability to monitor or measure a running system
• Trace program flow
• Log errors
• Diagnose performance issues
• Consumers
• System Administrators
• Major program flow events
• Critical issues
• Performance Counters
• Developers
• Program flow with state
• Verbose – call parameters etc.
6. • You are blind without!
• Fixing bugs faster
• Documentation
• Quality
7. Instrumentation - Tools
• Developer
• Log files
• IntelliTrace
• Windows EventLog
• Memory Dumps
• Event Tracing for Windows
• System Administrators
• Windows EventLog
• System Service Center
8. What to Instrument
• Program flow
• Major state changes
• Life-cycle events
• Start, stop, restart
• Some exceptions
• Not validation errors etc.
• Security related events
• Login attempts
• Logging
• Errors
• Focus on external dependencies
• I/O, Database, Web Service Requests
• Correlate entries!!!
9. How to Log - Log Levels
• Critical
• System is unable to run
• insufficient resource
• access to file system
• database connectivity
• application start up failures
• invalid config settings
• Administrator attention required
• Error
• Exceptions that interrupts the user's actions
• Warning
• Resumable “errors”
• Login attempts
• SLA violation
• Information
• Life-cycle events
• Major events
• Trace
• Program flow with state
• Order initiated
• Order approved
• Order send
• Debug
• Verbose “debugging” information
• Executed SQL statements
• Full HTTP requests
• Anything • s
15. File Bug
Resolve as
“No Repro”
Hand-off
to Test
Test Code
Hand-off
to Dev
Investigate
Bug
Write Code
It Works on My Machine!
16. IntelliTrace Capabilities
• Capture debugger state information during program execution
• IL is instrumented via Profiling API
• Records program execution flow
• Debugger, ASP.NET, ADO.NET, Exception, File, Registry, etc.
• Records program data
• Parameters
• Return values
• Low overhead for collection
• Visual Studio Ultimate only debugging support
19. Debugging Symbols
• Symbol Files
• .PDB files
• Used during the debugging process
• Includes Source File Names, Line Numbers and Local
Variable Names
• You should always keep your
symbol files around
• Symbol Server
• Central location for storing your PDB files
• Essentially this is just a file share
Microsoft’s public symbol server: http://msdl.microsoft.com/download/symbols
25. Event Tracing for Windows
• Unified logging facility provided by the OS
• Kernel-level buffers
• Since Windows 2000
• Also used by drivers
• Insanely-fast
• 1500-2000 cycles per entry
• ~2.5% CPU usage for sustained rate of 10,000 events/sec on a 2GHz PC
• Provider, Consumer, Controller model
• Over 700 providers in Win7, ~900 in Win8!
• System-wide collection
26. System.Diagnostics.Tracing
• Managed support from .NET 4.0+
• EventSource
• EventListener
• Semantically rich
• Strongly-typed!
• Captures stack traces
• Works everywhere
• Windows Store Apps, Windows Phone, Azure..
• Semantic Logging Application Block
27. ETW flow
ETL file
ETW
Event Providers
Event Providers
Control/Status
Control/Status
ETW Session
2. Any component that
has been instrumented
with Event Tracing API
1. Collection of configurable
in-memory buffers that is
managed by the kernel
3. Controls logging
sessions and
enables/disables
providers
5. GUI trace
analysis via
graphs and
summary tables
6. CLI trace
analysis via
actions
Data flow
XML file
Control/Status
PerfView
PerfView
System and
Symbol
Information
Merged
ETL file
Control/Status
Post Processing
Action
4. Metadata
injection
29. What’s new in Visual Studio 2013
Debugging and Diagnostics
• Edit and Continue support for x64
• Task debugging
• Graphics Diagnostics
• Code Maps with Call Stacks
34. EvaluationCreate a Text message on your phone and send it to 1919 with the
content:
DE304 5 5 5 I liked it a lot
Session Code
Anders
Performanc
e (1 to 5)
Match of
technical Level
(1 to 5)
Relevance
(1 to 5)
Comments
(optional)
Evaluation
Scale:
1 = Very bad
2 = Bad
3 = Relevant
4 = Good
5 = Very Good!
Questions:
• Speaker Performance
• Relevance according to your work
• Match of technical level
according to published level
• Comments
37. Dump Files Analysis
Dump file summary
information
Support for
mixed-mode
dump files
IL Interpreter for
managed property
evaluation
Operating system
and CLR version
information
Module
Information
Search
modules
Editor's Notes
This slide is mandatory
This slide is mandatory
This slide is optional
This slide is optional
This slide is optional
Create the EventLog Source by:eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO cddk13 /D "Event source cddk13 created"
Collecting traces byusing Windows Azure Diagnostics: http://msdn.microsoft.com/en-us/library/windowsazure/gg433048.aspx