Skip to content

Commit 904470d

Browse files
authored
Telemetry (#529)
1 parent e3ec55a commit 904470d

13 files changed

+472
-24
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/* ++
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
Licensed under the MIT License. See LICENSE in the project root for license information.
5+
6+
Module Name:
7+
8+
TraceLoggingConfig.h
9+
10+
Abstract:
11+
12+
Macro definitions used by this project's TraceLogging ETW providers:
13+
14+
- Configuration macros that select the ETW Provider Groups to be used by
15+
this project.
16+
- Constants for tags that are commonly used in Microsoft's
17+
TraceLogging-based ETW.
18+
19+
Different versions of this file use different definitions for the
20+
TraceLoggingOption configuration macros. The definitions in this file are
21+
empty. As a result, providers using this configuration file will not join
22+
any ETW Provider Groups and will not be given any special treatment by
23+
group-sensitive ETW listeners.
24+
25+
Environment:
26+
27+
User mode or kernel mode.
28+
29+
--*/
30+
31+
#pragma once
32+
33+
// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
34+
// in this file configures the provider as a normal (non-telemetry) provider.
35+
#define TraceLoggingOptionMicrosoftTelemetry() \
36+
// Empty definition for TraceLoggingOptionMicrosoftTelemetry
37+
38+
// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
39+
// in this file configures the provider as a normal (non-telemetry) provider.
40+
#define TraceLoggingOptionWindowsCoreTelemetry() \
41+
// Empty definition for TraceLoggingOptionWindowsCoreTelemetry
42+
43+
// Event privacy tags. Use the PDT macro values for the tag parameter, e.g.:
44+
// TraceLoggingWrite(...,
45+
// TelemetryPrivacyDataTag(PDT_BrowsingHistory | PDT_ProductAndServiceUsage),
46+
// ...);
47+
#define TelemetryPrivacyDataTag(tag) TraceLoggingUInt64((tag), "PartA_PrivTags")
48+
#define PDT_BrowsingHistory 0x0000000000000002u
49+
#define PDT_DeviceConnectivityAndConfiguration 0x0000000000000800u
50+
#define PDT_InkingTypingAndSpeechUtterance 0x0000000000020000u
51+
#define PDT_ProductAndServicePerformance 0x0000000001000000u
52+
#define PDT_ProductAndServiceUsage 0x0000000002000000u
53+
#define PDT_SoftwareSetupAndInventory 0x0000000080000000u
54+
55+
// Event categories specified via keywords, e.g.:
56+
// TraceLoggingWrite(...,
57+
// TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
58+
// ...);
59+
#define MICROSOFT_KEYWORD_CRITICAL_DATA 0x0000800000000000 // Bit 47
60+
#define MICROSOFT_KEYWORD_MEASURES 0x0000400000000000 // Bit 46
61+
#define MICROSOFT_KEYWORD_TELEMETRY 0x0000200000000000 // Bit 45
62+
#define MICROSOFT_KEYWORD_RESERVED_44 0x0000100000000000 // Bit 44 (reserved for future assignment)
63+
64+
// Event categories specified via event tags, e.g.:
65+
// TraceLoggingWrite(...,
66+
// TraceLoggingEventTag(MICROSOFT_EVENTTAG_REALTIME_LATENCY),
67+
// ...);
68+
#define MICROSOFT_EVENTTAG_DROP_USER_IDS 0x00008000
69+
#define MICROSOFT_EVENTTAG_AGGREGATE 0x00010000
70+
#define MICROSOFT_EVENTTAG_DROP_PII_EXCEPT_IP 0x00020000
71+
#define MICROSOFT_EVENTTAG_COSTDEFERRED_LATENCY 0x00040000
72+
#define MICROSOFT_EVENTTAG_CORE_DATA 0x00080000
73+
#define MICROSOFT_EVENTTAG_INJECT_XTOKEN 0x00100000
74+
#define MICROSOFT_EVENTTAG_REALTIME_LATENCY 0x00200000
75+
#define MICROSOFT_EVENTTAG_NORMAL_LATENCY 0x00400000
76+
#define MICROSOFT_EVENTTAG_CRITICAL_PERSISTENCE 0x00800000
77+
#define MICROSOFT_EVENTTAG_NORMAL_PERSISTENCE 0x01000000
78+
#define MICROSOFT_EVENTTAG_DROP_PII 0x02000000
79+
#define MICROSOFT_EVENTTAG_HASH_PII 0x04000000
80+
#define MICROSOFT_EVENTTAG_MARK_PII 0x08000000
81+
82+
// Field categories specified via field tags, e.g.:
83+
// TraceLoggingWrite(...,
84+
// TraceLoggingString(szUser, "UserName", "User's name", MICROSOFT_FIELDTAG_HASH_PII),
85+
// ...);
86+
#define MICROSOFT_FIELDTAG_DROP_PII 0x04000000
87+
#define MICROSOFT_FIELDTAG_HASH_PII 0x08000000

contrib/win32/openssh/OpenSSHBuildHelper.psm1

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Set-StrictMode -Version 2.0
1+
Set-StrictMode -Version 2.0
22
If ($PSVersiontable.PSVersion.Major -le 2) {$PSScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path}
33
Import-Module $PSScriptRoot\OpenSSHCommonUtils.psm1 -Force
44

@@ -150,6 +150,7 @@ function Start-OpenSSHBootstrap
150150
[bool] $silent = -not $script:Verbose
151151
Write-BuildMsg -AsInfo -Message "Checking tools and dependencies" -Silent:$silent
152152

153+
$Win10SDKVerChoco = "10.1.17763.1"
153154
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'MACHINE')
154155
$newMachineEnvironmentPath = $machinePath
155156

