This repository was archived by the owner on Jun 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Quiet mode: Added telemetry to elevated server #2814
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="$(SolutionDir)packages\microsoft.telemetry.inbox.native\10.0.18362.1-190318-1202.19h1-release.amd64fre\build\native\Microsoft.Telemetry.Inbox.Native.targets" Condition="!Exists('$(MSBuildThisFileDirectory)inc\MicrosoftTelemetry.h')" /> | ||
| </Project> |
143 changes: 143 additions & 0 deletions
143
telemetry/DevHome.Telemetry.Native/DevHome.Telemetry.Native.vcxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup Label="Globals"> | ||
| <Language>C++</Language> | ||
| </PropertyGroup> | ||
| <Import Project="$(SolutionDir)ToolingVersions.props" /> | ||
| <Import Project="$(SolutionDir)Directory.CppBuild.props" /> | ||
| <ItemGroup Label="ProjectConfigurations"> | ||
| <ProjectConfiguration Include="Debug|Win32"> | ||
| <Configuration>Debug</Configuration> | ||
| <Platform>Win32</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Release|Win32"> | ||
| <Configuration>Release</Configuration> | ||
| <Platform>Win32</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Debug|x64"> | ||
| <Configuration>Debug</Configuration> | ||
| <Platform>x64</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Release|x64"> | ||
| <Configuration>Release</Configuration> | ||
| <Platform>x64</Platform> | ||
| </ProjectConfiguration> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ClInclude Include="inc\DevHomeTelemetryProvider.h" /> | ||
| <ClInclude Include="inc\MicrosoftTelemetry.h" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="packages.config" /> | ||
| </ItemGroup> | ||
| <PropertyGroup Label="Globals"> | ||
| <VCProjectVersion>17.0</VCProjectVersion> | ||
| <Keyword>Win32Proj</Keyword> | ||
| <ProjectGuid>{8eb52f7d-d216-49ff-bf16-de06e4695950}</ProjectGuid> | ||
| <RootNamespace>DevHomeTelemetryNative</RootNamespace> | ||
| <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | ||
| <OutDir>$(CppOutDir)</OutDir> | ||
| </PropertyGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>true</UseDebugLibraries> | ||
| <PlatformToolset>v143</PlatformToolset> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>false</UseDebugLibraries> | ||
| <PlatformToolset>v143</PlatformToolset> | ||
| <WholeProgramOptimization>true</WholeProgramOptimization> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>true</UseDebugLibraries> | ||
| <PlatformToolset>v143</PlatformToolset> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>false</UseDebugLibraries> | ||
| <PlatformToolset>v143</PlatformToolset> | ||
| <WholeProgramOptimization>true</WholeProgramOptimization> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
| <ImportGroup Label="ExtensionSettings"> | ||
| </ImportGroup> | ||
| <ImportGroup Label="Shared"> | ||
| </ImportGroup> | ||
| <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| </ImportGroup> | ||
| <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
| <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| </ImportGroup> | ||
| <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
| <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| </ImportGroup> | ||
| <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| </ImportGroup> | ||
| <PropertyGroup Label="UserMacros" /> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| <ClCompile> | ||
| <WarningLevel>Level3</WarningLevel> | ||
| <SDLCheck>true</SDLCheck> | ||
| <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| <ConformanceMode>true</ConformanceMode> | ||
| </ClCompile> | ||
| <Link> | ||
| <SubSystem>Console</SubSystem> | ||
| <GenerateDebugInformation>true</GenerateDebugInformation> | ||
| </Link> | ||
| </ItemDefinitionGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
| <ClCompile> | ||
| <WarningLevel>Level3</WarningLevel> | ||
| <FunctionLevelLinking>true</FunctionLevelLinking> | ||
| <IntrinsicFunctions>true</IntrinsicFunctions> | ||
| <SDLCheck>true</SDLCheck> | ||
| <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| <ConformanceMode>true</ConformanceMode> | ||
| </ClCompile> | ||
| <Link> | ||
| <SubSystem>Console</SubSystem> | ||
| <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
| <OptimizeReferences>true</OptimizeReferences> | ||
| <GenerateDebugInformation>true</GenerateDebugInformation> | ||
| </Link> | ||
| </ItemDefinitionGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
| <ClCompile> | ||
| <WarningLevel>Level3</WarningLevel> | ||
| <SDLCheck>true</SDLCheck> | ||
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| <ConformanceMode>true</ConformanceMode> | ||
| </ClCompile> | ||
| <Link> | ||
| <SubSystem>Console</SubSystem> | ||
| <GenerateDebugInformation>true</GenerateDebugInformation> | ||
| </Link> | ||
| </ItemDefinitionGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| <ClCompile> | ||
| <WarningLevel>Level3</WarningLevel> | ||
| <FunctionLevelLinking>true</FunctionLevelLinking> | ||
| <IntrinsicFunctions>true</IntrinsicFunctions> | ||
| <SDLCheck>true</SDLCheck> | ||
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| <ConformanceMode>true</ConformanceMode> | ||
| </ClCompile> | ||
| <Link> | ||
| <SubSystem>Console</SubSystem> | ||
| <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
| <OptimizeReferences>true</OptimizeReferences> | ||
| <GenerateDebugInformation>true</GenerateDebugInformation> | ||
| </Link> | ||
| </ItemDefinitionGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| </Project> |
39 changes: 39 additions & 0 deletions
39
telemetry/DevHome.Telemetry.Native/inc/DevHomeTelemetryProvider.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #pragma once | ||
|
|
||
| //#include <TraceLogging.h> | ||
| #include <TraceLoggingProvider.h> | ||
| #include <MicrosoftTelemetry.h> | ||
|
|
||
| #define __WIL_TRACELOGGING_CONFIG_H | ||
| #include <wil/Tracelogging.h> | ||
|
|
||
| // [uuid(2e74ff65-bbda-5e80-4c0a-bd8320d4223b)] | ||
| class DevHomeTelemetryProvider : public wil::TraceLoggingProvider | ||
| { | ||
| IMPLEMENT_TRACELOGGING_CLASS(DevHomeTelemetryProvider, "Microsoft.Windows.DevHome", (0x2e74ff65, 0xbbda, 0x5e80, 0x4c, 0x0a, 0xbd, 0x83, 0x20, 0xd4, 0x22, 0x3b)); | ||
|
|
||
| public: | ||
|
|
||
| BEGIN_COMPLIANT_MEASURES_ACTIVITY_CLASS_WITH_LEVEL( | ||
| QuietBackgroundProcesses_ElevatedServer_Session, | ||
| PDT_ProductAndServicePerformance, | ||
| WINEVENT_LEVEL_CRITICAL); | ||
|
|
||
| DEFINE_ACTIVITY_START(uint64_t expectedDuration) | ||
| { | ||
| TraceLoggingClassWriteStart( | ||
| QuietBackgroundProcesses_ElevatedServer_Session, | ||
| TraceLoggingValue(expectedDuration, "ExpectedDuration")); | ||
| } | ||
| DEFINE_ACTIVITY_STOP(bool manuallyStopped, uint64_t actualDuration) | ||
| { | ||
| TraceLoggingClassWriteStop( | ||
| QuietBackgroundProcesses_ElevatedServer_Session, | ||
| TraceLoggingValue(manuallyStopped, "ManuallyStopped"), | ||
| TraceLoggingValue(actualDuration, "ActualDuration")); | ||
| } | ||
| END_ACTIVITY_CLASS(); | ||
| }; |
87 changes: 87 additions & 0 deletions
87
telemetry/DevHome.Telemetry.Native/inc/MicrosoftTelemetry.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /* ++ | ||
|
|
||
| Copyright (c) Microsoft Corporation. All rights reserved. | ||
| Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
|
||
| Module Name: | ||
|
|
||
| TraceLoggingConfig.h | ||
|
|
||
| Abstract: | ||
|
|
||
| Macro definitions used by this project's TraceLogging ETW providers: | ||
|
|
||
| - Configuration macros that select the ETW Provider Groups to be used by | ||
| this project. | ||
| - Constants for tags that are commonly used in Microsoft's | ||
| TraceLogging-based ETW. | ||
|
|
||
| Different versions of this file use different definitions for the | ||
| TraceLoggingOption configuration macros. The definitions in this file are | ||
| empty. As a result, providers using this configuration file will not join | ||
| any ETW Provider Groups and will not be given any special treatment by | ||
| group-sensitive ETW listeners. | ||
|
|
||
| Environment: | ||
|
|
||
| User mode or kernel mode. | ||
|
|
||
| --*/ | ||
|
|
||
| #pragma once | ||
|
|
||
| // Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition | ||
| // in this file configures the provider as a normal (non-telemetry) provider. | ||
| #define TraceLoggingOptionMicrosoftTelemetry() \ | ||
| // Empty definition for TraceLoggingOptionMicrosoftTelemetry | ||
|
|
||
| // Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition | ||
| // in this file configures the provider as a normal (non-telemetry) provider. | ||
| #define TraceLoggingOptionWindowsCoreTelemetry() \ | ||
| // Empty definition for TraceLoggingOptionWindowsCoreTelemetry | ||
|
|
||
| // Event privacy tags. Use the PDT macro values for the tag parameter, e.g.: | ||
| // TraceLoggingWrite(..., | ||
| // TelemetryPrivacyDataTag(PDT_BrowsingHistory | PDT_ProductAndServiceUsage), | ||
| // ...); | ||
| #define TelemetryPrivacyDataTag(tag) TraceLoggingUInt64((tag), "PartA_PrivTags") | ||
| #define PDT_BrowsingHistory 0x0000000000000002u | ||
| #define PDT_DeviceConnectivityAndConfiguration 0x0000000000000800u | ||
| #define PDT_InkingTypingAndSpeechUtterance 0x0000000000020000u | ||
| #define PDT_ProductAndServicePerformance 0x0000000001000000u | ||
| #define PDT_ProductAndServiceUsage 0x0000000002000000u | ||
| #define PDT_SoftwareSetupAndInventory 0x0000000080000000u | ||
|
|
||
| // Event categories specified via keywords, e.g.: | ||
| // TraceLoggingWrite(..., | ||
| // TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||
| // ...); | ||
| #define MICROSOFT_KEYWORD_CRITICAL_DATA 0x0000800000000000 // Bit 47 | ||
| #define MICROSOFT_KEYWORD_MEASURES 0x0000400000000000 // Bit 46 | ||
| #define MICROSOFT_KEYWORD_TELEMETRY 0x0000200000000000 // Bit 45 | ||
| #define MICROSOFT_KEYWORD_RESERVED_44 0x0000100000000000 // Bit 44 (reserved for future assignment) | ||
|
|
||
| // Event categories specified via event tags, e.g.: | ||
| // TraceLoggingWrite(..., | ||
| // TraceLoggingEventTag(MICROSOFT_EVENTTAG_REALTIME_LATENCY), | ||
| // ...); | ||
| #define MICROSOFT_EVENTTAG_DROP_USER_IDS 0x00008000 | ||
| #define MICROSOFT_EVENTTAG_AGGREGATE 0x00010000 | ||
| #define MICROSOFT_EVENTTAG_DROP_PII_EXCEPT_IP 0x00020000 | ||
| #define MICROSOFT_EVENTTAG_COSTDEFERRED_LATENCY 0x00040000 | ||
| #define MICROSOFT_EVENTTAG_CORE_DATA 0x00080000 | ||
| #define MICROSOFT_EVENTTAG_INJECT_XTOKEN 0x00100000 | ||
| #define MICROSOFT_EVENTTAG_REALTIME_LATENCY 0x00200000 | ||
| #define MICROSOFT_EVENTTAG_NORMAL_LATENCY 0x00400000 | ||
| #define MICROSOFT_EVENTTAG_CRITICAL_PERSISTENCE 0x00800000 | ||
| #define MICROSOFT_EVENTTAG_NORMAL_PERSISTENCE 0x01000000 | ||
| #define MICROSOFT_EVENTTAG_DROP_PII 0x02000000 | ||
| #define MICROSOFT_EVENTTAG_HASH_PII 0x04000000 | ||
| #define MICROSOFT_EVENTTAG_MARK_PII 0x08000000 | ||
|
|
||
| // Field categories specified via field tags, e.g.: | ||
| // TraceLoggingWrite(..., | ||
| // TraceLoggingString(szUser, "UserName", "User's name", MICROSOFT_FIELDTAG_HASH_PII), | ||
| // ...); | ||
| #define MICROSOFT_FIELDTAG_DROP_PII 0x04000000 | ||
| #define MICROSOFT_FIELDTAG_HASH_PII 0x08000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <packages> | ||
| </packages> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dupe of the UnStub script in the DevHome build's folder. Can this file not be shared, or referenced?
If not, please add a comment to this file, and the original, stating that these two files need to stay in-sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean this is a dupe? this is the one and only file with the name "unstub" that I can find in my repo (and I'm sync'd up on main)