Skip to content

Commit

Permalink
Record VirtualFree stacks when VirtualAlloc stacks are requested
Browse files Browse the repository at this point in the history
VirtualFree stacks can be used to track down memory leaks if the memory
is freed during shutdown (not true leaks, but you know what I mean).
This change adds VirtualFree to the stack walk flags when VirtualAlloc
is requested. This change also fixes the capitalization of the other
stack walk flags, to match that used by xperf -help stackwalk
  • Loading branch information
randomascii committed Feb 28, 2017
1 parent c042f43 commit 500fa43
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions UIforETW/UIforETWDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,15 +913,16 @@ void CUIforETWDlg::OnBnClickedStarttracing()
std::wstring kernelStackWalk;
// Record CPU sampling call stacks, from the PROFILE provider
if (bSampledStacks_)
kernelStackWalk += L"+PROFILE";
kernelStackWalk += L"+Profile";
// Record context-switch (switch in) and readying-thread (SetEvent, etc.)
// call stacks from DISPATCHER provider.
if (bCswitchStacks_)
kernelStackWalk += L"+CSWITCH+READYTHREAD";
// Record VirtualAlloc call stacks from the VIRT_ALLOC provider. Could
// also record VirtualFree.
kernelStackWalk += L"+CSwitch+ReadyThread";
// Record VirtualAlloc call stacks from the VIRT_ALLOC provider. Also
// record VirtualFree to allow investigation of memory leaks, even though
// WPA fails to display these stacks.
if (bVirtualAllocStacks_ || tracingMode_ == kHeapTracingToFile)
kernelStackWalk += L"+VirtualAlloc";
kernelStackWalk += L"+VirtualAlloc+VirtualFree";
// Add in any manually requested call stack flags.
if (!extraKernelStacks_.empty())
kernelStackWalk += L"+" + extraKernelStacks_;
Expand Down

0 comments on commit 500fa43

Please sign in to comment.