@@ -205,26 +206,36 @@ function Start-OpenSSHBootstrap
205206
}
206207

207208
$vcVars = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"
208-
$sdkPath = "${env:ProgramFiles(x86)}\Windows Kits\8.1\bin\x86\register_app.vbs"
209+
$sdkVersion = Get-Windows10SDKVersion
210+
$env:vctargetspath = "${env:ProgramFiles(x86)}\MSBuild\Microsoft.Cpp\v4.0\v140"
211+
212+
if ($sdkVersion -eq $null)
213+
{
214+
$packageName = "windows-sdk-10.1"
215+
Write-BuildMsg -AsInfo -Message "$packageName not present. Installing $packageName ..."
216+
choco install $packageName --version=$Win10SDKVerChoco -y --force --limitoutput --execution-timeout 120 2>&1 >> $script:BuildLogFile
217+
}
218+
219+
if (-not (Test-Path $env:vctargetspath))
220+
{
221+
Write-BuildMsg -AsInfo -Message "installing visualcpp-build-tools"
222+
choco install visualcpp-build-tools --version 14.0.25420.1 -y --force --limitoutput --execution-timeout 120 2>&1 >> $script:BuildLogFile
223+
}
224+
209225
#use vs2017 build tool if exists
210226
if($VS2017Path -ne $null)
211227
{
212-
If (-not (Test-Path $sdkPath))
213-
{
214-
$packageName = "windows-sdk-8.1"
215-
Write-BuildMsg -AsInfo -Message "$packageName not present. Installing $packageName ..."
216-
choco install $packageName -y --force --limitoutput --execution-timeout 10000 2>&1 >> $script:BuildLogFile
217-
}
228+
218229

219230
if(-not (Test-Path $VcVars))
220231
{
221232
Write-BuildMsg -AsError -ErrorAction Stop -Message "VC++ 2015.3 v140 toolset are not installed."
222233
}
223234
}
224-
elseIf (($VS2015Path -eq $null) -or (-not (Test-Path $VcVars)) -or (-not (Test-Path $sdkPath))) {
235+
elseIf (($VS2015Path -eq $null) -or (-not (Test-Path $VcVars))) {
225236
$packageName = "vcbuildtools"
226237
Write-BuildMsg -AsInfo -Message "$packageName not present. Installing $packageName ..."
227-
choco install $packageName -ia "/InstallSelectableItems VisualCppBuildTools_ATLMFC_SDK;VisualCppBuildTools_NETFX_SDK;Win81SDK_CppBuildSKUV1" -y --force --limitoutput --execution-timeout 10000 2>&1 >> $script:BuildLogFile
238+
choco install $packageName -ia "/InstallSelectableItems VisualCppBuildTools_ATLMFC_SDK;VisualCppBuildTools_NETFX_SDK" -y --force --limitoutput --execution-timeout 120 2>&1 >> $script:BuildLogFile
228239
$errorCode = $LASTEXITCODE
229240
if ($errorCode -eq 3010)
230241
{
@@ -272,7 +283,7 @@ function Start-OpenSSHBootstrap
272283
{
273284
$packageName = "windows-sdk-10.1"
274285
Write-BuildMsg -AsInfo -Message "$packageName not present. Installing $packageName ..."
275-
choco install $packageName --force --limitoutput --execution-timeout 10000 2>&1 >> $script:BuildLogFile
286+
choco install $packageName --version=$Win10SDKVerChoco --force --limitoutput --execution-timeout 120 2>&1 >> $script:BuildLogFile
276287
}
277288
}
278289

@@ -577,6 +588,7 @@ function Start-OpenSSHBuild
577588
}
578589

579590
Write-BuildMsg -AsInfo -Message "Starting Open SSH build; Build Log: $($script:BuildLogFile)."
591+
Write-BuildMsg -AsInfo -Message "$msbuildCmd $cmdMsg"
580592

581593
& "$msbuildCmd" $cmdMsg
582594
$errorCode = $LASTEXITCODE
@@ -622,20 +634,17 @@ function Get-VS2015BuildToolPath
622634
}
623635

