SlideShare a Scribd company logo
Windows Software
Trace Analysis
Dmitry Vostokov
Software Diagnostics Services
Whatโ€™s it all About?
๏‚ž General Trace Analysis Patterns
๏‚ž Windows context
ยฉ 2012 Software Diagnostics Services
Prerequisites
Basic Windows troubleshooting
ยฉ 2012 Software Diagnostics Services
Training Goals
๏‚ž Review tracing fundamentals
๏‚ž Learn trace analysis patterns
๏‚ž Practice finding patterns in logs
ยฉ 2012 Software Diagnostics Services
Training Principles
๏‚ž Lots of pictures
๏‚ž Pattern relationships
๏‚ž Practical examples
ยฉ 2012 Software Diagnostics Services
Schedule Summary
Day 1
๏‚ž Trace Analysis Fundamentals
๏‚ž Trace Analysis Patterns
Day 2
๏‚ž Trace Analysis Patterns
๏‚ž Examples
ยฉ 2012 Software Diagnostics Services
Part 1: Fundamentals
ยฉ 2012 Software Diagnostics Services
Basic Concepts
ยฉ 2012 Software Diagnostics Services
๏‚ž Software Trace (or Log)
๏‚ž Process
๏‚ž Thread
๏‚ž Adjoint Thread
๏‚ž Module (or Source)
๏‚ž File
๏‚ž Function
๏‚ž Message (or Operation)
๏‚ž Stack trace
Software Trace (Log)
ยฉ 2012 Software Diagnostics Services
๏‚ž A sequence of formatted messages
๏‚ž Arranged by time
๏‚ž A narrative story
Process
ยฉ 2012 Software Diagnostics Services
๏‚ž PID
๏‚ž Session
๏‚ž Image Name
๏‚ž Modules (DLLs)
๏‚ž Examples:
svchost.exe
notepad.exe
PID 1 PID 2
PID 3 PID 4
Thread
ยฉ 2012 Software Diagnostics Services
๏‚ž TID
๏‚ž CPU
๏‚ž Context
PID
CPU 1 CPU 2
TID 1
TID 1
TID 2
Adjoint Thread
ยฉ 2012 Software Diagnostics Services
Debugging TV Frame 0x14
Exercise T0
ยฉ 2012 Software Diagnostics Services
1. Download Process Monitor
2. Trace system activity
3. Add more columns such as TID
4. Filter a thread based on TID
5. Reset filter
6. Filter an adjoint thread based on image
name svchost.exe
7. Filter an adjoint thread based on PID
Module / Source
ยฉ 2012 Software Diagnostics Services
๏‚ž Module Name
๏‚ž Source Folder
ApplicationA.exe
sourcelibrary
svchost.exe
ApplicationA.exe
ModuleB.dll
ModuleC.dll
sourcelibrary*.c
File and Function
ยฉ 2012 Software Diagnostics Services
// MainApp.c
foo () {
trace(โ€œfoo: entryโ€);
// do stuff
trace(โ€œfoo: exitโ€);
}
MainApp.c
MainApp.c: foo
MainApp.c
Trace Message
ยฉ 2012 Software Diagnostics Services
// MainApp.c
foo () {
trace(โ€œfoo: entryโ€);
int result = bar();
trace(โ€œbar result: 5โ€);
trace(โ€œfoo: exitโ€);
}
Invariant Variable Invariant Variable โ€ฆ
Stack Trace
ยฉ 2012 Software Diagnostics Services
// MainApp.c
main() {
trace(โ€œstartโ€);
foo();
}
foo() {
trace(โ€œfoo: entryโ€);
bar();
}
bar() {
trace(โ€œbar: entryโ€);
// do stuff
}
bar: entry
foo: entry
start
bar
foo
main
foo
main
Trace Recording Tools
ยฉ 2012 Software Diagnostics Services
๏‚ž Process Monitor
๏‚ž MessageHistory
๏‚ž CDFControl
Trace Analysis Tools
ยฉ 2012 Software Diagnostics Services
๏‚ž Process Monitor
๏‚ž CDFControl
๏‚ž CDFAnalyzer
๏‚ž MS Office Excel
Minimal Trace Graphs
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
No Module PID TID Date Time Message
-----------------------------------------------------------
1 ModuleA 4280 1736 5/28/2012 08:53:50.496 Trace message 1
2 ModuleB 6212 6216 5/28/2012 08:53:52.876 Trace message 2
[โ€ฆ]
Trace Formats
ยฉ 2012 Software Diagnostics Services
๏‚ž ETW
๏‚ž CDF
๏‚ž CSV
๏‚ž Free
๏‚ž Mixed
Pattern-Driven Analysis
Pattern: a common recurrent identifiable problem together with a set of
recommendations and possible solutions to apply in a specific context
Checklist: http://www.dumpanalysis.org/blog/index.php/2011/03/10/software-
trace-analysis-checklist/
Patterns: http://www.dumpanalysis.org/blog/index.php/trace-analysis-
patterns/
ยฉ 2012 Software Diagnostics Services
Trace
Collection
Checklists Patterns Action
Pattern-Based Analysis
ยฉ 2012 Software Diagnostics Services
Software Trace
New Pattern
Discovery
Pattern
Catalog
+
Usage
Pattern Hierarchy
ยฉ 2012 Software Diagnostics Services
๏‚ž Domain Independent
from IBM mainframes to mobile and embedded computers
๏‚ž Domain Specific
Pattern Classification
ยฉ 2012 Software Diagnostics Services
๏‚ž Vocabulary
๏‚ž Error
๏‚ž Trace as a Whole
๏‚ž Large Scale
๏‚ž Activity
๏‚ž Message
๏‚ž Block
๏‚ž Trace Set
Part 2: Individual Patterns
ยฉ 2012 Software Diagnostics Services
Vocabulary Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Basic Facts
๏‚ž Vocabulary Index
Basic Facts
ยฉ 2012 Software Diagnostics Services
๏‚ž Problem Description
Application disappears after launch
๏‚ž Software Trace
PID Message
-----------------------------------
โ€ฆ
3f6 Create process AppA: PID 4a5
4a5 AppA loads DLLC
โ€ฆ
3f6 Create process AppB: PID 5b8
5b8 AppB loads DLLD
โ€ฆ
Related Patterns
Vocabulary Index
Basic Facts Taxonomy
ยฉ 2012 Software Diagnostics Services
๏‚ž Functional Facts
Example: Expected a dialog to enter data
๏‚ž Non-functional Facts
Example: CPU consumption 100%
๏‚ž Identification Facts
Application name, PID, user name
Vocabulary Index
ยฉ 2012 Software Diagnostics Services
Related Patterns
Basic Facts
Activity Region
๏‚ž Problem Description
A user Test123 authentication failed
basic fact index
๏‚ž Narrowing:
Error Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Error Message
๏‚ž Exception Stack Trace
๏‚ž False Positive Error
๏‚ž Periodic Error โ†“*
๏‚ž Error Distribution
* โ€˜โ†“โ€™ sign means that a pattern involves time dependency
Error Message
ยฉ 2012 Software Diagnostics Services
Related Patterns
False Positive Error
Periodic Error
Error Distribution
Adjoint Thread
Data Flow๏‚ž Explicit errors
๏‚ž Implicit errors
๏‚ž WinDbg command !error
0:000> !error c0000017
Error code: (NTSTATUS) 0xc0000017 (3221225495) - {Not Enough Quota} Not enough
virtual memory or paging file quota is available to complete the specified
operation.
0:000> !error 5
Error code: (Win32) 0x5 (5) - Access is denied.
Exception Stack Trace
ยฉ 2012 Software Diagnostics Services
No PID TID Message
------------------------
[โ€ฆ]
265799 8984 4216 ComponentA.Store.GetData threw exception: โ€˜System.Reflection.TargetInvocationException: DCOM connection to
server failed with error: โ€˜Exception from HRESULT: 0ร—842D0001โ€ฒ โ€”> System.Runtime.InteropServices.COMException (0ร—842D0001):
Exception from HRESULT: 0ร—842D0001
265800 8984 4216 === Exception Stack Trace ===
265801 8984 4216 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
265802 8984 4216 at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
265803 8984 4216 at ComponentA.Store.GetData(Byte[] pKey)
265804 8984 4216 at ComponentA.App.EnumBusinessObjects()
[โ€ฆ]
Related Patterns
Error Message
Periodic Error โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Error Message
Error Distribution
False Positive Error
Message Invariant
No PID TID Message
-----------------------
[โ€ฆ]
36495 1788 2250 MyClass::Init: Cannot open connection โ€œClient ID: 310โ€ณ, status=5
[โ€ฆ]
[โ€ฆ]
36883 1788 1986 MyClass::Init: Cannot open connection โ€œClient ID: 612โ€ณ, status=5
[โ€ฆ]
Time
# PID TID Time Message
False Positive Error
ยฉ 2012 Software Diagnostics Services
๏‚ž Expected errors
๏‚ž Not relevant to our problem
๏‚ž Implementation details
Related Patterns
Error Message
Master Trace
Activity Region
Error Distribution
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Related Patterns
Partition
Activity Region
Trace as a Whole
ยฉ 2012 Software Diagnostics Services
๏‚ž Partition
๏‚ž Circular Trace โ†“
๏‚ž Message Density
๏‚ž Message Current โ†“
๏‚ž Trace Acceleration โ†“
๏‚ž No Trace Metafile
๏‚ž Empty Trace
๏‚ž Missing Module
๏‚ž Guest Module
๏‚ž Truncated Trace โ†“
๏‚ž Visibility Limit
๏‚ž Sparse Trace
Partition
ยฉ 2012 Software Diagnostics Services
Related Patterns
Significant Event
Truncated Trace
Adjoint Thread
Tail
Epilogue
Head
Time
Prologue
Core
# PID TID Time Message
Circular Trace โ†“
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Problem
Repro
No Module PID TID Date Time Message
---------------------------------------------------------------
1 ModuleA 4280 1736 5/28/2009 08:53:50.496 Trace message 1
2 ModuleB 6212 6216 5/28/2009 08:53:52.876 Trace message 2
3 ModuleA 4280 4776 5/28/2009 08:54:13.537 Trace message 3
[โ€ฆ]
3799 ModuleA 4280 3776 5/28/2009 09:15:00.853 Trace message 3799
3800 ModuleA 4280 1736 5/27/2009 09:42:12.029 Trace message 3800
[โ€ฆ]
579210 ModuleA 4280 4776 5/28/2009 08:53:35.989 Trace message 579210
Related Patterns
Focus of Tracing
Message Density
ยฉ 2012 Software Diagnostics Services
D1 > D2
Similar relative density for 2 traces may shows correlation:
D11 / D21 = D12 / D22
For correlated messages different densities from 2 traces may
show different partition or system conditions:
D11 >> D12
Time
# PID TID Time Message
Related Patterns
Intra-correlation
Focus of Tracing
Relative Density
Partition
Message Current โ†“
ยฉ 2012 Software Diagnostics Services
J1 > J2
Time
# PID TID Time Message
Time
# PID TID Time Message
10.100
10.200
10.100
12.100
Related Patterns
Significant Event
Activity Region
Message Density
Trace Acceleration โ†“
ยฉ 2012 Software Diagnostics Services
Message current Ji < Jj, i < j < N
Partial message currents:
with respect to TID X Jk(TID=x)
with respect to PID Y Jk(PID=y)
with respect to PID X and TID Z Jk(PID=y & TID=z)
Jj
Jl
JN
Time
Ji
Jk
Jm
# PID TID Time Message
Related Patterns
Activity Region
Message Current
Thread of Activity
Adjoint Thread of Activitiy
No Trace Metafile
ยฉ 2012 Software Diagnostics Services
# Module PID TID Time Message
-------------------------------------------
[โ€ฆ]
21372 dllA 2968 5476 3:55:10.004 Calling foo()
21373 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found).
21374 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found)
21375 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found)
21376 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found)
21377 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found)
21378 dllA 2968 5476 3:55:10.004 Calling bar()
[โ€ฆ]
Possible patterns to detect:
๏‚ž Circular Trace
๏‚ž Message Density
๏‚ž Message Current
๏‚ž Discontinuity
๏‚ž Time Delta
๏‚ž Trace Acceleration
Related Patterns
Thread of Activity
Empty Trace
ยฉ 2012 Software Diagnostics Services
Related Patterns
Truncated Trace
No Activity
Missing Module
๏‚ž Small file size
๏‚ž Very few trace messages
Always open a trace before sending to
someone else
Missing Module
ยฉ 2012 Software Diagnostics Services
Related Patterns
Discontinuity
Inter-Correlation
No Activity
Time
# PID TID Time Message
Missing
Tracing Best Practices
Guest Module
ยฉ 2012 Software Diagnostics Services
Related Patterns
Missing ModuleTime
# PID TID Time Message
Load: 3rdPartyActivity.dll
Truncated Trace โ†“
ยฉ 2012 Software Diagnostics Services
Tail
Epilogue
Head
Time
Prologue
Core
# PID TID Time Message
Head
Prologue
Core
# PID TID Time Message
Related Patterns
Partition
Anchor Messages
Missing Module
Visibility Limit
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
r
Related Patterns
Truncated Trace
Missing Module
Sparse Trace
Sparse Trace
ยฉ 2012 Software Diagnostics Services
Related Patterns
Missing Module
Visibility Limit
Time
# PID TID Time Message
Missing
L
PLOT
Large Scale Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Characteristic Block
๏‚ž Background Modules
๏‚ž Foreground Modules
๏‚ž Layered Periodization
๏‚ž Focus of Tracing
๏‚ž Event Sequence Order โ†“
๏‚ž Trace Frames
Birdโ€™s Eye Binary View
ยฉ 2012 Software Diagnostics Services
Characteristic Block
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Background Modules
ยฉ 2012 Software Diagnostics Services
Background:
Foreground:
Related Patterns
Foreground ModulesTime
# PID TID Time Message
Foreground Modules
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Time
# PID TID Time Message
Related Patterns
Background Modules
Module Foregrounding
Layered Periodization
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Time
# PID TID Time Message
Time
# PID TID Time Message
Focus of Tracing
ยฉ 2012 Software Diagnostics Services
Activity regions: Jm1, Jm2, Jm3
Related Patterns
Activity RegionTime
Jm1
Jm2
Jm3
# PID TID Time Message
Event Sequence Order โ†“
ยฉ 2012 Software Diagnostics Services
Synchronization
Race Conditions
Deadlock
Related Patterns
Significant Event
Anchor Messages
Time
# PID TID Time Message
E1
E2
E3
E4
E5
Time
# PID TID Time Message
E2
E3
E4
E5
E1
Frames (Source Code)
ยฉ 2012 Software Diagnostics Services
Visual Studio 2012
Trace Frames
ยฉ 2012 Software Diagnostics Services
Related Patterns
Thread of Activity
Adjoint Thread
Truncated Trace
Discontinuity
Time
# PID TID Time Message
Activity Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Thread of Activity โ†“
๏‚ž Adjoint Thread of Activity โ†“
๏‚ž No Activity
๏‚ž Activity Region
๏‚ž Discontinuity โ†“
๏‚ž Time Delta โ†“
๏‚ž Glued Activity
๏‚ž Break-in Activity โ†“
๏‚ž Resume Activity โ†“
๏‚ž Data Flow โ†“
Thread of Activity โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Discontinuity
Sparse Trace
Time
# PID TID Time Func Message
# PID TID Time Func Message
Adjoint Thread of Activity โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Thread of Activity
Message Invariant
Time
# PID TID Time Func Message
Time
# PID TID Time Func Message
No Activity
ยฉ 2012 Software Diagnostics Services
Related Patterns
Discontinuity
Sparse Trace
Missing Module
Time
# PID TID Time Message
We expect this process
Causes: hang, wait chain,
deadlock, terminated threads,
CPU loop
Activity Region
ยฉ 2012 Software Diagnostics Services
Message current : Jm2 > max (Jm1,Jm3)
Time
Jm1
Jm2
Jm3
# PID TID Time Message
Related Patterns
Message Current
Characteristic Block
Discontinuity โ†“
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Time
# PID TID Time Message
Related Patterns
Thread of Activity
Missing Module
Sparse Trace
Possible causes:
Blocked thread, IPC response
delay, wait chains, long
computation
Time Delta โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Basic Facts
Thread of Activity
Discontinuity
Significant Event
# Module PID TID Time File Function Message
---------------------------------------------------------------------------------------------------
6060 dllA 1604 7108 10:06:21.746 fileA.c DllMain DLL_PROCESS_ATTACH
24480 dllA 1604 7108 10:06:32.262 fileA.c LaunchApp Exec Path: C:Program FilesCompanyAappB.exe
30 seconds of discontinuity till the end of full trace
Time
# PID TID Time Message
Glued Activity
ยฉ 2012 Software Diagnostics Services
ATID: Adjoint Thread ID
ImageA
ATID 2
ImageB
ATID 3
Time
# ATID TID Time Message
Related Patterns
Adjoint Thread
Time
Trace
Session
1
# PID TID Time Message
Trace
Session
2
Break-in Activity โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Thread of Activity
Adjoint Thread
Discontinuity
Resume Activity
Time
# PID TID Time Message
Discontinuity
Resume Activity โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Break-in Activity
Thread of Activity
Adjoint Thread
Time
# PID TID Time Message
Discontinuity
Data Flow โ†“
ยฉ 2012 Software Diagnostics Services
# PID TID Time Message
Time
Related Patterns
Adjoint Thread
Message Invariant
[โ€ฆ]
DriverA: Device 0xA IRP 0xB
[โ€ฆ]
DriverB: Device 0xC IRP 0xB
[โ€ฆ]
DriverC: Device 0xD IRP 0xB
DriverC: Processing IRP 0xB
[โ€ฆ]
Message Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Significant Event
๏‚ž Defamiliarizing Effect
๏‚ž Anchor Messages
๏‚ž Diegetic Messages
๏‚ž Message Change โ†“
๏‚ž Message Invariant
๏‚ž UI Message
๏‚ž Original Message
๏‚ž Implementation Discourse
๏‚ž Opposition Messages
๏‚ž Linked Messages
๏‚ž Gossip โ†“
๏‚ž Counter Value
๏‚ž Message Context
๏‚ž Marked Messages
๏‚ž Incomplete History
๏‚ž Message Interleave
๏‚ž Fiber Bundle
Significant Event
ยฉ 2012 Software Diagnostics Services
Related Patterns
Exception Stack Trace
Error Message
Basic Facts
Vocabulary Index
Time
# PID TID Time Message
ยฉ 2012 Software Diagnostics Services
Poetry of Software Traces
โ€œCapturing delicate moments, one gives birth to a poetry of traces โ€ฆโ€
Ange Leccia, Motionless Journeys, by Fabien Danesi
Defamiliarizing Effect
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message
Time
# PID TID Time Message
Related Patterns
Characteristic Block
Activity Region
Anchor Messages
ยฉ 2012 Software Diagnostics Services
Related Patterns
Vocabulary Index
Adjoint Thread
Message Interleave
Time
# PID TID Time Message
# PID TID Time Message
----------------------------------------------------------
24226 2656 3480 10:41:05.774 AppA.exe: DLL_PROCESS_ATTACH
108813 4288 4072 10:41:05.774 AppB.exe: DLL_PROCESS_ATTACH
112246 4180 3836 10:41:05.940 DllHost.exe: DLL_PROCESS_ATTACH
135473 2040 3296 10:41:12.615 AppC.exe: DLL_PROCESS_ATTACH
694723 1112 1992 10:44:23.393 AppD.exe: DLL_PROCESS_ATTACH
703962 5020 1080 10:44:42.014 DllHost.exe: DLL_PROCESS_ATTACH
705511 4680 3564 10:44:42.197 DllHost.exe: DLL_PROCESS_ATTACH
705891 1528 2592 10:44:42.307 regedit.exe: DLL_PROCESS_ATTACH
785231 2992 4912 10:45:26.516 AppE.exe: DLL_PROCESS_ATTACH
786523 3984 1156 10:45:26.605 powershell.exe: DLL_PROCESS_ATTACH
817979 4188 4336 10:45:48.707 wermgr.exe: DLL_PROCESS_ATTACH
834875 3976 1512 10:45:52.342 LogonUI.exe: DLL_PROCESS_ATTACH
835229 4116 3540 10:45:52.420 AppG.exe: DLL_PROCESS_ATTACH
Message Interleave
ยฉ 2012 Software Diagnostics Services
Related Patterns
Adjoint Thread
Anchor Messages
Time
# PID TID Time Message
Diegetic Messages
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Func Message
Process PID 234 is OK
Status OK
Status OK
Status OK
Related Patterns
Anchor Messages
Message Change โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Anchor Messages
Message Invariant
Adjoint Thread
Status = 0x0
Time
# PID TID Time Message
Status = 0x0
Status = 0x0
Status = 0xc0000017
Status = 0xc0000017
Status = 0xc0000017
Implementation Discourse
ยฉ 2012 Software Diagnostics Services
๏‚ž Win32 API
๏‚ž MFC
๏‚ž Kernel Development
๏‚ž COM
๏‚ž C# / .NET
๏‚ž C++
๏‚ž Java
๏‚ž โ€ฆ
Message Invariant
ยฉ 2012 Software Diagnostics Services
# Module PID TID Time Message
-------------------------------------------------------------------------------------------
[โ€ฆ]
2782 ModuleA 2124 5648 10:58:03.356 CreateObject: pObject 0ร—00A83D30 data ([โ€ฆ]) version 0ร—4
[โ€ฆ]
# Module PID TID Time Message
-------------------------------------------------------------------------------------------
[โ€ฆ]
4793 ModuleA 2376 8480 09:22:01.947 CreateObject: pObject 0ร—00BA4E20 data ([โ€ฆ]) version 0ร—5
[โ€ฆ]
Related Patterns
Trace Set
UI Message
ยฉ 2012 Software Diagnostics Services
Related Patterns
Activity Region
Significant Event
Thread of Activity
Adjoint Thread
# Module PID TID Time Message
--------------------------------------------------------------------------------
[โ€ฆ]
2782 ModuleA 2124 5648 10:58:03.356 CreateWindow: Title "..." Class "..."
[โ€ฆ]
3512 ModuleA 2124 5648 10:58:08.154 Menu command: Save Data
[โ€ฆ]
3583 ModuleA 2124 5648 10:58:08.155 CreateWindow: Title "Save As" Class "Dialog"
[... Data update and replication related messages ...]
4483 ModuleA 2124 5648 10:58:12.342 DestroyWindow: Title "Save As" Class "Dialog"
[โ€ฆ]
# Module PID TID Time Message
--------------------------------------------------------------------------------
[โ€ฆ]
2782 ModuleA 2124 5648 10:58:03.356 CreateWindow: Title "..." Class "..."
3512 ModuleA 2124 5648 10:58:08.154 Menu command: Save Data
3583 ModuleA 2124 5648 10:58:08.155 CreateWindow: Title "Save As" Class "Dialog"
4483 ModuleA 2124 5648 10:58:12.342 DestroyWindow: Title "Save As" Class "Dialog"
[โ€ฆ]
Original Message
ยฉ 2012 Software Diagnostics Services
# Module PID TID Time Message
---------------------------------------------------------------------------------------------------------
[โ€ฆ]
35835 ModuleA 12332 11640 18:27:28.720 LoadLibrary: Program FilesMyProductSystem32MyDLL.dll PID 12332
[โ€ฆ]
37684 ModuleA 12332 9576 18:27:29.063 LoadLibrary: Program FilesMyProductSystem32MyDLL.dll PID 12332
[โ€ฆ]
37687 ModuleA 12332 9576 18:27:29.064 LoadLibrary: Program FilesMyProductSystem32MyDLL.dll PID 12332
[โ€ฆ]
Related Patterns
Message Invariant
Adjoint Thread
Linked Messages
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Func Message
CreateProcess AppB.exe
CreateProcess AppA.exe
ImageLoad AppB.exe
ImageLoad AppC.exe
ImageLoad AppA.exe
CreateProcess AppC.exe
Related Patterns
Adjoint Thread
# PID Message
---------------------------------------------
[โ€ฆ]
128762 1260 CreateProcess: PPID 1260 PID 6356
[โ€ฆ]
128785 6356 ImageLoad: AppA.exe PID 6356
[โ€ฆ]
131137 6356 CreateProcess: PPID 6356 PID 6280
[โ€ฆ]
131239 6280 ImageLoad: AppB.exe PID 6280
[โ€ฆ]
132899 6356 CreateProcess: PPID 6356 PID 8144
[โ€ฆ]
132906 8144 ImageLoad: AppC.exe PID 8144
[โ€ฆ]
Gossip โ†“
ยฉ 2012 Software Diagnostics Services
Related Patterns
Adjoint Thread
Event Sequence Order
Message Interleave
# Module PID TID Message
[โ€ฆ]
26875 ModuleA 2172 5284 LoadImage: DeviceHarddiskVolume2WindowsSystem32notepad.exe PID 0x000000000000087C
26876 ModuleB 2172 5284 LoadImage: DeviceHarddiskVolume2WindowsSystem32notepad.exe, PID (2172)
26877 ModuleC 2172 5284 ImageLoad: fileName=notepad.exe, pid: 000000000000087C
[โ€ฆ]
# Module PID TID Message
[โ€ฆ]
26875 ModuleA 2172 5284 LoadImage: DeviceHarddiskVolume2WindowsSystem32notepad.exe PID 0ร—000000000000087C
[โ€ฆ]
33132 ModuleA 4180 2130 LoadImage: DeviceHarddiskVolume2WindowsSystem32calc.exe PID 0ร—0000000000001054
[โ€ฆ]
Counter Value
ยฉ 2012 Software Diagnostics Services
Module Variable
18:04:06 Explorer.EXE 3280 User Time: 8.4864544 seconds, Kernel Time: 9.5004609 seconds, Private Bytes: 42,311,680, Working Set: 10,530,816
Related Patterns
Adjoint Thread
Significant Event
Activity Region
Focus of Tracing
Characteristic Message Block
Performance-specific patterns:
Global Monotonicity
Constant Value
Message Context
ยฉ 2012 Software Diagnostics Services
Related Patterns
Significant Event
Anchor Message
Time
# PID TID Time Message
Context
<- Message
Marked Messages
ยฉ 2012 Software Diagnostics Services
Related Patterns
Master Trace
No Activity
Annotated messages:
session database queries [+]
session initialization [-]
socket activity [+]
process A launched [+]
process B launched [-]
process A exited [-]
[+] activity is present in a trace
[-] activity is undetected or not present
Fiber Bundle
ยฉ 2012 Software Diagnostics Services
I/O stack
Thread stack
trace
Trace
messages
Related Patterns
Exception Stack Trace
Incomplete History
ยฉ 2012 Software Diagnostics Services
Related Patterns
Opposition Messages
Sparse Trace
Truncated Trace
Master Trace
Code:
๏‚ž Response-complete
๏‚ž Exception-complete
๏‚ž Call-complete
Opposition Messages
ยฉ 2012 Software Diagnostics Services
๏‚ž open - close
๏‚ž create โ€“ destroy (discard)
๏‚ž allocate - free (deallocate)
๏‚ž call - return
๏‚ž enter - exit (leave)
๏‚ž load - unload
๏‚ž save - load
๏‚ž lock - unlock
๏‚ž map - unmap
Related Patterns
Incomplete History
Sparse Trace
Block Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Macrofunction
๏‚ž Periodic Message Block
๏‚ž Intra-Correlation
Macrofunction
ยฉ 2012 Software Diagnostics Services
# Module PID TID Time Message
------------------------------------------------------------
[โ€ฆ]
42582 DBClient 5492 9476 11:04:33.398 Opening connection
[โ€ฆ]
42585 DBClient 5492 9476 11:04:33.398 Sending SQL command
[โ€ฆ]
42589 DBServer 6480 10288 11:04:33.399 Executing SQL command
[โ€ฆ]
42592 DBClient 5492 9476 11:04:33.400 Closing connection
[โ€ฆ]
Periodic Message Block
ยฉ 2012 Software Diagnostics Services
Related Patterns
Periodic Error
Adjoint Thread
Invariant Message
Discontinuity
Time
# PID TID Time Message
Intra-Correlation
ยฉ 2012 Software Diagnostics Services
Handle: 00050586 Class: "Application A Class" Title: ""
Title changed at 15:52:4:3 to "Application A"
Title changed at 15:52:10:212 to "Application A - File1"
[โ€ฆ]
Process ID: 89c
Thread ID: d6c
[โ€ฆ]
Visible: true
Window placement command: SW_SHOWNORMAL
Placement changed at 15:54:57:506 to SW_SHOWMINIMIZED
Placement changed at 15:55:2:139 to SW_SHOWNORMAL
Foreground: false
Foreground changed at 15:52:4:3 to true
Foreground changed at 15:53:4:625 to false
Foreground changed at 15:53:42:564 to true
Foreground changed at 15:53:44:498 to false
Foreground changed at 15:53:44:498 to true
Foreground changed at 15:53:44:592 to false
Foreground changed at 15:53:45:887 to true
Foreground changed at 15:53:47:244 to false
Foreground changed at 15:53:47:244 to true
Foreground changed at 15:53:47:353 to false
Foreground changed at 15:54:26:416 to true
Foreground changed at 15:54:27:55 to false
Foreground changed at 15:54:27:55 to true
Foreground changed at 15:54:27:180 to false
[โ€ฆ]
Handle: 000D0540 Class: "App B" Title: "Application B"
[...]
Process ID: 3ac
Thread ID: bd4
[...]
Foreground: false
Foreground changed at 15:50:36:972 to true
Foreground changed at 15:50:53:732 to false
Foreground changed at 15:50:53:732 to true
Foreground changed at 15:50:53:826 to false
Foreground changed at 15:51:51:352 to true
Foreground changed at 15:51:53:941 to false
Foreground changed at 15:53:8:135 to true
Foreground changed at 15:53:8:182 to false
Foreground changed at 15:53:10:178 to true
Foreground changed at 15:53:13:938 to false
Foreground changed at 15:53:30:443 to true
Foreground changed at 15:53:31:20 to false
Foreground changed at 15:53:31:20 to true
Foreground changed at 15:53:31:129 to false
[โ€ฆ]
Related Patterns
Basic Facts
Activity Regions
WindowHistory WindowHistory64
Trace Set Patterns
ยฉ 2012 Software Diagnostics Services
๏‚ž Master Trace
๏‚ž Bifurcation Point
๏‚ž Inter-Correlation
๏‚ž Relative Density
๏‚ž News Value
๏‚ž Impossible Trace
๏‚ž Split Trace
Master Trace
ยฉ 2012 Software Diagnostics Services
Related Patterns
Activity Regions
Background Modules
Foreground Modules
Event Sequence Order
Guest Module
Implementation Discourse
Bifurcation Point
Bifurcation Point
ยฉ 2012 Software Diagnostics Services
Software Trace Diagrams
Time
# PID TID Time Message
# PID TID Message
----------------------------------
[โ€ฆ]
25 2768 3056 Trace Statement A
26 3756 2600 Trace Statement B
27 3756 2600 Trace Statement C
[โ€ฆ]
149 3756 836 Query result: X
150 3756 836 Trace Statement 150.1
151 3756 836 Trace Statement 151.1
152 3756 836 Trace Statement 152.1
153 3756 836 Trace Statement 153.1
[โ€ฆ]
# PID TID Message
-----------------------------------
[โ€ฆ]
27 2768 3056 Trace Statement A
28 3756 2176 Trace Statement B
29 3756 2176 Trace Statement C
[โ€ฆ]
151 3756 5940 Query result: Y
152 3756 5940 Trace Statement 152.2
153 3756 5940 Trace Statement 153.2
154 3756 5940 Trace Statement 154.2
155 3756 5940 Trace Statement 155.2
[โ€ฆ]
Inter-Correlation
ยฉ 2012 Software Diagnostics Services
System
Tracing Tool
Tracing Tool
Trace File Trace File
Related Patterns
Intra-Correlation
Basic Facts
Discontinuity
Sparse Trace
Relative Density
ยฉ 2012 Software Diagnostics Services
# PID TID Time Message
Time
# PID TID Time Message
Time
1 / 1
3 / 1
Related Patterns
Message Density
News Value
ยฉ 2012 Software Diagnostics Services
Related Patterns
Inter-Correlation
Basic Facts
Master Trace
1
2
3
4
Time
Impossible Trace
ยฉ 2012 Software Diagnostics Services
# Module PID TID Message
-------------------------------
[โ€ฆ]
1001 ModuleA 202 404 foo: start
1002 ModuleA 202 404 foo: end
[โ€ฆ]
void foo()
{
TRACE("foo: start");
bar();
TRACE("foo: end");
}
void bar()
{
TRACE("bar: start");
// some code ...
TRACE("bar: end");
}
Related Patterns
Sparse Trace
Split Trace
ยฉ 2012 Software Diagnostics Services
Time
# PID TID Time Message # PID TID Time Message # PID TID Time Message
Related Patterns
Circular Trace
12.12.12
ยฉ 2012 Software Diagnostics Services
Related Patterns
Adjoint Thread
Discontinuity
Time Delta
Periodic Message Block
MM=DD=YY
Part 3: Practice Exercises
ยฉ 2012 Software Diagnostics Services
Links
Not included in Public Preview version
ยฉ 2012 Software Diagnostics Services
Process Monitor Examples
Exercises T1-T6
ยฉ 2012 Software Diagnostics Services
Exercise T1
๏‚ž Goal: Learn how to identify application crashes
๏‚ž Patterns: Background Modules, Adjoint Thread of Activity,
Discontinuity, Guest Module, Fiber Bundle
ยฉ 2012 Software Diagnostics Services
Exercise T2
ยฉ 2012 Software Diagnostics Services
๏‚ž Goal: Learn how to identify CPU consumption, profile
processes and threads
๏‚ž Patterns: Activity Region, Characteristic Message Block,
Periodic Message Block, Thread of Activity, No Activity,
Counter Value, Sparse Trace
Exercise T3
ยฉ 2012 Software Diagnostics Services
๏‚ž Goal: Learn how to calculate message current and density
๏‚ž Patterns: Activity Region, Thread of Activity, Time Delta,
Message Current, Message Density, Relative Density
Exercise T4
ยฉ 2012 Software Diagnostics Services
๏‚ž Goal: Learn how to compare software traces
๏‚ž Patterns: Master Trace, Characteristic Message Block,
Bifurcation Point
Exercise T5
ยฉ 2012 Software Diagnostics Services
๏‚ž Goal: Learn process startup sequence for terminal services
session
๏‚ž Patterns: Adjoint Thread of Activity, Anchor Messages,
Message Interleave
Exercise T6
ยฉ 2012 Software Diagnostics Services
๏‚ž Goal: Learn how to work with split traces
๏‚ž Patterns: Split Trace, Adjoint Thread of Activity, Fiber Bundle
Using Excel for Analysis
Debugging TV Frame 0x15
ยฉ 2012 Software Diagnostics Services
Resources
๏‚ž TraceAnalysis.org
๏‚ž Windows Internals, 6th ed.
๏‚ž Inside Windows Debugging
๏‚ž Introduction to Pattern-Driven Software Problem Solving
๏‚ž Software Trace and Memory Dump Analysis
๏‚ž Software Narratology: An Applied Science of Software Stories
๏‚ž Introduction to Pattern-Driven Software Diagnostics
๏‚ž Systemic Software Diagnostics
๏‚ž Debugging TV
๏‚ž Memory Dump Analysis Anthology (volumes 3, 4, 5, 6)
ยฉ 2012 Software Diagnostics Services
Q&A
Please send your feedback using the contact
form on DumpAnalysis.com
ยฉ 2012 Software Diagnostics Services
Thank you for attendance!
ยฉ 2012 Software Diagnostics Services

