SlideShare a Scribd company logo
1 of 37
Logging, tracing, instrumentering, debugging og fejlfinding
• Instrumentation
• End-to-End Tracing
• Historical Debugging
• Semantic Logging
Instrumentation
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.
• You are blind without!
• Fixing bugs faster
• Documentation
• Quality
Instrumentation - Tools
• Developer
• Log files
• IntelliTrace
• Windows EventLog
• Memory Dumps
• Event Tracing for Windows
• System Administrators
• Windows EventLog
• System Service Center
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!!!
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
End-to-End Tracing
Demo
TraceSource, E2E format, Service Trace Viewer, Cross-Process
Correlation, EventLog, Azure Live Tracing
System.Diagnostics
• Trace/Debug.WriteLine
• TraceSource improvements
• Service Trace Viewer
• E2E Tracing
• Correlation of events
• CorrelationManager
• Common.Logging
log.Debug(m => m("my expensive to calculate argument is: {0}", CalculateMessageInfo()));
System.ServiceModel.OperationInvoker.CodeGeneration
System.ServiceModel.Routing
System.Transactions
System.Web.Services.Asmx
System.Windows.Data
System.Windows.DependencyProperty
System.Windows.Documents
System.Windows.Freezable
System.Windows.Interop.HwndHost
System.Windows.Markup
System.Windows.Media.Animation
System.Windows.NameScope
System.Windows.ResourceDictionary
System.Windows.RoutedEvent
System.Windows.Shell
System.Workflow
System.Workflow.Runtime.Hosting
System.Workflow.Runtime
System.Workflow.Runtime.Tracking
System.Workflow.Activities
System.Workflow.Activities.Rules
System.Xaml.Hosting
CardSpace
Microsoft.Transactions.Bridge
System.Activities
System.Activities.Core.Presentation
System.Activities.DurableInstancing
System.Activities.Presentation
System.ComponentModel.Composition
System.IdentityModel
System.IO.Log
System.Net
System.Net.Cache
System.Net.Http
System.Net.HttpListener
System.Net.Sockets
System.Net.WebSockets
System.Runtime
System.Runtime.Serialization
System.Runtime.Serialization.CodeGeneration
System.Security.Cryptography.Xml.SignedXml
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.MessageLogging
Azure Live Tracing
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="MyTraceSource"
switchValue="Warning">
<listeners>
<add name="azureListener" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="azureListener"
type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,
Microsoft.WindowsAzure.Diagnostics, …" />
</sharedListeners>
</system.diagnostics>
Historical Debugging
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!
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
How IntelliTrace WorksApplication
IntelliTrace File
CollectionPlan.xml
IntelliTrace Recorder
Demo
IntelliTrace - Historical debugger
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
Memory Dump Analysis
Debugging Tools for Windows
• WinDBG, ADPlus, s
os, Hawkeye…
• .loadby sos clr
• !clrstack –s
• !do 00f846bc
• !dumpstack
• !gcroot 00f846bc
Demo
Dump File Analysis with Visual Studio
Windows Error Reporting (WER)
Event Tracing for Windows
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
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
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
Demo
_NT_SYMBOL_PATH, PerfView, Event Tracing for Windows
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
Demo
Parallel Task Debugging
Unhandled Exceptions
System.Windows.DispatcherUnhandledException += (sender, e) =>
{
// Log it
};
System.AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
{
// Log it
};
System.Threading.Tasks.TaskScheduler.UnobservedTaskException += (sender, e) =>
{
// Log it
};
Glimpse
<system.diagnostics>
<sources>
<source name="Example Source" switchValue="Information">
<listeners>
<add name="GlimpseListener"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="GlimpseListener"
type="Glimpse.Core.TraceListener, Glimpse.Core"/>
</sharedListeners>
</system.diagnostics>
Logging, tracing, instrumentering, debugging og fejlfinding
• Instrumentation
• End-to-End Tracing
• Historical Debugging
• Semantic Logging
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
© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing
market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this
presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Other GREAT web-oriented tools
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