624636
function Get-Windows10SDKVersion
625-
{
637+
{
638+
#Temporary fix - Onecore builds are failing with latest windows 10 SDK (10.0.18362.0)
639+
$requiredSDKVersion = [version]"10.0.17763.0"
626640
## Search for latest windows sdk available on the machine
627-
$windowsSDKPath = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\Lib"
628-
$minSDKVersion = [version]"10.0.14393.0"
629-
$versionsAvailable = @()
630-
#Temporary fix - Onecore builds are failing with latest widows 10 SDK (10.0.18362.0)
631-
$maxSDKVersion = [version]"10.0.17763.0"
632-
$versionsAvailable = Get-ChildItem $windowsSDKPath | ? {$_.Name.StartsWith("10.")} | % {$version = [version]$_.Name; if(($version.CompareTo($minSDKVersion) -ge 0) -and ($version.CompareTo($maxSDKVersion) -le 0)) {$version}}
633-
if(0 -eq $versionsAvailable.count)
634-
{
635-
return $null
641+
$windowsSDKPath = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\bin\$requiredSDKVersion\x86\register_app.vbs"
642+
if (test-path $windowsSDKPath) {
643+
return $requiredSDKVersion
644+
}
645+
else {
646+
return $null
636647
}
637-
$versionsAvailable = $versionsAvailable | Sort-Object -Descending
638-
return $versionsAvailable[0]
639648
}
640649

641650
function Get-BuildLogFile

contrib/win32/openssh/paths.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ZLib-arm-Path>$(SolutionDir)\ZLib\bin\arm\</ZLib-arm-Path>
1919
<UseOpenSSL>true</UseOpenSSL>
2020
<SSLLib>libcrypto.lib;</SSLLib>
21-
<WindowsSDKVersion>8.1</WindowsSDKVersion>
21+
<WindowsSDKVersion>10.0.17763.0</WindowsSDKVersion>
2222
<AdditionalDependentLibs>bcrypt.lib;Userenv.lib;Crypt32.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Netapi32.lib;Rpcrt4.lib;ntdll.lib</AdditionalDependentLibs>
2323
<MinimalCoreWin>false</MinimalCoreWin>
2424
</PropertyGroup>

0 commit comments

Comments
 (0)