More Related Content

Similar to Accelerated Windows Software Trace Analysis training public slides (20)

PDF
A project report on chat application
Kumar Gaurav
ย 
PDF
Accelerated Mac OS X Core Dump Analysis training public slides
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x10
Dmitry Vostokov
ย 
DOCX
ASE
Mohamed Sahar
ย 
PPT
Microsoft .Net Framework 2 0
Acend Corporate Learning
ย 
PDF
Security Development Lifecycle Tools
n|u - The Open Security Community
ย 
PPTX
microsoft visual studio .net introduction from ids team
royaljaiitsolutions
ย 
PDF
CertsOut Checkpoint-156-587 exam dumps pdf
Dumpcollection
ย 
PDF
Accelerated Disassembly, Reconstruction and Reversing training public slides
Dmitry Vostokov
ย 
PDF
D pduapi user-manual
linhdoanbro
ย 
PDF
Model Driven, Component Based Development for CBDDS and IDL to C++11
Remedy IT
ย 
PPT
Guide To Windows 7 - Introduction to Windows 7
Gene Carboni
ย 
PDF
SERENE 2014 School: Luigi pomante serene2014_school
Henry Muccini
ย 
PDF
SERENE 2014 School: System-Level Concurrent Error Detection
SERENEWorkshop
ย 
PPTX
Azure presentation nnug dec 2010
Ethos Technologies
ย 
PDF
Systemic Software Diagnostics
Dmitry Vostokov
ย 
PPT
The Magic Of Application Lifecycle Management In Vs Public
David Solivan
ย 
PDF
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
CODE BLUE
ย 
DOC
Parimal Resume
Parimal Thakkar
ย 
A project report on chat application
Kumar Gaurav
ย 
Accelerated Mac OS X Core Dump Analysis training public slides
Dmitry Vostokov
ย 
Debugging TV Frame 0x10
Dmitry Vostokov
ย 
Microsoft .Net Framework 2 0
Acend Corporate Learning
ย 
Security Development Lifecycle Tools
n|u - The Open Security Community
ย 
microsoft visual studio .net introduction from ids team
royaljaiitsolutions
ย 
CertsOut Checkpoint-156-587 exam dumps pdf
Dumpcollection
ย 
Accelerated Disassembly, Reconstruction and Reversing training public slides
Dmitry Vostokov
ย 
D pduapi user-manual
linhdoanbro
ย 
Model Driven, Component Based Development for CBDDS and IDL to C++11
Remedy IT
ย 
Guide To Windows 7 - Introduction to Windows 7
Gene Carboni
ย 
SERENE 2014 School: Luigi pomante serene2014_school
Henry Muccini
ย 
SERENE 2014 School: System-Level Concurrent Error Detection
SERENEWorkshop
ย 
Azure presentation nnug dec 2010
Ethos Technologies
ย 
Systemic Software Diagnostics
Dmitry Vostokov
ย 
The Magic Of Application Lifecycle Management In Vs Public
David Solivan
ย 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
CODE BLUE
ย 
Parimal Resume
Parimal Thakkar
ย 

