DTrace on Windows – 20H1 updates

Published Jan 27 2020 11:51 AM 12K Views
Microsoft

We first released DTrace on Windows as a preview with the Windows 10 May 2019 Update. The feedback and reaction from our community was very gratifying. Thank you for taking the time to use DTrace on Windows and providing us with valuable feedback.

 

We have been quiet since the initial preview release, and today we are ready to talk about the updates we have made to DTrace on Windows. All of these changes are available in the latest Windows 10 Insider Preview (20H1) build, starting with 19041.21.

 

With these changes, we are now positioned to have customers broadly use DTrace on Windows.

 

Key resources

  1. DTrace on Windows developer docs
  2. GitHub for source code and sample scripts
  3. DTrace MSI

 

Removed kernel debugger requirement

This was the biggest hinderance in using DTrace on Windows internally and externally. We knew going in that we need to solve this, but we also knew that it would take time to solve this correctly. In 20H1, we have now removed the kernel debugger requirement. Windows kernel now relies on Virtualization-based Security (VBS) to securely insert dynamic trace points into kernel code. By relying on VBS, we can now safely and securely insert dynamic tracepoints in the kernel without disabling PatchGuard (enabling kernel debugger disables PatchGuard).  

 

Note: Because we made the change to rely on VBS for DTrace on Windows, the installer from 19H1 will only work on 19H1. For Windows 10 Insider Preview (post 19H1) builds, please use the updated installer linked in this post. This installer will NOT install on previous Windows 10 releases.

 

Lets get into how to setup and use DTrace on Windows.

 

Prerequisites for using the feature:

 

  • Windows 10 insider build 19041.21 or higher

Detailed instructions to install DTrace is available in our documentation. At a high-level, these are:

 

  1. Enable boot option to turn on DTrace
  2. Download and install the DTrace MSI.
  3. Ensure VBS is turned on  
  4. Optional: Update the PATH environment variableto include C:\Program Files\DTrace
    • set PATH=%PATH%;"C:\Program Files\DTrace"
  5. Setup symbol path
    • Create a new directory for caching symbols locally. Example: mkdir c:\symbols
    • Set _NT_SYMBOL_PATH=srv*C:\symbols*https://msdl.microsoft.com/download/symbols
    • DTrace automatically downloads the symbols necessary from the symbol server and caches to the local path.
  6. Reboot machine

To check if VBS is enabled or not, look at system summary tab on the Microsoft System Information tool (msinfo32.exe).

 

Msinfo32Msinfo32

ARM64 preview

Yes, that’s right! DTrace now supports ARM64 in preview mode. The ARM64 MSI is available in the download link listed above.

 

You can use it on your Surface Pro X running the latest Windows 10 Insider Preview (20H1) build, starting with 19041.21.

 

DTrace on Surface Pro XDTrace on Surface Pro X

User mode Stackwalk

In the preview, the stackwalk facility in DTrace was limited to Kernel mode (stack). This update adds support for usermode stackwalk facility (ustack). Like stack, ustack facility is fully compatible with open source DTrace specification. It can be invoked in three ways by specifying frames (depth) & size (ignored for now) or void.

 

  • Ustack(nframes, size)
  • Ustack(nframes)
  • Ustack()

While ustack () can determine the address of the calling frame when probe fires, the stack frames will not be translated into symbols until the ustack () action is processed at user-mode by DTrace consumer. Symbol download can slow down the output. Hence, it’s better to use this facility with locally cached symbols like below.

 

 

dtrace -n "profile-1ms /arg1/ {ustack(50, 0); exit(0);} " -y C:\symbols
dtrace: description 'profile-1ms ' matched 1 probe
CPU     ID                    FUNCTION:NAME
  0   3802                     :profile-1ms
              ntdll`ZwAllocateVirtualMemory+0x14
              ntdll`RtlAllocateHeap+0x3ded
              ntdll`RtlAllocateHeap+0x763
              ucrtbase`malloc_base+0x44

 

 

Live dump support

