Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove conhost telemetry #16253

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,6 @@ RIGHTALIGN
RIGHTBUTTON
riid
Rike
RIPMSG
RIS
roadmap
robomac
Expand Down
2 changes: 1 addition & 1 deletion src/host/consoleInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ULONG CONSOLE_INFORMATION::GetCSRecursionCount() const noexcept
return STATUS_SUCCESS;
}

RIPMSG1(RIP_WARNING, "Console init failed with status 0x%x", Status);
LOG_NTSTATUS_MSG(Status, "Console init failed");

delete gci.ScreenBuffers;
gci.ScreenBuffers = nullptr;
Expand Down
1 change: 0 additions & 1 deletion src/host/directio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,6 @@ CATCH_RETURN();
_In_ PCD_CREATE_OBJECT_INFORMATION Information,
_In_ PCONSOLE_CREATESCREENBUFFER_MSG a)
{
Telemetry::Instance().LogApiCall(Telemetry::ApiCall::CreateConsoleScreenBuffer);
const auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();

// If any buffer type except the one we support is set, it's invalid.
Expand Down
1 change: 1 addition & 0 deletions src/host/exe/exemain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ int CALLBACK wWinMain(
_In_ PWSTR /*pwszCmdLine*/,
_In_ int /*nCmdShow*/)
{
wil::SetResultLoggingCallback(&Tracing::TraceFailure);
Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().hInstance = hInstance;

ConsoleCheckDebug();
Expand Down
1 change: 0 additions & 1 deletion src/host/getset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ void ApiRoutines::GetConsoleInputModeImpl(InputBuffer& context, ULONG& mode) noe
{
try
{
Telemetry::Instance().LogApiCall(Telemetry::ApiCall::GetConsoleMode);
const auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
LockConsole();
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
Expand Down
2 changes: 1 addition & 1 deletion src/host/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void InitSideBySide()
// OpenConsole anyways, nothing happens and we get ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET.
if (ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET != error)
{
RIPMSG1(RIP_WARNING, "InitSideBySide failed create an activation context. Error: %d\r\n", error);
LOG_WIN32_MSG(error, "InitSideBySide failed create an activation context.");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/host/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void HandleMenuEvent(const DWORD wParam)
EventsWritten = gci.pInputBuffer->Write(SynthesizeMenuEvent(wParam));
if (EventsWritten != 1)
{
RIPMSG0(RIP_WARNING, "PutInputInBuffer: EventsWritten != 1, 1 expected");
LOG_HR_MSG(E_FAIL, "PutInputInBuffer: EventsWritten != 1, 1 expected");
}
}
catch (...)
Expand All @@ -230,7 +230,7 @@ void HandleCtrlEvent(const DWORD EventType)
gci.CtrlFlags |= CONSOLE_CTRL_CLOSE_FLAG;
break;
default:
RIPMSG1(RIP_ERROR, "Invalid EventType: 0x%x", EventType);
LOG_HR_MSG(E_INVALIDARG, "Invalid EventType: 0x%x", EventType);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/host/screenInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ try
{
if ((USHORT)coordNewScreenSize.width >= SHORT_MAX || (USHORT)coordNewScreenSize.height >= SHORT_MAX)
{
RIPMSG2(RIP_WARNING, "Invalid screen buffer size (0x%x, 0x%x)", coordNewScreenSize.width, coordNewScreenSize.height);
LOG_HR_MSG(E_INVALIDARG, "Invalid screen buffer size (0x%x, 0x%x)", coordNewScreenSize.width, coordNewScreenSize.height);
return STATUS_INVALID_PARAMETER;
}

Expand Down
6 changes: 0 additions & 6 deletions src/host/selectionInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Selection::KeySelectionEventResult Selection::HandleKeySelectionEvent(const INPU
// C-c, C-Ins. C-S-c Is also handled by this case.
((ctrlPressed) && (wVirtualKeyCode == 'C' || wVirtualKeyCode == VK_INSERT)))
{
Telemetry::Instance().SetKeyboardTextEditingUsed();

// copy selection
return Selection::KeySelectionEventResult::CopyToClipboard;
}
Expand Down Expand Up @@ -291,8 +289,6 @@ bool Selection::HandleKeyboardLineSelectionEvent(const INPUT_KEY_INFO* const pIn
return false;
}

Telemetry::Instance().SetKeyboardTextSelectionUsed();

// if we're not currently selecting anything, start a new mouse selection
if (!IsInSelectingState())
{
Expand Down Expand Up @@ -704,8 +700,6 @@ bool Selection::_HandleColorSelection(const INPUT_KEY_INFO* const pInputKeyInfo)
// Clear the selection and call the search / mark function.
ClearSelection();

Telemetry::Instance().LogColorSelectionUsed();

const auto& textBuffer = gci.renderData.GetTextBuffer();
const auto hits = textBuffer.SearchText(str, true);
for (const auto& s : hits)
Expand Down
9 changes: 1 addition & 8 deletions src/host/srvinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,6 @@ HRESULT ConsoleCreateIoThread(_In_ HANDLE Server,
[[maybe_unused]] PCONSOLE_API_MSG connectMessage)
try
{
// Create a telemetry instance here - this singleton is responsible for
// setting up the g_hConhostV2EventTraceProvider, which is otherwise not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who sets this up now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... about that TraceLoggingRegister call...
mhm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup!

How did you notice?

// initialized in the defterm handoff at this point.
(void)Telemetry::Instance();

#if !TIL_FEATURE_RECEIVEINCOMINGHANDOFF_ENABLED
TraceLoggingWrite(g_hConhostV2EventTraceProvider,
"SrvInit_ReceiveHandoff_Disabled",
Expand Down Expand Up @@ -865,8 +860,6 @@ PWSTR TranslateConsoleTitle(_In_ PCWSTR pwszConsoleTitle, const BOOL fUnexpand,
[[nodiscard]] NTSTATUS ConsoleAllocateConsole(PCONSOLE_API_CONNECTINFO p)
{
// AllocConsole is outside our codebase, but we should be able to mostly track the call here.
Telemetry::Instance().LogApiCall(Telemetry::ApiCall::AllocConsole);

auto& g = ServiceLocator::LocateGlobals();

auto& gci = g.getConsoleInformation();
Expand Down Expand Up @@ -1050,7 +1043,7 @@ DWORD WINAPI ConsoleIoThread(LPVOID lpParameter)
// This will not return. Terminate immediately when disconnected.
ServiceLocator::RundownAndExit(STATUS_SUCCESS);
}
RIPMSG1(RIP_WARNING, "DeviceIoControl failed with Result 0x%x", hr);
LOG_HR_MSG(hr, "DeviceIoControl failed");
ReplyMsg = nullptr;
continue;
}
Expand Down
Loading
Loading