More from Dmitry Vostokov (20)

PDF
Accelerated Windows Debugging 3 training public slides
Dmitry Vostokov
ย 
PDF
Accelerated .NET Memory Dump Analysis training public slides
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x1C
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x1A
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x34
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x33
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x31
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x25
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x24
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x21
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x20
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x19
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x18
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x17
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x16
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x13
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x12
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x11
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x0F
Dmitry Vostokov
ย 
PDF
Debugging TV Frame 0x0D
Dmitry Vostokov
ย 
Accelerated Windows Debugging 3 training public slides
Dmitry Vostokov
ย 
Accelerated .NET Memory Dump Analysis training public slides
Dmitry Vostokov
ย 
Debugging TV Frame 0x1C
Dmitry Vostokov
ย 
Debugging TV Frame 0x1A
Dmitry Vostokov
ย 
Debugging TV Frame 0x34
Dmitry Vostokov
ย 
Debugging TV Frame 0x33
Dmitry Vostokov
ย 
Debugging TV Frame 0x31
Dmitry Vostokov
ย 
Debugging TV Frame 0x25
Dmitry Vostokov
ย 
Debugging TV Frame 0x24
Dmitry Vostokov
ย 
Debugging TV Frame 0x21
Dmitry Vostokov
ย 
Debugging TV Frame 0x20
Dmitry Vostokov
ย 
Debugging TV Frame 0x19
Dmitry Vostokov
ย 
Debugging TV Frame 0x18
Dmitry Vostokov
ย 
Debugging TV Frame 0x17
Dmitry Vostokov
ย 
Debugging TV Frame 0x16
Dmitry Vostokov
ย 
Debugging TV Frame 0x13
Dmitry Vostokov
ย 
Debugging TV Frame 0x12
Dmitry Vostokov
ย 
Debugging TV Frame 0x11
Dmitry Vostokov
ย 
Debugging TV Frame 0x0F
Dmitry Vostokov
ย 
Debugging TV Frame 0x0D
Dmitry Vostokov
ย 
Ad