Windows commonly uses something called Live dump to help quickly diagnose issues. Live dumps help with troubleshooting issues involving multiple processes or system wide issues without downtime. In 20H1, DTrace on Windows can be used to capture a live dump from inside a D-script using the lkd() DTrace facility. A common use case of this facility is to instrument error path (like return code indicates a failure) and capture a live dump right at the failure point for advanced diagnostics. For more information on live dump support, see DTrace Live Dump 

 

 

dtrace -wn "syscall:::return { if (arg0 != 0xc0000001UL) { lkd(0); printf(\" Triggering Live dump \n \");exit(0); }}"
dtrace: description 'syscall:::return ' matched 1411 probes
dtrace: allowing destructive actions
CPU     ID                    FUNCTION:NAME
  0    181     NtDeviceIoControlFile:return  Triggering Live dump


dir c:\Windows\LiveKernelReports
 Volume in drive C has no label.
 Volume Serial Number is 70F4-B9F6

 Directory of c:\Windows\LiveKernelReports

11/05/2019  05:20 PM    <DIR>          .
11/05/2019  05:20 PM    <DIR>          ..
11/05/2019  05:19 PM    <DIR>          DTRACE
11/05/2019  05:20 PM        53,395,456 DTRACE-20191105-1720.dmp

 

 

ETW Tracing

ETW tracing is the most frequently used tool for debugging on Windows. In DTrace on Windows 19H1 preview, we added support for instrumenting tracelogged and manifested events using the ETW provider.

 

In 20H1, we further enhanced this facility to create new ETW events on the fly from inside a D-script using the ETW_Trace() facility. This helps in situations where existing ETW events are insufficient and you would like to add additional ETW trace points without modifying production code.

 

For more information about ETW_Trace facility and ETW provider, see DTrace ETW

 

 

/* 
Running the GitHub ETW provider sample (link below) to print node memory info event. 
https://github.com/microsoft/DTrace-on-Windows/blob/master/samples/windows/etw/numamemstats.d
*/ 

dtrace -qs numamemstats.d

Partition ID: 0
Count: 1
Node number: 1
m_nodeinfo {
    uint64_t TotalPageCount = 0x1fb558
    uint64_t SmallFreePageCount = 0x41
    uint64_t SmallZeroPageCount = 0
    uint64_t MediumFreePageCount = 0
    uint64_t MediumZeroPageCount = 0
    uint64_t LargeFreePageCount = 0
    uint64_t LargeZeroPageCount = 0
    uint64_t HugeFreePageCount = 0
    uint64_t HugeZeroPageCount = 0
}

 

 

 

This concludes a tour of some of our key updates to DTrace on Windows for 20H1.

 

You can get started by downloading & installing the DTrace MSI package on the latest 20H1 client/server insider build - 19041.21+.

 

You can also visit our GitHub page for contributing code and samples. We have several advanced scripts in GitHub to help users learn and use DTrace on Windows.

 

How to file feedback?

As always, we rely on feedback from our users to help improve the product. If you hit any problems or bugs, please use Feedback hub to let us know:

 

  1. Launch feedback hub by clicking this link
  2. Select Add new feedback.
  3. Please provide a detailed description of the issue.
  4. Currently, we do not automatically collect any debug traces, so your verbatim feedback is crucial for understanding and reproducing the issue. Pass on any verbose logs.
  5. You can also set DTRACE_DEBUG environment variable to 1 to collect verbose DTrace logs.
  6. Submit

 

We are excited to rollout these changes and look forward to working with the community to continue improving DTrace experience.

 

DTrace team (Andrey Shedel, Gopikrishna Kannan, Max Renke, Hari Pulapaka)