More Related Content

Similar to Campus days 2013 - Instrumentation

Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Anton Chuvakin
 
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...Marek Maśko
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An IntroductionMatthias Güntert
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with FiddlerIdo Flatow
 
Security Practices - Logging.pptx
Security Practices - Logging.pptxSecurity Practices - Logging.pptx
Security Practices - Logging.pptxAlireza Vafi
 
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...Ruby Meditation
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum
 
CCI2018 - Benchmarking in the cloud
CCI2018 - Benchmarking in the cloudCCI2018 - Benchmarking in the cloud
CCI2018 - Benchmarking in the cloudwalk2talk srl
 
Monitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the companyMonitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the companyJeff Weinstein
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
JavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveJavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveAndreas Grabner
 
Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16Chris Holwerda
 
Reproducible research concepts and tools
Reproducible research concepts and toolsReproducible research concepts and tools
Reproducible research concepts and toolsC. Tobin Magle
 
MTR Troubleshooting
MTR TroubleshootingMTR Troubleshooting
MTR TroubleshootingGraham Walsh
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lessonSadaaki Emura
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
SplunkLive! - Getting started with Splunk
SplunkLive! - Getting started with SplunkSplunkLive! - Getting started with Splunk
SplunkLive! - Getting started with SplunkSplunk
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingFITC
 

Similar to Campus days 2013 - Instrumentation (20)

Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?
 
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An Introduction
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
 
Security Practices - Logging.pptx
Security Practices - Logging.pptxSecurity Practices - Logging.pptx
Security Practices - Logging.pptx
 
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
 
CCI2018 - Benchmarking in the cloud
CCI2018 - Benchmarking in the cloudCCI2018 - Benchmarking in the cloud
CCI2018 - Benchmarking in the cloud
 
Monitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the companyMonitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the company
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
JavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveJavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep Dive
 
Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16
 
Reproducible research concepts and tools
Reproducible research concepts and toolsReproducible research concepts and tools
Reproducible research concepts and tools
 
MTR Troubleshooting
MTR TroubleshootingMTR Troubleshooting
MTR Troubleshooting
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
Resolving problems & high availability
Resolving problems & high availabilityResolving problems & high availability
Resolving problems & high availability
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
SplunkLive! - Getting started with Splunk
SplunkLive! - Getting started with SplunkSplunkLive! - Getting started with Splunk
SplunkLive! - Getting started with Splunk
 
Zentral london mac_ad_uk_2017
Zentral london mac_ad_uk_2017Zentral london mac_ad_uk_2017
Zentral london mac_ad_uk_2017
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript Debugging
 