Recently uploaded (20)

PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
ย 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
ย 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
ย 
PDF
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
ย 
PDF
Why is partnering with a SaaS development company crucial for enterprise succ...
Nextbrain Technologies
ย 
PDF
NPD Software -Omnex systems
omnex systems
ย 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
ย 
PPTX
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
ย 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
ย 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
ย 
PPTX
Library_Management_System_PPT111111.pptx
nmtnissancrm
ย 
PDF
intro_to_cpp_namespace_robotics_corner.pdf
MohamedSaied877003
ย 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
ย 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
ย 
PPTX
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
ย 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
ย 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
ย 
PPTX
From spreadsheets and delays to real-time control
SatishKumar2651
ย 
PPTX
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
ย 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
ย 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
ย 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
ย 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
ย 
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
ย 
Why is partnering with a SaaS development company crucial for enterprise succ...
Nextbrain Technologies
ย 
NPD Software -Omnex systems
omnex systems
ย 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
ย 
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
ย 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
ย 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
ย 
Library_Management_System_PPT111111.pptx
nmtnissancrm
ย 
intro_to_cpp_namespace_robotics_corner.pdf
MohamedSaied877003
ย 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
ย 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
ย 
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
ย 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
ย 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
ย 
From spreadsheets and delays to real-time control
SatishKumar2651
ย 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
ย 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
ย 
Ad

