Skip to content

Commit

Permalink
Updates for Windows 10 Creators Update
Browse files Browse the repository at this point in the history
- Install the latest (10.0.15063.137) version of xperf/WPA
- Retire the automatic symbol stripping/downloading script
- Support the new thread naming API
- Update the version number
- Updating the packaging script so signing happens before copying

The symbol stripping/downloading API can be retired because the latest
WPA seems to properly download Chrome's symbols, and can convert them
in a timely manner.
  • Loading branch information
randomascii committed Apr 13, 2017
1 parent 9bfe0ce commit 8b3f9bd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
12 changes: 8 additions & 4 deletions UIforETW/UIforETWDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ BOOL CUIforETWDlg::OnInitDialog()

auto xperfVersion = GetFileVersion(GetXperfPath());
const int64_t requiredXperfVersion = (10llu << 48) + 0 + (10586llu << 16) + (15llu << 0);
// Windows 10 Anniversary Edition version (August 2016) - requires Windows 8 or higher.
const int64_t preferredXperfVersion = (10llu << 48) + 0 + (14393llu << 16) + (33llu << 0);
// Windows 10 Creators Update version (April 2017) - requires Windows 8 or higher?
const int64_t preferredXperfVersion = (10llu << 48) + 0 + (15063llu << 16) + (137llu << 0);

wchar_t systemDir[MAX_PATH];
systemDir[0] = 0;
Expand Down Expand Up @@ -462,7 +462,7 @@ BOOL CUIforETWDlg::OnInitDialog()
DWORD installResult10 = child.GetExitCode();
if (!installResult10)
{
outputPrintf(L"WPT version 10.0.14393 was installed.\n");
outputPrintf(L"WPT version 10.0.15063 was installed.\n");
}
else
{
Expand Down Expand Up @@ -1310,7 +1310,11 @@ void CUIforETWDlg::StopTracingAndMaybeRecord(bool bSaveTrace)

if (bSaveTrace)
{
if (bChromeDeveloper_)
// It looks like all of the Chrome symbol processing bugs (slow symbol
// processing for various reasons and an inability to download symbols from
// Chrome's symbol server) are fixed in Creators Edition, so disable this
// hack, except for those on Windows 7 who can't use the latest version.
if (IsWindowsSevenOrLesser() && bChromeDeveloper_)
StripChromeSymbols(traceFilename);
PreprocessTrace(traceFilename);

Expand Down
17 changes: 17 additions & 0 deletions UIforETW/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ typedef struct tagTHREADNAME_INFO
// warning C6320 : Exception - filter expression is the constant EXCEPTION_EXECUTE_HANDLER.This might mask exceptions that were not intended to be handled.
// warning C6322 : Empty _except block.

typedef HRESULT(WINAPI* SetThreadDescription_t)(HANDLE hThread,
PCWSTR lpThreadDescription);

void SetCurrentThreadName(PCSTR const threadName)
{
const DWORD dwThreadID = ::GetCurrentThreadId();
Expand All @@ -874,6 +877,20 @@ void SetCurrentThreadName(PCSTR const threadName)
__except (EXCEPTION_EXECUTE_HANDLER)
{
}

// SetThreadDescription shows up in Windows 10 Creators Edition (April 2017),
// probably in response to this blog post:
// https://randomascii.wordpress.com/2015/10/26/thread-naming-in-windows-time-for-something-better/
auto SetThreadDescription_p =
reinterpret_cast<SetThreadDescription_t>(::GetProcAddress(
::GetModuleHandle(L"Kernel32.dll"), "SetThreadDescription"));
if (SetThreadDescription_p)
{
wchar_t wThreadName[200];
size_t numConverted = 0;
mbstowcs_s(&numConverted, wThreadName, threadName, _TRUNCATE);
SetThreadDescription_p(GetCurrentThread(), wThreadName);
}
}
#pragma warning(pop)

Expand Down
2 changes: 1 addition & 1 deletion UIforETW/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.46f;
const float kCurrentVersion = 1.47f;

// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
Expand Down
11 changes: 6 additions & 5 deletions package_etw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ xcopy %UIforETW%bin\UIforETWStatic_devrel32.exe %destdir%\bin\UIforETW32.exe /y
xcopy %UIforETW%bin\UIforETWStatic_devrel.exe %destdir%\bin\UIforETW.exe /y
xcopy %UIforETW%bin\EventEmitter.exe %destdir%\bin /y
xcopy %UIforETW%bin\EventEmitter64.exe %destdir%\bin /y

@rem Sign the important (requiring elevation) binaries
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\x64
signtool sign /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 %~dp0etwpackage\bin\UIforETW.exe %~dp0etwpackage\bin\UIforETW32.exe
@if not %errorlevel% equ 0 goto signing_failure

@rem Copy the official binaries back to the local copy, for development purposes.
xcopy /exclude:%UIforETW%excludecopy.txt %destdir%\bin\UIforETW*.exe %UIforETW%bin /y
@if ERRORLEVEL 1 goto BuildFailure
Expand Down Expand Up @@ -143,11 +149,6 @@ powershell ..\GitHub-Source-Indexer\github-sourceindexer.ps1 -symbolsFolder etws
@echo %temp%\srcsrv\pdbstr -r -p:etwsymbols\UIforETWStatic_devrel32.pdb -s:srcsrv
:NoSourceIndexing

@rem Sign the important (requiring elevation) binaries
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\x64
signtool sign /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 %~dp0etwpackage\bin\UIforETW.exe %~dp0etwpackage\bin\UIforETW32.exe
@if not %errorlevel% equ 0 goto signing_failure

del *.zip 2>nul
del *.cab 2>nul
call python make_zip_file.py etwpackage.zip etwpackage
Expand Down

0 comments on commit 8b3f9bd

Please sign in to comment.