4 Comments
%3CLINGO-SUB%20id%3D%22lingo-sub-1127929%22%20slang%3D%22en-US%22%3EDTrace%20on%20Windows%20%E2%80%93%2020H1%20updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1127929%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWe%20first%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FWindows-Kernel-Internals%2FDTrace-on-Windows%2Fba-p%2F362902%22%20target%3D%22_blank%22%3Ereleased%3C%2FA%3E%20DTrace%20on%20Windows%20as%20a%20preview%20with%20the%20Windows%2010%20May%202019%20Update.%20The%20feedback%20and%20reaction%20from%20our%20community%20was%20very%20gratifying.%20Thank%20you%20for%20taking%20the%20time%20to%20use%20DTrace%20on%20Windows%20and%20providing%20us%20with%20valuable%20feedback.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20have%20been%20quiet%20since%20the%20initial%20preview%20release%2C%20and%20today%20we%20are%20ready%20to%20talk%20about%20the%20updates%20we%20have%20made%20to%20DTrace%20on%20Windows.%20All%20of%20these%20changes%20are%20available%20in%20the%20latest%20Windows%2010%20Insider%20Preview%20(20H1)%20build%2C%20starting%20with%20%3CA%20href%3D%22https%3A%2F%2Fblogs.windows.com%2Fwindowsexperience%2F2020%2F01%2F14%2Freleasing-windows-10-insider-preview-build-19041-21-to-the-slow-ring%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E19041.21%3C%2FA%3E.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWith%20these%20changes%2C%20we%20are%20now%20positioned%20to%20have%20customers%20broadly%20use%20DTrace%20on%20Windows.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3EKey%20resources%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-hardware%2Fdrivers%2Fdevtest%2Fdtrace%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDTrace%20on%20Windows%20developer%20docs%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FDTrace-on-Windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%20for%20source%20code%20and%20sample%20scripts%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fdownload%2Fdetails.aspx%3Fid%3D100441%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDTrace%20MSI%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-383292151%22%20id%3D%22toc-hId-383292151%22%20id%3D%22toc-hId-383292151%22%20id%3D%22toc-hId-383292151%22%20id%3D%22toc-hId-383292151%22%20id%3D%22toc-hId-383292151%22%20id%3D%22toc-hId-383292151%22%3ERemoved%20kernel%20debugger%20requirement%3C%2FH1%3E%0A%3CP%3E%3CSPAN%3EThis%20was%20the%20biggest%20hinderance%20in%20using%20DTrace%20on%20Windows%20internally%20and%20externally.%20We%20knew%20going%20in%20that%20we%20need%20to%20solve%20this%2C%20but%20we%20also%20knew%20that%20it%20would%20take%20time%20to%20solve%20this%20correctly.%20In%2020H1%2C%20we%20have%20now%20removed%20the%20kernel%20debugger%20requirement.%20Windows%20kernel%20now%20relies%20on%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-hardware%2Fdesign%2Fdevice-experiences%2Foem-vbs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EVirtualization-based%20Security%3C%2FA%3E%20(VBS)%20to%20securely%20insert%20dynamic%20trace%20points%20into%20kernel%20code.%20By%20relying%20on%20VBS%2C%20we%20can%20now%20safely%20and%20securely%20insert%20dynamic%20tracepoints%20in%20the%20kernel%20without%20disabling%20PatchGuard%20(enabling%20kernel%20debugger%20disables%20PatchGuard).%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3CSPAN%3E%3CEM%3E%3A%20Because%20we%20made%20the%20change%20to%20rely%20on%20VBS%20for%20DTrace%20on%20Windows%2C%20the%20installer%20from%2019H1%20will%20only%20work%20on%2019H1.%20For%20Windows%2010%20Insider%20Preview%20(post%2019H1)%20builds%2C%20please%20use%20the%20updated%20installer%20linked%20in%20this%20post.%20This%20installer%20will%20NOT%20install%20on%20previous%20Windows%2010%20releases.%20%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELets%20get%20into%20how%20to%20setup%20and%20use%20DTrace%20on%20Windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPrerequisites%20for%20using%20the%20feature%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWindows%2010%20insider%26nbsp%3B%3CSTRONG%3Ebuild%2019041.21%20%3C%2FSTRONG%3Eor%20higher%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EDetailed%20instructions%20to%20install%20DTrace%20is%20available%20in%20our%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fwindows-hardware%252Fdrivers%252Fdevtest%252Fdtrace%2523installing-dtrace-under-windows%26amp%3Bdata%3D04%257C01%257Charipul%2540microsoft.com%257Cdf7e032605d74f653a4b08d764a1367d%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637088515996762981%257CUnknown%257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%253D%257C-1%26amp%3Bsdata%3DqbcyQkz7njbzVXOjUvq0YrBQwprq9gOXyWxfVajQ5Yg%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Edocumentation%3C%2FA%3E.%20At%20a%20high-level%2C%20these%20are%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EEnable%20boot%20option%20to%20turn%20on%20DTrace%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EDownload%26nbsp%3B%3C%2FSTRONG%3Eand%20install%20the%20DTrace%20MSI.%3C%2FLI%3E%0A%3CLI%3EEnsure%20VBS%20is%20turned%20on%20%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EOptional%3A%20Update%20the%26nbsp%3B%3CSTRONG%3EPATH%20environment%20variable%3C%2FSTRONG%3Eto%20include%26nbsp%3B%3CSTRONG%3EC%3A%5CProgram%20Files%5CDTrace%3C%2FSTRONG%3E%3CUL%3E%0A%3CLI%3Eset%20PATH%3D%25PATH%25%3B%22C%3A%5CProgram%20Files%5CDTrace%22%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ESetup%26nbsp%3B%3CSTRONG%3Esymbol%20path%3C%2FSTRONG%3E%3CUL%3E%0A%3CLI%3ECreate%20a%20new%20directory%20for%20caching%20symbols%20locally.%20Example%3A%20mkdir%20c%3A%5Csymbols%3C%2FLI%3E%0A%3CLI%3ESet%26nbsp%3B%3CSTRONG%3E_NT_SYMBOL_PATH%3C%2FSTRONG%3E%3Dsrv*C%3A%5Csymbols*%3CA%20href%3D%22http%3A%2F%2Fmsdl.microsoft.com%2Fdownload%2Fsymbols%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdl.microsoft.com%2Fdownload%2Fsymbols%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EDTrace%20automatically%20downloads%20the%20symbols%20necessary%20from%20the%20symbol%20server%20and%20caches%20to%20the%20local%20path.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EReboot%26nbsp%3B%3C%2FSTRONG%3Emachine%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ETo%20check%20if%20VBS%20is%20enabled%20or%20not%2C%20look%20at%20system%20summary%20tab%20on%20the%20Microsoft%20System%20Information%20tool%20(%3CSTRONG%3E%3CEM%3Emsinfo32.exe%3C%2FEM%3E%3C%2FSTRONG%3E).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167093i441BCCEE84B8FFB2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22VBS.png%22%20title%3D%22VBS.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EMsinfo32%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1073853625%22%20id%3D%22toc-hId-1073853625%22%20id%3D%22toc-hId-1073853625%22%20id%3D%22toc-hId-1073853625%22%20id%3D%22toc-hId-1073853625%22%20id%3D%22toc-hId-1073853625%22%20id%3D%22toc-hId-1073853625%22%3EARM64%20preview%3C%2FH2%3E%0A%3CP%3EYes%2C%20that%E2%80%99s%20right!%20DTrace%20now%20supports%20ARM64%20in%20preview%20mode.%20The%20ARM64%20MSI%20is%20available%20in%20the%20download%20link%20listed%20above.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20use%20it%20on%20your%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fp%2Fsurface-pro-x%2F8vdnrp2m6hhc%3Factivetab%3Doverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESurface%20Pro%20X%3C%2FA%3E%20running%20%3CSPAN%3Ethe%20latest%20Windows%2010%20Insider%20Preview%20(20H1)%20build%2C%20starting%20with%20%3CA%20href%3D%22https%3A%2F%2Fblogs.windows.com%2Fwindowsexperience%2F2020%2F01%2F14%2Freleasing-windows-10-insider-preview-build-19041-21-to-the-slow-ring%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E19041.21%3C%2FA%3E.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167108iB0404D9465502E57%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22dtraceonarm.png%22%20title%3D%22dtraceonarm.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EDTrace%20on%20Surface%20Pro%20X%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--733600838%22%20id%3D%22toc-hId--733600838%22%20id%3D%22toc-hId--733600838%22%20id%3D%22toc-hId--733600838%22%20id%3D%22toc-hId--733600838%22%20id%3D%22toc-hId--733600838%22%20id%3D%22toc-hId--733600838%22%3EUser%20mode%20Stackwalk%3C%2FH2%3E%0A%3CP%3EIn%20the%20preview%2C%20the%20stackwalk%20facility%20in%20DTrace%20was%20limited%20to%20Kernel%20mode%20(stack).%20This%20update%20adds%20support%20for%20usermode%20stackwalk%20facility%20(%3CSTRONG%3E%3CEM%3Eustack).%3C%2FEM%3E%3C%2FSTRONG%3E%20Like%20stack%2C%20ustack%20facility%20is%20fully%20compatible%20with%20open%20source%20DTrace%20specification.%20It%20can%20be%20invoked%20in%20three%20ways%20by%20specifying%20frames%20(depth)%20%26amp%3B%20size%20(ignored%20for%20now)%20or%20void.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUstack(nframes%2C%20size)%3C%2FLI%3E%0A%3CLI%3EUstack(nframes)%3C%2FLI%3E%0A%3CLI%3EUstack()%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWhile%20ustack%20()%20can%20determine%20the%20address%20of%20the%20calling%20frame%20when%20probe%20fires%2C%20the%20stack%20frames%20will%20not%20be%20translated%20into%20symbols%20until%20the%20ustack%20()%20action%20is%20processed%20at%20user-mode%20by%20DTrace%20consumer.%20Symbol%20download%20can%20slow%20down%20the%20output.%20Hence%2C%20it%E2%80%99s%20better%20to%20use%20this%20facility%20with%20locally%20cached%20symbols%20like%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Edtrace%20-n%20%22profile-1ms%20%2Farg1%2F%20%7Bustack(50%2C%200)%3B%20exit(0)%3B%7D%20%22%20-y%20C%3A%5Csymbols%0Adtrace%3A%20description%20'profile-1ms%20'%20matched%201%20probe%0ACPU%20%20%20%20%20ID%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20FUNCTION%3ANAME%0A%20%200%20%20%203802%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Aprofile-1ms%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ntdll%60ZwAllocateVirtualMemory%2B0x14%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ntdll%60RtlAllocateHeap%2B0x3ded%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ntdll%60RtlAllocateHeap%2B0x763%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ucrtbase%60malloc_base%2B0x44%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1753911995%22%20id%3D%22toc-hId-1753911995%22%20id%3D%22toc-hId-1753911995%22%20id%3D%22toc-hId-1753911995%22%20id%3D%22toc-hId-1753911995%22%20id%3D%22toc-hId-1753911995%22%20id%3D%22toc-hId-1753911995%22%3ELive%20dump%20support%3C%2FH2%3E%0A%3CP%3EWindows%20commonly%20uses%20something%20called%20%3CSTRONG%3E%3CEM%3ELive%20dump%3C%2FEM%3E%3C%2FSTRONG%3E%20to%20help%20quickly%20diagnose%20issues.%20Live%20dumps%20help%20with%20troubleshooting%20issues%20involving%20multiple%20processes%20or%20system%20wide%20issues%20without%20downtime.%20In%2020H1%2C%20DTrace%20on%20Windows%20can%20be%20used%20to%20capture%20a%20live%20dump%20from%20inside%20a%20D-script%20using%20the%20%3CSTRONG%3E%3CEM%3Elkd()%3C%2FEM%3E%3C%2FSTRONG%3E%20DTrace%20facility.%20A%20common%20use%20case%20of%20this%20facility%20is%20to%20instrument%20error%20path%20(like%20return%20code%20indicates%20a%20failure)%20and%20capture%20a%20live%20dump%20right%20at%20the%20failure%20point%20for%20advanced%20diagnostics.%20%3CSPAN%3EFor%20more%20information%20on%20live%20dump%20support%2C%20see%20%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fwindows-hardware%252Fdrivers%252Fdevtest%252Fdtrace-live-dump%26amp%3Bdata%3D04%257C01%257Cgopikann%2540microsoft.com%257C268e4e37fe0a4e194e0b08d763049918%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637086744045379392%257CUnknown%257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%253D%257C-1%26amp%3Bsdata%3Dpg0S0ahNJ4%252BHU9GDNLuOhf4Jobhic0Sh15aPZC%252FRoi4%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%3CSPAN%3EDTrace%20Live%20Dump%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%3E.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Edtrace%20-wn%20%22syscall%3A%3A%3Areturn%20%7B%20if%20(arg0%20!%3D%200xc0000001UL)%20%7B%20lkd(0)%3B%20printf(%5C%22%20Triggering%20Live%20dump%20%5Cn%20%5C%22)%3Bexit(0)%3B%20%7D%7D%22%0Adtrace%3A%20description%20'syscall%3A%3A%3Areturn%20'%20matched%201411%20probes%0Adtrace%3A%20allowing%20destructive%20actions%0ACPU%20%20%20%20%20ID%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20FUNCTION%3ANAME%0A%20%200%20%20%20%20181%20%20%20%20%20NtDeviceIoControlFile%3Areturn%20%20Triggering%20Live%20dump%0A%0A%0Adir%20c%3A%5CWindows%5CLiveKernelReports%0A%20Volume%20in%20drive%20C%20has%20no%20label.%0A%20Volume%20Serial%20Number%20is%2070F4-B9F6%0A%0A%20Directory%20of%20c%3A%5CWindows%5CLiveKernelReports%0A%0A11%2F05%2F2019%20%2005%3A20%20PM%20%20%20%20%3C%2FCODE%3E%3CDIR%3E%3CCODE%3E%20%20%20%20%20%20%20%20%20%20.%0A11%2F05%2F2019%20%2005%3A20%20PM%20%20%20%20%3C%2FCODE%3E%3CDIR%3E%3CCODE%3E%20%20%20%20%20%20%20%20%20%20..%0A11%2F05%2F2019%20%2005%3A19%20PM%20%20%20%20%3C%2FCODE%3E%3CDIR%3E%3CCODE%3E%20%20%20%20%20%20%20%20%20%20DTRACE%0A11%2F05%2F2019%20%2005%3A20%20PM%20%20%20%20%20%20%20%2053%2C395%2C456%20DTRACE-20191105-1720.dmp%0A%3C%2FCODE%3E%3C%2FDIR%3E%3C%2FDIR%3E%3C%2FDIR%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--53542468%22%20id%3D%22toc-hId--53542468%22%20id%3D%22toc-hId--53542468%22%20id%3D%22toc-hId--53542468%22%20id%3D%22toc-hId--53542468%22%20id%3D%22toc-hId--53542468%22%20id%3D%22toc-hId--53542468%22%3EETW%20Tracing%3C%2FH2%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EETW%20tracing%3C%2FEM%3E%3C%2FSTRONG%3E%20is%20the%20most%20frequently%20used%20tool%20for%20debugging%20on%20Windows.%20In%20DTrace%20on%20Windows%2019H1%20preview%2C%20we%20added%20support%20for%20instrumenting%20tracelogged%20and%20manifested%20events%20using%20the%3CSTRONG%3E%3CEM%3E%20ETW%20provider%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%2020H1%2C%20we%20further%20enhanced%20this%20facility%20to%20create%20new%20ETW%20events%20on%20the%20fly%20from%20inside%20a%20D-script%20using%20the%20%3CSTRONG%3E%3CEM%3EETW_Trace()%3C%2FEM%3E%3C%2FSTRONG%3E%20facility.%20This%20helps%20in%20situations%20where%20existing%20ETW%20events%20are%20insufficient%20and%20you%20would%20like%20to%20add%20additional%20ETW%20trace%20points%20without%20modifying%20production%20code.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20about%20%3CSTRONG%3E%3CEM%3EETW_Trace%3C%2FEM%3E%3C%2FSTRONG%3E%20facility%20and%20%3CSTRONG%3E%3CEM%3EETW%20provider%2C%20%3C%2FEM%3E%3C%2FSTRONG%3E%3CSPAN%3Esee%20%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-hardware%2Fdrivers%2Fdevtest%2Fdtrace-etw%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDTrace%20ETW%3C%2FA%3E%3CSPAN%3E.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%2F*%20%0ARunning%20the%20GitHub%20ETW%20provider%20sample%20(link%20below)%20to%20print%20node%20memory%20info%20event.%20%0A%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FDTrace-on-Windows%2Fblob%2Fmaster%2Fsamples%2Fwindows%2Fetw%2Fnumamemstats.d%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoft%2FDTrace-on-Windows%2Fblob%2Fmaster%2Fsamples%2Fwindows%2Fetw%2Fnumamemstats.d%3C%2FA%3E%0A*%2F%20%0A%0Adtrace%20-qs%20numamemstats.d%0A%0APartition%20ID%3A%200%0ACount%3A%201%0ANode%20number%3A%201%0Am_nodeinfo%20%7B%0A%20%20%20%20uint64_t%20TotalPageCount%20%3D%200x1fb558%0A%20%20%20%20uint64_t%20SmallFreePageCount%20%3D%200x41%0A%20%20%20%20uint64_t%20SmallZeroPageCount%20%3D%200%0A%20%20%20%20uint64_t%20MediumFreePageCount%20%3D%200%0A%20%20%20%20uint64_t%20MediumZeroPageCount%20%3D%200%0A%20%20%20%20uint64_t%20LargeFreePageCount%20%3D%200%0A%20%20%20%20uint64_t%20LargeZeroPageCount%20%3D%200%0A%20%20%20%20uint64_t%20HugeFreePageCount%20%3D%200%0A%20%20%20%20uint64_t%20HugeZeroPageCount%20%3D%200%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20concludes%20a%20tour%20of%20some%20of%20our%20key%20updates%20to%20DTrace%20on%20Windows%20for%2020H1.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20get%20started%20by%20downloading%20%26amp%3B%20installing%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fdownload%2Fdetails.aspx%3Fid%3D100441%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDTrace%20MSI%20package%3C%2FA%3E%20on%20the%20latest%2020H1%20client%2Fserver%20insider%20build%20-%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fblogs.windows.com%2Fwindowsexperience%2F2020%2F01%2F14%2Freleasing-windows-10-insider-preview-build-19041-21-to-the-slow-ring%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E19041.21%3C%2FA%3E%3C%2FSPAN%3E%2B.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20visit%20our%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FDTrace-on-Windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3EGitHub%20page%3C%2FSTRONG%3E%3C%2FA%3E%20for%20contributing%20code%20and%20samples.%20We%20have%20several%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FDTrace-on-Windows%2Ftree%2Fmaster%2Fsamples%2Fwindows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eadvanced%20scripts%3C%2FA%3E%20in%20GitHub%20to%20help%20users%20learn%20and%20use%20DTrace%20on%20Windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1860996931%22%20id%3D%22toc-hId--1860996931%22%20id%3D%22toc-hId--1860996931%22%20id%3D%22toc-hId--1860996931%22%20id%3D%22toc-hId--1860996931%22%20id%3D%22toc-hId--1860996931%22%20id%3D%22toc-hId--1860996931%22%3EHow%20to%20file%20feedback%3F%3C%2FH2%3E%0A%3CP%3EAs%20always%2C%20we%20rely%20on%20feedback%20from%20our%20users%20to%20help%20improve%20the%20product.%20If%20you%20hit%20any%20problems%20or%20bugs%2C%20please%20use%20Feedback%20hub%20to%20let%20us%20know%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ELaunch%20feedback%20hub%20by%20clicking%20this%20%3CA%20href%3D%22windows-feedback%3A%3Fcontextid%3D1053%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Elink%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3ESelect%20Add%20new%20feedback.%3C%2FLI%3E%0A%3CLI%3EPlease%20provide%20a%20detailed%20description%20of%20the%20issue.%3C%2FLI%3E%0A%3CLI%3ECurrently%2C%20we%20do%20not%20automatically%20collect%20any%20debug%20traces%2C%20so%20your%20verbatim%20feedback%20is%20crucial%20for%20understanding%20and%20reproducing%20the%20issue.%20Pass%20on%20any%20verbose%20logs.%3C%2FLI%3E%0A%3CLI%3EYou%20can%20also%20set%20DTRACE_DEBUG%20environment%20variable%20to%201%20to%20collect%20verbose%20DTrace%20logs.%3C%2FLI%3E%0A%3CLI%3ESubmit%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20are%20excited%20to%20rollout%20these%20changes%20and%20look%20forward%20to%20working%20with%20the%20community%20to%20continue%20improving%20DTrace%20experience.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDTrace%20team%3C%2FSTRONG%3E%20(Andrey%20Shedel%2C%20Gopikrishna%20Kannan%2C%20Max%20Renke%2C%20Hari%20Pulapaka)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1127929%22%20slang%3D%22en-US%22%3E%3CP%3EDTrace%20on%20Windows%20updates%20for%2020H1%20-%20now%20without%20local%20KD%20attach%20requirement.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1163989%22%20slang%3D%22en-US%22%3ERe%3A%20DTrace%20on%20Windows%20%E2%80%93%2020H1%20updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1163989%22%20slang%3D%22en-US%22%3E%3CP%3EThese%20are%20awesome%2C%20thanks%20for%20sharing.%3C%2FP%3E%3CP%3EI've%20been%20using%20Windows%20insider%20fast%20ring%20for%20more%20than%201%20year%20now%2C%20non-stop.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Efrom%20my%20experience%2C%20there%20are%20sometimes%20issues%20that%20can't%20be%20recorded%20using%20Feedback%20hub%20app's%20problem%20recording%20feature%2C%20so%20I%20expect%20Windows%20to%20automatically%20capture%20and%20report%20back%20any%20problems%20to%20Microsoft.%3C%2FP%3E%3CP%3EI%20hope%20problem%20reporting%20and%20telemetry%20in%20Windows%20insider%20editions%20will%20be%20able%20to%20send%20more%20data%20to%20Microsoft%20about%20my%20usage%20and%20issues%20I%20encounter%2C%20automatically.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1298351%22%20slang%3D%22en-US%22%3ERe%3A%20DTrace%20on%20Windows%20%E2%80%93%2020H1%20updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1298351%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%20I've%20encountered%20some%20problem%2C%20DTrace%20doesn't%20see%20any%20probes.%20VBS%20is%20enabled%2C%20bcdedit%20dtrace%20set%2C%20KD%20disabled%2C%20runned%20as%20admin%2C%20OS%20Build%2019603.1000%2C%20DTrace%20version%20Sun%20D%201.13.1.%20What%20can%20be%20wrong%3F%20That's%20output%3A%20%3CA%20href%3D%22https%3A%2F%2Fgist.githubusercontent.com%2Fnawrot2137%2F19b638a83f8fee4974babc57b6a103b4%2Fraw%2Ffd3e1718991389f37032102e6d117874a4740d45%2Fgistfile1.txt%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ELINK%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1655179%22%20slang%3D%22en-US%22%3ERe%3A%20DTrace%20on%20Windows%20%E2%80%93%2020H1%20updates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1655179%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20seems%20that%20the%20built%20in%20variable%20%22cwd%22%20(documented%20here%3A%26nbsp%3B%3CA%20href%3D%22http%3A%2F%2Fdtrace.org%2Fguide%2Fchp-variables.html%23chp-variables%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttp%3A%2F%2Fdtrace.org%2Fguide%2Fchp-variables.html%23chp-variables%3C%2FA%3E)%20isn't%20available.%20Is%20that%20intentional%20or%20an%20oversight%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CTABLE%20border%3D%221%22%20cellspacing%3D%222%22%20cellpadding%3D%228%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CP%3Estring%20cwd%3C%2FP%3E%3C%2FTD%3E%3CTD%3E%3CP%3EThe%20name%20of%20the%20current%20working%20directory%20of%20the%20process%20associated%20with%20the%20current%20thread.%3C%2FP%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%3CBR%20%2F%3EThat%20is%20a%20pretty%20minor%20nit.%26nbsp%3B%20Other%20than%20that%2C%20it%20seems%20great.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Version history
Last update:
‎Jan 27 2020 11:56 AM
Updated by: