New issue
Advanced search Search tips

Issue 684203 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Use Windows 10 thread naming API, SetThreadDescription

Project Member Reported by brucedaw...@chromium.org, Jan 24 2017

Issue description

As of Windows 10, version 1607, there is a SetThreadDescription function for setting thread names:

https://msdn.microsoft.com/en-us/library/windows/desktop/mt774976(v=vs.85).aspx

This presumably addresses the issues discussed in this blog post:

https://randomascii.wordpress.com/2015/10/26/thread-naming-in-windows-time-for-something-better/

and, once tool support catches up, should give a better thread naming experience. SetNameInternal in platform_thread_win.cc should be updated to use this function when it is found to be available.

 

Comment 1 by chengx@chromium.org, Jan 27 2017

Labels: OS-Windows
Owner: chengx@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b97c0922116dbeb62d81790daf475495a399d264

commit b97c0922116dbeb62d81790daf475495a399d264
Author: chengx <chengx@chromium.org>
Date: Thu Feb 23 20:48:46 2017

ShowThreadNames tool to get thread ID/name pairs in a Chrome process

This tool is designed to test the usage of the SetThreadDescription
WinAPI in Chrome. In Chrome, the SetThreadDescription API has been
enabled to set thread names. However, since there is no tool support to
retrieve thread names set by GetThreadDescription, we will still rely on
SetNameInternal function in platform_thread_win.cc to set thread names.
Despite this, we need a tool to demo the SetThreadDescription API works,
even without the debugger to be present.

This tool incorporates the GetThreadDescription API trying to get names
of all threads in a process specified by its ID. If the thread names
have been set by SetThreadDescription API call like in Chrome, all
thread ID/name pairs are returned.

BUG= 684203 

Review-Url: https://codereview.chromium.org/2713773002
Cr-Commit-Position: refs/heads/master@{#452617}

[add] https://crrev.com/b97c0922116dbeb62d81790daf475495a399d264/tools/win/ShowThreadNames/.gitignore
[add] https://crrev.com/b97c0922116dbeb62d81790daf475495a399d264/tools/win/ShowThreadNames/ReadMe.txt
[add] https://crrev.com/b97c0922116dbeb62d81790daf475495a399d264/tools/win/ShowThreadNames/ShowThreadNames.cc
[add] https://crrev.com/b97c0922116dbeb62d81790daf475495a399d264/tools/win/ShowThreadNames/ShowThreadNames.sln
[add] https://crrev.com/b97c0922116dbeb62d81790daf475495a399d264/tools/win/ShowThreadNames/ShowThreadNames.vcxproj

Comment 3 by chengx@chromium.org, Feb 23 2017

Components: Internals>PlatformIntegration
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6988f8ff1fb0a3d8e5f0f9cc798f7f971a1baaa

commit f6988f8ff1fb0a3d8e5f0f9cc798f7f971a1baaa
Author: chengx <chengx@chromium.org>
Date: Thu Feb 23 22:14:10 2017

Use Windows 10 thread naming API, SetThreadDescription

Starting from version 1607 of Windows 10, there is a SetThreadDescription
API for setting thread names. This API has several advantages over
the SetNameInternal function which is currently used to set thread
names in Chrome.

The only issue with this new API is that there is no tool support
for it yet. However, once tool support catches up, it should give
a better thread naming experience.

A command-line tool "ShowThreadNames" for testing this
SetThreadDescription API has been developed and checked in using
another CL. It can be found via
https://codereview.chromium.org/2713773002

BUG= 684203 

Review-Url: https://codereview.chromium.org/2692213003
Cr-Commit-Position: refs/heads/master@{#452653}

[modify] https://crrev.com/f6988f8ff1fb0a3d8e5f0f9cc798f7f971a1baaa/base/threading/platform_thread_win.cc

Comment 5 by chengx@chromium.org, Feb 23 2017

Status: Fixed (was: Assigned)
Now we only need to wait for debug tool support catching up.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/10df6d1026423b24dab397ff68a80e0ea97f6cfe

commit 10df6d1026423b24dab397ff68a80e0ea97f6cfe
Author: chengx <chengx@chromium.org>
Date: Fri Apr 14 19:55:22 2017

Format ReadMe.txt for ShowThreadNames tool

BUG= 684203 

Review-Url: https://codereview.chromium.org/2814383003
Cr-Commit-Position: refs/heads/master@{#464781}

[modify] https://crrev.com/10df6d1026423b24dab397ff68a80e0ea97f6cfe/tools/win/ShowThreadNames/ReadMe.txt

Sign in to add a comment