Is DisablePagingExecutive required to allow xPerf to stackwalk for a 32-bit application running on 64-bit Windows

StackOverflow https://stackoverflow.com/questions/17349882

  •  01-06-2022
  •  | 
  •  

Question

I have two questions:

  1. I found a blog entry saying that DisablePagingExecutive should be set when using xperf:

    http://blogs.msdn.com/b/pigscanfly/archive/2009/08/06/stack-walking-in-xperf.aspx

    Disable Paging Executive
    In order for tracing to work on 64-bit Windows you need to set the DisablePagingExecutive registry key. This tells the operating system not to page kernel mode drivers and system code to disk, which is a prerequisite for getting 64-bit call stacks using xperf, because 64-bit stack walking depends on metadata in the executable images, and in some situations the xperf stack walk code is not allowed to touch paged out pages.

    Is this required to collect xperf data for a 32-bit application running on 64-bit Windows?

  2. When collecting data with xperf for a 32-bit process on a 64-bit OS, should I be using the x86 or x64 version?

Was it helpful?

Solution

You should set DisablePagingExecutive to 1 and use the 64-bit version of WPT if you are using 64-bit Windows.

The 64-bit version of WPT is needed because the 32-bit version won't even install on 64-bit Windows.

Setting DisablePagingExecutive to 1 is needed because even a 32-bit program can make calls into the 64-bit kernel. In order to get full call stacks that include the kernel code you need to lock the metadata into non-pageable memory, which is what setting DisablePagingExecutive does.

Just set it. It doesn't cost much (it uses a bit more memory) and if you set it you don't need to worry about it.

And the simplest way to set it is to use a trace recording UI. wprui is one choice (it ships with the Windows Performance Toolkit) but I prefer UIforETW. Details at https://randomascii.wordpress.com/2015/09/24/etw-central/

OTHER TIPS

According to a Microsoft blog article, it seems disabling paging executive is no longer required as of Windows 8 / 2012 to obtain complete stacks in a WPT trace.

When explaining the process for disabling paging executive, it specifically states:

Does [disabling paging executive] need to be done in Windows Server 2012 or 32-bit/64-bit Windows 8? No.

I found this after reading another (several years old) article which stated that on starting WPR for the first time, it should prompt you to disable paging executive if it isn't already. I wasn't getting this prompt, despite the DisablePagingExecutive registry key being set to zero, so I did some digging and found the above info.

The articled is dated 2012, so those were the latest Windows releases at the time. Presumably this has carried forward in later releases (I was running WPR on Server 2016 and was not prompted).

You must use the 64Bit Version of WPT and you must set the DisablePagingExecute to 1.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top