Accelerated Windows Software Trace Analysis training public slides

  • 1. Windows Software Trace Analysis Dmitry Vostokov Software Diagnostics Services
  • 2. Whatโ€™s it all About? ๏‚ž General Trace Analysis Patterns ๏‚ž Windows context ยฉ 2012 Software Diagnostics Services
  • 3. Prerequisites Basic Windows troubleshooting ยฉ 2012 Software Diagnostics Services
  • 4. Training Goals ๏‚ž Review tracing fundamentals ๏‚ž Learn trace analysis patterns ๏‚ž Practice finding patterns in logs ยฉ 2012 Software Diagnostics Services
  • 5. Training Principles ๏‚ž Lots of pictures ๏‚ž Pattern relationships ๏‚ž Practical examples ยฉ 2012 Software Diagnostics Services
  • 6. Schedule Summary Day 1 ๏‚ž Trace Analysis Fundamentals ๏‚ž Trace Analysis Patterns Day 2 ๏‚ž Trace Analysis Patterns ๏‚ž Examples ยฉ 2012 Software Diagnostics Services
  • 7. Part 1: Fundamentals ยฉ 2012 Software Diagnostics Services
  • 8. Basic Concepts ยฉ 2012 Software Diagnostics Services ๏‚ž Software Trace (or Log) ๏‚ž Process ๏‚ž Thread ๏‚ž Adjoint Thread ๏‚ž Module (or Source) ๏‚ž File ๏‚ž Function ๏‚ž Message (or Operation) ๏‚ž Stack trace
  • 9. Software Trace (Log) ยฉ 2012 Software Diagnostics Services ๏‚ž A sequence of formatted messages ๏‚ž Arranged by time ๏‚ž A narrative story
  • 10. Process ยฉ 2012 Software Diagnostics Services ๏‚ž PID ๏‚ž Session ๏‚ž Image Name ๏‚ž Modules (DLLs) ๏‚ž Examples: svchost.exe notepad.exe PID 1 PID 2 PID 3 PID 4
  • 11. Thread ยฉ 2012 Software Diagnostics Services ๏‚ž TID ๏‚ž CPU ๏‚ž Context PID CPU 1 CPU 2 TID 1 TID 1 TID 2
  • 12. Adjoint Thread ยฉ 2012 Software Diagnostics Services Debugging TV Frame 0x14
  • 13. Exercise T0 ยฉ 2012 Software Diagnostics Services 1. Download Process Monitor 2. Trace system activity 3. Add more columns such as TID 4. Filter a thread based on TID 5. Reset filter 6. Filter an adjoint thread based on image name svchost.exe 7. Filter an adjoint thread based on PID
  • 14. Module / Source ยฉ 2012 Software Diagnostics Services ๏‚ž Module Name ๏‚ž Source Folder ApplicationA.exe sourcelibrary svchost.exe ApplicationA.exe ModuleB.dll ModuleC.dll sourcelibrary*.c
  • 15. File and Function ยฉ 2012 Software Diagnostics Services // MainApp.c foo () { trace(โ€œfoo: entryโ€); // do stuff trace(โ€œfoo: exitโ€); } MainApp.c MainApp.c: foo MainApp.c
  • 16. Trace Message ยฉ 2012 Software Diagnostics Services // MainApp.c foo () { trace(โ€œfoo: entryโ€); int result = bar(); trace(โ€œbar result: 5โ€); trace(โ€œfoo: exitโ€); } Invariant Variable Invariant Variable โ€ฆ
  • 17. Stack Trace ยฉ 2012 Software Diagnostics Services // MainApp.c main() { trace(โ€œstartโ€); foo(); } foo() { trace(โ€œfoo: entryโ€); bar(); } bar() { trace(โ€œbar: entryโ€); // do stuff } bar: entry foo: entry start bar foo main foo main
  • 18. Trace Recording Tools ยฉ 2012 Software Diagnostics Services ๏‚ž Process Monitor ๏‚ž MessageHistory ๏‚ž CDFControl
  • 19. Trace Analysis Tools ยฉ 2012 Software Diagnostics Services ๏‚ž Process Monitor ๏‚ž CDFControl ๏‚ž CDFAnalyzer ๏‚ž MS Office Excel
  • 20. Minimal Trace Graphs ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message No Module PID TID Date Time Message ----------------------------------------------------------- 1 ModuleA 4280 1736 5/28/2012 08:53:50.496 Trace message 1 2 ModuleB 6212 6216 5/28/2012 08:53:52.876 Trace message 2 [โ€ฆ]
  • 21. Trace Formats ยฉ 2012 Software Diagnostics Services ๏‚ž ETW ๏‚ž CDF ๏‚ž CSV ๏‚ž Free ๏‚ž Mixed
  • 22. Pattern-Driven Analysis Pattern: a common recurrent identifiable problem together with a set of recommendations and possible solutions to apply in a specific context Checklist: http://www.dumpanalysis.org/blog/index.php/2011/03/10/software- trace-analysis-checklist/ Patterns: http://www.dumpanalysis.org/blog/index.php/trace-analysis- patterns/ ยฉ 2012 Software Diagnostics Services Trace Collection Checklists Patterns Action
  • 23. Pattern-Based Analysis ยฉ 2012 Software Diagnostics Services Software Trace New Pattern Discovery Pattern Catalog + Usage
  • 24. Pattern Hierarchy ยฉ 2012 Software Diagnostics Services ๏‚ž Domain Independent from IBM mainframes to mobile and embedded computers ๏‚ž Domain Specific
  • 25. Pattern Classification ยฉ 2012 Software Diagnostics Services ๏‚ž Vocabulary ๏‚ž Error ๏‚ž Trace as a Whole ๏‚ž Large Scale ๏‚ž Activity ๏‚ž Message ๏‚ž Block ๏‚ž Trace Set
  • 26. Part 2: Individual Patterns ยฉ 2012 Software Diagnostics Services
  • 27. Vocabulary Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Basic Facts ๏‚ž Vocabulary Index
  • 28. Basic Facts ยฉ 2012 Software Diagnostics Services ๏‚ž Problem Description Application disappears after launch ๏‚ž Software Trace PID Message ----------------------------------- โ€ฆ 3f6 Create process AppA: PID 4a5 4a5 AppA loads DLLC โ€ฆ 3f6 Create process AppB: PID 5b8 5b8 AppB loads DLLD โ€ฆ Related Patterns Vocabulary Index
  • 29. Basic Facts Taxonomy ยฉ 2012 Software Diagnostics Services ๏‚ž Functional Facts Example: Expected a dialog to enter data ๏‚ž Non-functional Facts Example: CPU consumption 100% ๏‚ž Identification Facts Application name, PID, user name
  • 30. Vocabulary Index ยฉ 2012 Software Diagnostics Services Related Patterns Basic Facts Activity Region ๏‚ž Problem Description A user Test123 authentication failed basic fact index ๏‚ž Narrowing:
  • 31. Error Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Error Message ๏‚ž Exception Stack Trace ๏‚ž False Positive Error ๏‚ž Periodic Error โ†“* ๏‚ž Error Distribution * โ€˜โ†“โ€™ sign means that a pattern involves time dependency
  • 32. Error Message ยฉ 2012 Software Diagnostics Services Related Patterns False Positive Error Periodic Error Error Distribution Adjoint Thread Data Flow๏‚ž Explicit errors ๏‚ž Implicit errors ๏‚ž WinDbg command !error 0:000> !error c0000017 Error code: (NTSTATUS) 0xc0000017 (3221225495) - {Not Enough Quota} Not enough virtual memory or paging file quota is available to complete the specified operation. 0:000> !error 5 Error code: (Win32) 0x5 (5) - Access is denied.
  • 33. Exception Stack Trace ยฉ 2012 Software Diagnostics Services No PID TID Message ------------------------ [โ€ฆ] 265799 8984 4216 ComponentA.Store.GetData threw exception: โ€˜System.Reflection.TargetInvocationException: DCOM connection to server failed with error: โ€˜Exception from HRESULT: 0ร—842D0001โ€ฒ โ€”> System.Runtime.InteropServices.COMException (0ร—842D0001): Exception from HRESULT: 0ร—842D0001 265800 8984 4216 === Exception Stack Trace === 265801 8984 4216 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 265802 8984 4216 at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 265803 8984 4216 at ComponentA.Store.GetData(Byte[] pKey) 265804 8984 4216 at ComponentA.App.EnumBusinessObjects() [โ€ฆ] Related Patterns Error Message
  • 34. Periodic Error โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Error Message Error Distribution False Positive Error Message Invariant No PID TID Message ----------------------- [โ€ฆ] 36495 1788 2250 MyClass::Init: Cannot open connection โ€œClient ID: 310โ€ณ, status=5 [โ€ฆ] [โ€ฆ] 36883 1788 1986 MyClass::Init: Cannot open connection โ€œClient ID: 612โ€ณ, status=5 [โ€ฆ] Time # PID TID Time Message
  • 35. False Positive Error ยฉ 2012 Software Diagnostics Services ๏‚ž Expected errors ๏‚ž Not relevant to our problem ๏‚ž Implementation details Related Patterns Error Message Master Trace Activity Region
  • 36. Error Distribution ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message Related Patterns Partition Activity Region
  • 37. Trace as a Whole ยฉ 2012 Software Diagnostics Services ๏‚ž Partition ๏‚ž Circular Trace โ†“ ๏‚ž Message Density ๏‚ž Message Current โ†“ ๏‚ž Trace Acceleration โ†“ ๏‚ž No Trace Metafile ๏‚ž Empty Trace ๏‚ž Missing Module ๏‚ž Guest Module ๏‚ž Truncated Trace โ†“ ๏‚ž Visibility Limit ๏‚ž Sparse Trace
  • 38. Partition ยฉ 2012 Software Diagnostics Services Related Patterns Significant Event Truncated Trace Adjoint Thread Tail Epilogue Head Time Prologue Core # PID TID Time Message
  • 39. Circular Trace โ†“ ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message Problem Repro No Module PID TID Date Time Message --------------------------------------------------------------- 1 ModuleA 4280 1736 5/28/2009 08:53:50.496 Trace message 1 2 ModuleB 6212 6216 5/28/2009 08:53:52.876 Trace message 2 3 ModuleA 4280 4776 5/28/2009 08:54:13.537 Trace message 3 [โ€ฆ] 3799 ModuleA 4280 3776 5/28/2009 09:15:00.853 Trace message 3799 3800 ModuleA 4280 1736 5/27/2009 09:42:12.029 Trace message 3800 [โ€ฆ] 579210 ModuleA 4280 4776 5/28/2009 08:53:35.989 Trace message 579210 Related Patterns Focus of Tracing
  • 40. Message Density ยฉ 2012 Software Diagnostics Services D1 > D2 Similar relative density for 2 traces may shows correlation: D11 / D21 = D12 / D22 For correlated messages different densities from 2 traces may show different partition or system conditions: D11 >> D12 Time # PID TID Time Message Related Patterns Intra-correlation Focus of Tracing Relative Density Partition
  • 41. Message Current โ†“ ยฉ 2012 Software Diagnostics Services J1 > J2 Time # PID TID Time Message Time # PID TID Time Message 10.100 10.200 10.100 12.100 Related Patterns Significant Event Activity Region Message Density
  • 42. Trace Acceleration โ†“ ยฉ 2012 Software Diagnostics Services Message current Ji < Jj, i < j < N Partial message currents: with respect to TID X Jk(TID=x) with respect to PID Y Jk(PID=y) with respect to PID X and TID Z Jk(PID=y & TID=z) Jj Jl JN Time Ji Jk Jm # PID TID Time Message Related Patterns Activity Region Message Current Thread of Activity Adjoint Thread of Activitiy
  • 43. No Trace Metafile ยฉ 2012 Software Diagnostics Services # Module PID TID Time Message ------------------------------------------- [โ€ฆ] 21372 dllA 2968 5476 3:55:10.004 Calling foo() 21373 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found). 21374 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found) 21375 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found) 21376 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found) 21377 Unknown 2968 5476 3:55:10.004 Unknown GUID=A1E38F24-613D-4D71-B9F5-โ€ฆ (No Format Information found) 21378 dllA 2968 5476 3:55:10.004 Calling bar() [โ€ฆ] Possible patterns to detect: ๏‚ž Circular Trace ๏‚ž Message Density ๏‚ž Message Current ๏‚ž Discontinuity ๏‚ž Time Delta ๏‚ž Trace Acceleration Related Patterns Thread of Activity
  • 44. Empty Trace ยฉ 2012 Software Diagnostics Services Related Patterns Truncated Trace No Activity Missing Module ๏‚ž Small file size ๏‚ž Very few trace messages Always open a trace before sending to someone else
  • 45. Missing Module ยฉ 2012 Software Diagnostics Services Related Patterns Discontinuity Inter-Correlation No Activity Time # PID TID Time Message Missing Tracing Best Practices
  • 46. Guest Module ยฉ 2012 Software Diagnostics Services Related Patterns Missing ModuleTime # PID TID Time Message Load: 3rdPartyActivity.dll
  • 47. Truncated Trace โ†“ ยฉ 2012 Software Diagnostics Services Tail Epilogue Head Time Prologue Core # PID TID Time Message Head Prologue Core # PID TID Time Message Related Patterns Partition Anchor Messages Missing Module
  • 48. Visibility Limit ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message r Related Patterns Truncated Trace Missing Module Sparse Trace
  • 49. Sparse Trace ยฉ 2012 Software Diagnostics Services Related Patterns Missing Module Visibility Limit Time # PID TID Time Message Missing L PLOT
  • 50. Large Scale Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Characteristic Block ๏‚ž Background Modules ๏‚ž Foreground Modules ๏‚ž Layered Periodization ๏‚ž Focus of Tracing ๏‚ž Event Sequence Order โ†“ ๏‚ž Trace Frames
  • 51. Birdโ€™s Eye Binary View ยฉ 2012 Software Diagnostics Services
  • 52. Characteristic Block ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message
  • 53. Background Modules ยฉ 2012 Software Diagnostics Services Background: Foreground: Related Patterns Foreground ModulesTime # PID TID Time Message
  • 54. Foreground Modules ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message Time # PID TID Time Message Related Patterns Background Modules Module Foregrounding
  • 55. Layered Periodization ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message Time # PID TID Time Message Time # PID TID Time Message
  • 56. Focus of Tracing ยฉ 2012 Software Diagnostics Services Activity regions: Jm1, Jm2, Jm3 Related Patterns Activity RegionTime Jm1 Jm2 Jm3 # PID TID Time Message
  • 57. Event Sequence Order โ†“ ยฉ 2012 Software Diagnostics Services Synchronization Race Conditions Deadlock Related Patterns Significant Event Anchor Messages Time # PID TID Time Message E1 E2 E3 E4 E5 Time # PID TID Time Message E2 E3 E4 E5 E1
  • 58. Frames (Source Code) ยฉ 2012 Software Diagnostics Services Visual Studio 2012
  • 59. Trace Frames ยฉ 2012 Software Diagnostics Services Related Patterns Thread of Activity Adjoint Thread Truncated Trace Discontinuity Time # PID TID Time Message
  • 60. Activity Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Thread of Activity โ†“ ๏‚ž Adjoint Thread of Activity โ†“ ๏‚ž No Activity ๏‚ž Activity Region ๏‚ž Discontinuity โ†“ ๏‚ž Time Delta โ†“ ๏‚ž Glued Activity ๏‚ž Break-in Activity โ†“ ๏‚ž Resume Activity โ†“ ๏‚ž Data Flow โ†“
  • 61. Thread of Activity โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Discontinuity Sparse Trace Time # PID TID Time Func Message # PID TID Time Func Message
  • 62. Adjoint Thread of Activity โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Thread of Activity Message Invariant Time # PID TID Time Func Message Time # PID TID Time Func Message
  • 63. No Activity ยฉ 2012 Software Diagnostics Services Related Patterns Discontinuity Sparse Trace Missing Module Time # PID TID Time Message We expect this process Causes: hang, wait chain, deadlock, terminated threads, CPU loop
  • 64. Activity Region ยฉ 2012 Software Diagnostics Services Message current : Jm2 > max (Jm1,Jm3) Time Jm1 Jm2 Jm3 # PID TID Time Message Related Patterns Message Current Characteristic Block
  • 65. Discontinuity โ†“ ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message Time # PID TID Time Message Related Patterns Thread of Activity Missing Module Sparse Trace Possible causes: Blocked thread, IPC response delay, wait chains, long computation
  • 66. Time Delta โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Basic Facts Thread of Activity Discontinuity Significant Event # Module PID TID Time File Function Message --------------------------------------------------------------------------------------------------- 6060 dllA 1604 7108 10:06:21.746 fileA.c DllMain DLL_PROCESS_ATTACH 24480 dllA 1604 7108 10:06:32.262 fileA.c LaunchApp Exec Path: C:Program FilesCompanyAappB.exe 30 seconds of discontinuity till the end of full trace Time # PID TID Time Message
  • 67. Glued Activity ยฉ 2012 Software Diagnostics Services ATID: Adjoint Thread ID ImageA ATID 2 ImageB ATID 3 Time # ATID TID Time Message Related Patterns Adjoint Thread Time Trace Session 1 # PID TID Time Message Trace Session 2
  • 68. Break-in Activity โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Thread of Activity Adjoint Thread Discontinuity Resume Activity Time # PID TID Time Message Discontinuity
  • 69. Resume Activity โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Break-in Activity Thread of Activity Adjoint Thread Time # PID TID Time Message Discontinuity
  • 70. Data Flow โ†“ ยฉ 2012 Software Diagnostics Services # PID TID Time Message Time Related Patterns Adjoint Thread Message Invariant [โ€ฆ] DriverA: Device 0xA IRP 0xB [โ€ฆ] DriverB: Device 0xC IRP 0xB [โ€ฆ] DriverC: Device 0xD IRP 0xB DriverC: Processing IRP 0xB [โ€ฆ]
  • 71. Message Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Significant Event ๏‚ž Defamiliarizing Effect ๏‚ž Anchor Messages ๏‚ž Diegetic Messages ๏‚ž Message Change โ†“ ๏‚ž Message Invariant ๏‚ž UI Message ๏‚ž Original Message ๏‚ž Implementation Discourse ๏‚ž Opposition Messages ๏‚ž Linked Messages ๏‚ž Gossip โ†“ ๏‚ž Counter Value ๏‚ž Message Context ๏‚ž Marked Messages ๏‚ž Incomplete History ๏‚ž Message Interleave ๏‚ž Fiber Bundle
  • 72. Significant Event ยฉ 2012 Software Diagnostics Services Related Patterns Exception Stack Trace Error Message Basic Facts Vocabulary Index Time # PID TID Time Message
  • 73. ยฉ 2012 Software Diagnostics Services Poetry of Software Traces โ€œCapturing delicate moments, one gives birth to a poetry of traces โ€ฆโ€ Ange Leccia, Motionless Journeys, by Fabien Danesi
  • 74. Defamiliarizing Effect ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message Time # PID TID Time Message Related Patterns Characteristic Block Activity Region
  • 75. Anchor Messages ยฉ 2012 Software Diagnostics Services Related Patterns Vocabulary Index Adjoint Thread Message Interleave Time # PID TID Time Message # PID TID Time Message ---------------------------------------------------------- 24226 2656 3480 10:41:05.774 AppA.exe: DLL_PROCESS_ATTACH 108813 4288 4072 10:41:05.774 AppB.exe: DLL_PROCESS_ATTACH 112246 4180 3836 10:41:05.940 DllHost.exe: DLL_PROCESS_ATTACH 135473 2040 3296 10:41:12.615 AppC.exe: DLL_PROCESS_ATTACH 694723 1112 1992 10:44:23.393 AppD.exe: DLL_PROCESS_ATTACH 703962 5020 1080 10:44:42.014 DllHost.exe: DLL_PROCESS_ATTACH 705511 4680 3564 10:44:42.197 DllHost.exe: DLL_PROCESS_ATTACH 705891 1528 2592 10:44:42.307 regedit.exe: DLL_PROCESS_ATTACH 785231 2992 4912 10:45:26.516 AppE.exe: DLL_PROCESS_ATTACH 786523 3984 1156 10:45:26.605 powershell.exe: DLL_PROCESS_ATTACH 817979 4188 4336 10:45:48.707 wermgr.exe: DLL_PROCESS_ATTACH 834875 3976 1512 10:45:52.342 LogonUI.exe: DLL_PROCESS_ATTACH 835229 4116 3540 10:45:52.420 AppG.exe: DLL_PROCESS_ATTACH
  • 76. Message Interleave ยฉ 2012 Software Diagnostics Services Related Patterns Adjoint Thread Anchor Messages Time # PID TID Time Message
  • 77. Diegetic Messages ยฉ 2012 Software Diagnostics Services Time # PID TID Time Func Message Process PID 234 is OK Status OK Status OK Status OK Related Patterns Anchor Messages
  • 78. Message Change โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Anchor Messages Message Invariant Adjoint Thread Status = 0x0 Time # PID TID Time Message Status = 0x0 Status = 0x0 Status = 0xc0000017 Status = 0xc0000017 Status = 0xc0000017
  • 79. Implementation Discourse ยฉ 2012 Software Diagnostics Services ๏‚ž Win32 API ๏‚ž MFC ๏‚ž Kernel Development ๏‚ž COM ๏‚ž C# / .NET ๏‚ž C++ ๏‚ž Java ๏‚ž โ€ฆ
  • 80. Message Invariant ยฉ 2012 Software Diagnostics Services # Module PID TID Time Message ------------------------------------------------------------------------------------------- [โ€ฆ] 2782 ModuleA 2124 5648 10:58:03.356 CreateObject: pObject 0ร—00A83D30 data ([โ€ฆ]) version 0ร—4 [โ€ฆ] # Module PID TID Time Message ------------------------------------------------------------------------------------------- [โ€ฆ] 4793 ModuleA 2376 8480 09:22:01.947 CreateObject: pObject 0ร—00BA4E20 data ([โ€ฆ]) version 0ร—5 [โ€ฆ] Related Patterns Trace Set
  • 81. UI Message ยฉ 2012 Software Diagnostics Services Related Patterns Activity Region Significant Event Thread of Activity Adjoint Thread # Module PID TID Time Message -------------------------------------------------------------------------------- [โ€ฆ] 2782 ModuleA 2124 5648 10:58:03.356 CreateWindow: Title "..." Class "..." [โ€ฆ] 3512 ModuleA 2124 5648 10:58:08.154 Menu command: Save Data [โ€ฆ] 3583 ModuleA 2124 5648 10:58:08.155 CreateWindow: Title "Save As" Class "Dialog" [... Data update and replication related messages ...] 4483 ModuleA 2124 5648 10:58:12.342 DestroyWindow: Title "Save As" Class "Dialog" [โ€ฆ] # Module PID TID Time Message -------------------------------------------------------------------------------- [โ€ฆ] 2782 ModuleA 2124 5648 10:58:03.356 CreateWindow: Title "..." Class "..." 3512 ModuleA 2124 5648 10:58:08.154 Menu command: Save Data 3583 ModuleA 2124 5648 10:58:08.155 CreateWindow: Title "Save As" Class "Dialog" 4483 ModuleA 2124 5648 10:58:12.342 DestroyWindow: Title "Save As" Class "Dialog" [โ€ฆ]
  • 82. Original Message ยฉ 2012 Software Diagnostics Services # Module PID TID Time Message --------------------------------------------------------------------------------------------------------- [โ€ฆ] 35835 ModuleA 12332 11640 18:27:28.720 LoadLibrary: Program FilesMyProductSystem32MyDLL.dll PID 12332 [โ€ฆ] 37684 ModuleA 12332 9576 18:27:29.063 LoadLibrary: Program FilesMyProductSystem32MyDLL.dll PID 12332 [โ€ฆ] 37687 ModuleA 12332 9576 18:27:29.064 LoadLibrary: Program FilesMyProductSystem32MyDLL.dll PID 12332 [โ€ฆ] Related Patterns Message Invariant Adjoint Thread
  • 83. Linked Messages ยฉ 2012 Software Diagnostics Services Time # PID TID Time Func Message CreateProcess AppB.exe CreateProcess AppA.exe ImageLoad AppB.exe ImageLoad AppC.exe ImageLoad AppA.exe CreateProcess AppC.exe Related Patterns Adjoint Thread # PID Message --------------------------------------------- [โ€ฆ] 128762 1260 CreateProcess: PPID 1260 PID 6356 [โ€ฆ] 128785 6356 ImageLoad: AppA.exe PID 6356 [โ€ฆ] 131137 6356 CreateProcess: PPID 6356 PID 6280 [โ€ฆ] 131239 6280 ImageLoad: AppB.exe PID 6280 [โ€ฆ] 132899 6356 CreateProcess: PPID 6356 PID 8144 [โ€ฆ] 132906 8144 ImageLoad: AppC.exe PID 8144 [โ€ฆ]
  • 84. Gossip โ†“ ยฉ 2012 Software Diagnostics Services Related Patterns Adjoint Thread Event Sequence Order Message Interleave # Module PID TID Message [โ€ฆ] 26875 ModuleA 2172 5284 LoadImage: DeviceHarddiskVolume2WindowsSystem32notepad.exe PID 0x000000000000087C 26876 ModuleB 2172 5284 LoadImage: DeviceHarddiskVolume2WindowsSystem32notepad.exe, PID (2172) 26877 ModuleC 2172 5284 ImageLoad: fileName=notepad.exe, pid: 000000000000087C [โ€ฆ] # Module PID TID Message [โ€ฆ] 26875 ModuleA 2172 5284 LoadImage: DeviceHarddiskVolume2WindowsSystem32notepad.exe PID 0ร—000000000000087C [โ€ฆ] 33132 ModuleA 4180 2130 LoadImage: DeviceHarddiskVolume2WindowsSystem32calc.exe PID 0ร—0000000000001054 [โ€ฆ]
  • 85. Counter Value ยฉ 2012 Software Diagnostics Services Module Variable 18:04:06 Explorer.EXE 3280 User Time: 8.4864544 seconds, Kernel Time: 9.5004609 seconds, Private Bytes: 42,311,680, Working Set: 10,530,816 Related Patterns Adjoint Thread Significant Event Activity Region Focus of Tracing Characteristic Message Block Performance-specific patterns: Global Monotonicity Constant Value
  • 86. Message Context ยฉ 2012 Software Diagnostics Services Related Patterns Significant Event Anchor Message Time # PID TID Time Message Context <- Message
  • 87. Marked Messages ยฉ 2012 Software Diagnostics Services Related Patterns Master Trace No Activity Annotated messages: session database queries [+] session initialization [-] socket activity [+] process A launched [+] process B launched [-] process A exited [-] [+] activity is present in a trace [-] activity is undetected or not present
  • 88. Fiber Bundle ยฉ 2012 Software Diagnostics Services I/O stack Thread stack trace Trace messages Related Patterns Exception Stack Trace
  • 89. Incomplete History ยฉ 2012 Software Diagnostics Services Related Patterns Opposition Messages Sparse Trace Truncated Trace Master Trace Code: ๏‚ž Response-complete ๏‚ž Exception-complete ๏‚ž Call-complete
  • 90. Opposition Messages ยฉ 2012 Software Diagnostics Services ๏‚ž open - close ๏‚ž create โ€“ destroy (discard) ๏‚ž allocate - free (deallocate) ๏‚ž call - return ๏‚ž enter - exit (leave) ๏‚ž load - unload ๏‚ž save - load ๏‚ž lock - unlock ๏‚ž map - unmap Related Patterns Incomplete History Sparse Trace
  • 91. Block Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Macrofunction ๏‚ž Periodic Message Block ๏‚ž Intra-Correlation
  • 92. Macrofunction ยฉ 2012 Software Diagnostics Services # Module PID TID Time Message ------------------------------------------------------------ [โ€ฆ] 42582 DBClient 5492 9476 11:04:33.398 Opening connection [โ€ฆ] 42585 DBClient 5492 9476 11:04:33.398 Sending SQL command [โ€ฆ] 42589 DBServer 6480 10288 11:04:33.399 Executing SQL command [โ€ฆ] 42592 DBClient 5492 9476 11:04:33.400 Closing connection [โ€ฆ]
  • 93. Periodic Message Block ยฉ 2012 Software Diagnostics Services Related Patterns Periodic Error Adjoint Thread Invariant Message Discontinuity Time # PID TID Time Message
  • 94. Intra-Correlation ยฉ 2012 Software Diagnostics Services Handle: 00050586 Class: "Application A Class" Title: "" Title changed at 15:52:4:3 to "Application A" Title changed at 15:52:10:212 to "Application A - File1" [โ€ฆ] Process ID: 89c Thread ID: d6c [โ€ฆ] Visible: true Window placement command: SW_SHOWNORMAL Placement changed at 15:54:57:506 to SW_SHOWMINIMIZED Placement changed at 15:55:2:139 to SW_SHOWNORMAL Foreground: false Foreground changed at 15:52:4:3 to true Foreground changed at 15:53:4:625 to false Foreground changed at 15:53:42:564 to true Foreground changed at 15:53:44:498 to false Foreground changed at 15:53:44:498 to true Foreground changed at 15:53:44:592 to false Foreground changed at 15:53:45:887 to true Foreground changed at 15:53:47:244 to false Foreground changed at 15:53:47:244 to true Foreground changed at 15:53:47:353 to false Foreground changed at 15:54:26:416 to true Foreground changed at 15:54:27:55 to false Foreground changed at 15:54:27:55 to true Foreground changed at 15:54:27:180 to false [โ€ฆ] Handle: 000D0540 Class: "App B" Title: "Application B" [...] Process ID: 3ac Thread ID: bd4 [...] Foreground: false Foreground changed at 15:50:36:972 to true Foreground changed at 15:50:53:732 to false Foreground changed at 15:50:53:732 to true Foreground changed at 15:50:53:826 to false Foreground changed at 15:51:51:352 to true Foreground changed at 15:51:53:941 to false Foreground changed at 15:53:8:135 to true Foreground changed at 15:53:8:182 to false Foreground changed at 15:53:10:178 to true Foreground changed at 15:53:13:938 to false Foreground changed at 15:53:30:443 to true Foreground changed at 15:53:31:20 to false Foreground changed at 15:53:31:20 to true Foreground changed at 15:53:31:129 to false [โ€ฆ] Related Patterns Basic Facts Activity Regions WindowHistory WindowHistory64
  • 95. Trace Set Patterns ยฉ 2012 Software Diagnostics Services ๏‚ž Master Trace ๏‚ž Bifurcation Point ๏‚ž Inter-Correlation ๏‚ž Relative Density ๏‚ž News Value ๏‚ž Impossible Trace ๏‚ž Split Trace
  • 96. Master Trace ยฉ 2012 Software Diagnostics Services Related Patterns Activity Regions Background Modules Foreground Modules Event Sequence Order Guest Module Implementation Discourse Bifurcation Point
  • 97. Bifurcation Point ยฉ 2012 Software Diagnostics Services Software Trace Diagrams Time # PID TID Time Message # PID TID Message ---------------------------------- [โ€ฆ] 25 2768 3056 Trace Statement A 26 3756 2600 Trace Statement B 27 3756 2600 Trace Statement C [โ€ฆ] 149 3756 836 Query result: X 150 3756 836 Trace Statement 150.1 151 3756 836 Trace Statement 151.1 152 3756 836 Trace Statement 152.1 153 3756 836 Trace Statement 153.1 [โ€ฆ] # PID TID Message ----------------------------------- [โ€ฆ] 27 2768 3056 Trace Statement A 28 3756 2176 Trace Statement B 29 3756 2176 Trace Statement C [โ€ฆ] 151 3756 5940 Query result: Y 152 3756 5940 Trace Statement 152.2 153 3756 5940 Trace Statement 153.2 154 3756 5940 Trace Statement 154.2 155 3756 5940 Trace Statement 155.2 [โ€ฆ]
  • 98. Inter-Correlation ยฉ 2012 Software Diagnostics Services System Tracing Tool Tracing Tool Trace File Trace File Related Patterns Intra-Correlation Basic Facts Discontinuity Sparse Trace
  • 99. Relative Density ยฉ 2012 Software Diagnostics Services # PID TID Time Message Time # PID TID Time Message Time 1 / 1 3 / 1 Related Patterns Message Density
  • 100. News Value ยฉ 2012 Software Diagnostics Services Related Patterns Inter-Correlation Basic Facts Master Trace 1 2 3 4 Time
  • 101. Impossible Trace ยฉ 2012 Software Diagnostics Services # Module PID TID Message ------------------------------- [โ€ฆ] 1001 ModuleA 202 404 foo: start 1002 ModuleA 202 404 foo: end [โ€ฆ] void foo() { TRACE("foo: start"); bar(); TRACE("foo: end"); } void bar() { TRACE("bar: start"); // some code ... TRACE("bar: end"); } Related Patterns Sparse Trace
  • 102. Split Trace ยฉ 2012 Software Diagnostics Services Time # PID TID Time Message # PID TID Time Message # PID TID Time Message Related Patterns Circular Trace
  • 103. 12.12.12 ยฉ 2012 Software Diagnostics Services Related Patterns Adjoint Thread Discontinuity Time Delta Periodic Message Block MM=DD=YY
  • 104. Part 3: Practice Exercises ยฉ 2012 Software Diagnostics Services
  • 105. Links Not included in Public Preview version ยฉ 2012 Software Diagnostics Services
  • 106. Process Monitor Examples Exercises T1-T6 ยฉ 2012 Software Diagnostics Services
  • 107. Exercise T1 ๏‚ž Goal: Learn how to identify application crashes ๏‚ž Patterns: Background Modules, Adjoint Thread of Activity, Discontinuity, Guest Module, Fiber Bundle ยฉ 2012 Software Diagnostics Services
  • 108. Exercise T2 ยฉ 2012 Software Diagnostics Services ๏‚ž Goal: Learn how to identify CPU consumption, profile processes and threads ๏‚ž Patterns: Activity Region, Characteristic Message Block, Periodic Message Block, Thread of Activity, No Activity, Counter Value, Sparse Trace
  • 109. Exercise T3 ยฉ 2012 Software Diagnostics Services ๏‚ž Goal: Learn how to calculate message current and density ๏‚ž Patterns: Activity Region, Thread of Activity, Time Delta, Message Current, Message Density, Relative Density
  • 110. Exercise T4 ยฉ 2012 Software Diagnostics Services ๏‚ž Goal: Learn how to compare software traces ๏‚ž Patterns: Master Trace, Characteristic Message Block, Bifurcation Point
  • 111. Exercise T5 ยฉ 2012 Software Diagnostics Services ๏‚ž Goal: Learn process startup sequence for terminal services session ๏‚ž Patterns: Adjoint Thread of Activity, Anchor Messages, Message Interleave
  • 112. Exercise T6 ยฉ 2012 Software Diagnostics Services ๏‚ž Goal: Learn how to work with split traces ๏‚ž Patterns: Split Trace, Adjoint Thread of Activity, Fiber Bundle
  • 113. Using Excel for Analysis Debugging TV Frame 0x15 ยฉ 2012 Software Diagnostics Services
  • 114. Resources ๏‚ž TraceAnalysis.org ๏‚ž Windows Internals, 6th ed. ๏‚ž Inside Windows Debugging ๏‚ž Introduction to Pattern-Driven Software Problem Solving ๏‚ž Software Trace and Memory Dump Analysis ๏‚ž Software Narratology: An Applied Science of Software Stories ๏‚ž Introduction to Pattern-Driven Software Diagnostics ๏‚ž Systemic Software Diagnostics ๏‚ž Debugging TV ๏‚ž Memory Dump Analysis Anthology (volumes 3, 4, 5, 6) ยฉ 2012 Software Diagnostics Services
  • 115. Q&A Please send your feedback using the contact form on DumpAnalysis.com ยฉ 2012 Software Diagnostics Services
  • 116. Thank you for attendance! ยฉ 2012 Software Diagnostics Services