Skip to content

Commit

Permalink
Update thread names
Browse files Browse the repository at this point in the history
Now that WPA can display thread names it is more obvious that the
ChildProcess::ListenerThread was never named. It is also suddenly
important to keep thread names short - having 'thread' at the name is a
bit silly so I'm removing that everywhere.
  • Loading branch information
randomascii committed Apr 12, 2017
1 parent 8900798 commit 9bfe0ce
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions UIforETW/CPUFrequency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void CCPUFrequencyMonitor::PerCPUSamplingThread(int cpuNumber)

DWORD __stdcall CCPUFrequencyMonitor::StaticPerCPUSamplingThread(LPVOID param)
{
SetCurrentThreadName("CPU frequency measuring thread");
SetCurrentThreadName("CPU frequency measurer");

auto* pState = reinterpret_cast<CPUSamplerState*>(param);
pState->pOwner->PerCPUSamplingThread(pState->cpuNumber);
Expand Down Expand Up @@ -192,7 +192,7 @@ void CCPUFrequencyMonitor::MonitorThread()

DWORD __stdcall CCPUFrequencyMonitor::StaticMonitorThread(LPVOID param)
{
SetCurrentThreadName("CPU frequency monitor thread");
SetCurrentThreadName("CPU frequency monitor");

auto* pThis = reinterpret_cast<CCPUFrequencyMonitor*>(param);
pThis->MonitorThread();
Expand Down
1 change: 1 addition & 0 deletions UIforETW/ChildProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ std::wstring ChildProcess::RemoveOutputText()

DWORD WINAPI ChildProcess::ListenerThreadStatic(LPVOID pVoidThis)
{
SetCurrentThreadName("Child-process listener");
ChildProcess* pThis = static_cast<ChildProcess*>(pVoidThis);
return pThis->ListenerThread();
}
Expand Down
2 changes: 1 addition & 1 deletion UIforETW/DirectoryMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DirectoryMonitor::DirectoryMonitor(CWnd* pMainWindow)
// whenever anything changes. That's it. All UI work is done in the main thread.
DWORD WINAPI DirectoryMonitor::DirectoryMonitorThreadStatic(LPVOID pVoidThis)
{
SetCurrentThreadName("Directory monitor thread");
SetCurrentThreadName("Directory monitor");
DirectoryMonitor* pThis = static_cast<DirectoryMonitor*>(pVoidThis);
return pThis->DirectoryMonitorThread();
}
Expand Down
2 changes: 1 addition & 1 deletion UIforETW/KeyLoggerThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ LRESULT CALLBACK LowLevelMouseHook(int nCode, WPARAM wParam, LPARAM lParam)

DWORD __stdcall InputThread(LPVOID)
{
SetCurrentThreadName("Input logging thread");
SetCurrentThreadName("Input logger");

// When UIforETW is halted in a debugger the keyboard and mouse hooks cannot respond
// in a timely manner. This means that each bit of user input has to timeout, which
Expand Down
2 changes: 1 addition & 1 deletion UIforETW/PowerStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void CPowerStatusMonitor::SampleTimerState()

DWORD __stdcall CPowerStatusMonitor::StaticPowerMonitorThread(LPVOID param)
{
SetCurrentThreadName("Power monitor thread");
SetCurrentThreadName("Power monitor");

CPowerStatusMonitor* pThis = reinterpret_cast<CPowerStatusMonitor*>(param);
pThis->PowerMonitorThread();
Expand Down
2 changes: 1 addition & 1 deletion UIforETW/UIforETW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ CUIforETWApp::CUIforETWApp()
// support Restart Manager
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;

SetCurrentThreadName("Main thread");
SetCurrentThreadName("Main");
}


Expand Down
2 changes: 1 addition & 1 deletion UIforETW/WorkingSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void CWorkingSetMonitor::SampleWorkingSets()

DWORD __stdcall CWorkingSetMonitor::StaticWSMonitorThread(LPVOID param)
{
SetCurrentThreadName("Working set monitor thread");
SetCurrentThreadName("Working set monitor");

CWorkingSetMonitor* pThis = reinterpret_cast<CWorkingSetMonitor*>(param);
pThis->WSMonitorThread();
Expand Down

0 comments on commit 9bfe0ce

Please sign in to comment.