Recently uploaded

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Campus days 2013 - Instrumentation

  • 1.
  • 2.
  • 3. Logging, tracing, instrumentering, debugging og fejlfinding • Instrumentation • End-to-End Tracing • Historical Debugging • Semantic Logging
  • 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
  • 11. Demo TraceSource, E2E format, Service Trace Viewer, Cross-Process Correlation, EventLog, Azure Live Tracing
  • 12. System.Diagnostics • Trace/Debug.WriteLine • TraceSource improvements • Service Trace Viewer • E2E Tracing • Correlation of events • CorrelationManager • Common.Logging log.Debug(m => m("my expensive to calculate argument is: {0}", CalculateMessageInfo())); System.ServiceModel.OperationInvoker.CodeGeneration System.ServiceModel.Routing System.Transactions System.Web.Services.Asmx System.Windows.Data System.Windows.DependencyProperty System.Windows.Documents System.Windows.Freezable System.Windows.Interop.HwndHost System.Windows.Markup System.Windows.Media.Animation System.Windows.NameScope System.Windows.ResourceDictionary System.Windows.RoutedEvent System.Windows.Shell System.Workflow System.Workflow.Runtime.Hosting System.Workflow.Runtime System.Workflow.Runtime.Tracking System.Workflow.Activities System.Workflow.Activities.Rules System.Xaml.Hosting CardSpace Microsoft.Transactions.Bridge System.Activities System.Activities.Core.Presentation System.Activities.DurableInstancing System.Activities.Presentation System.ComponentModel.Composition System.IdentityModel System.IO.Log System.Net System.Net.Cache System.Net.Http System.Net.HttpListener System.Net.Sockets System.Net.WebSockets System.Runtime System.Runtime.Serialization System.Runtime.Serialization.CodeGeneration System.Security.Cryptography.Xml.SignedXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.MessageLogging
  • 13. Azure Live Tracing <system.diagnostics> <trace autoflush="true" /> <sources> <source name="MyTraceSource" switchValue="Warning"> <listeners> <add name="azureListener" /> </listeners> </source> </sources> <sharedListeners> <add name="azureListener" type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, …" /> </sharedListeners> </system.diagnostics>
  • 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
  • 17. How IntelliTrace WorksApplication IntelliTrace File CollectionPlan.xml IntelliTrace Recorder
  • 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
  • 21. Debugging Tools for Windows • WinDBG, ADPlus, s os, Hawkeye… • .loadby sos clr • !clrstack –s • !do 00f846bc • !dumpstack • !gcroot 00f846bc
  • 22. Demo Dump File Analysis with Visual Studio
  • 24. Event Tracing for Windows
  • 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
  • 31. Unhandled Exceptions System.Windows.DispatcherUnhandledException += (sender, e) => { // Log it }; System.AppDomain.CurrentDomain.UnhandledException += (sender, e) => { // Log it }; System.Threading.Tasks.TaskScheduler.UnobservedTaskException += (sender, e) => { // Log it };
  • 32. Glimpse <system.diagnostics> <sources> <source name="Example Source" switchValue="Information"> <listeners> <add name="GlimpseListener"/> </listeners> </source> </sources> <sharedListeners> <add name="GlimpseListener" type="Glimpse.Core.TraceListener, Glimpse.Core"/> </sharedListeners> </system.diagnostics>
  • 33. Logging, tracing, instrumentering, debugging og fejlfinding • Instrumentation • End-to-End Tracing • Historical Debugging • Semantic Logging
  • 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
  • 35. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • 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

  1. This slide is mandatory
  2. This slide is mandatory
  3. This slide is optional
  4. This slide is optional
  5. This slide is optional
  6. Create the EventLog Source by:eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO cddk13 /D &quot;Event source cddk13 created&quot;
  7. Collecting traces byusing Windows Azure Diagnostics: http://msdn.microsoft.com/en-us/library/windowsazure/gg433048.aspx
  8. This slide is optional
  9. Learn IntelliTrace: - http://blogs.msdn.com/b/visualstudioalm/archive/2013/04/22/learn-intellitrace.aspx - http://msdn.microsoft.com/en-us/magazine/ee336126.aspx
  10. This slide is mandatory if you are doing demos
  11. This slide is optional
  12. This slide is mandatory if you are doing demos
  13. http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/20/using-visual-studio-2013-to-diagnose-net-memory-issues-in-production.aspx
  14. This slide is optional
  15. http://msdn.microsoft.com/en-us/magazine/cc163437.aspxhttp://msdn.microsoft.com/en-us/library/windows/desktop/bb968803(v=vs.85).aspx
  16. http://msdn.microsoft.com/en-us/library/system.diagnostics.tracing.aspxhttp://msdn.microsoft.com/en-us/library/ms751538.aspxhttps://wptools.codeplex.com/
  17. PerfViewTutorials: http://channel9.msdn.com/Series/PerfView-Tutorial
  18. This slide is mandatory if you are doing demos
  19. This slide is optional
  20. This slide is mandatory – REMEMBER to flag the essense of getting evaluations
  21. http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/20/using-visual-studio-2013-to-diagnose-net-memory-issues-in-production.aspxWays to collect Dumps:ADPlus/WinDBVisual StudioTaskManagerProcess ExplorerMiniDumpWriteDumpProcDumpWindows Error Reporting (WER)