ReactOS 0.4.16-dev-122-g325d74c
fxtelemetrykm.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxTelemetryKm.hpp
8
9Abstract:
10
11 This is header file for telemetry methods.
12
13Author:
14
15
16
17Environment:
18
19 Kernel mode only
20
21Revision History:
22
23Notes:
24
25--*/
26
27#pragma once
28
29#include "fxldr.h"
30
31#if defined(__cplusplus)
32extern "C" {
33#endif
34
35//
36// Event name: KmdfCensusEvtDeviceStart
37//
38// Source: KMDF only
39//
40// Description: Written when a FDO completes start successfully.
41//
42// Frequency: If FX_TELEMETRY_ENABLED, once per driver session. This is tracked using the
43// DoOnceFlag in the telemetry context. Also not to exceed
44// once in 24 hours (last write time stored in registry).
45//
46//
47#define KMDF_CENSUS_EVT_WRITE_DEVICE_START(TraceHandle , Globals, DriverConfig, SetupClass, BusEnum, HwID, Manafacturer) \
48 TraceLoggingWrite(TraceHandle, \
49 "KmdfCensusEvtDeviceStart", \
50 WDF_TELEMETRY_EVT_KEYWORDS, \
51 WDF_CENSUS_EVT_DATA_COMMON(Globals), \
52 TraceLoggingString((Globals)->Public.DriverName, "DriverServiceName"), \
53 TraceLoggingKmdfDriverConfigInfo(DriverConfig, "DriverConfigInfo"), \
54 TraceLoggingWideString(SetupClass.m_UnicodeString.Buffer, "SetupClass"), \
55 TraceLoggingWideString(BusEnum.m_UnicodeString.Buffer, "BusEnumerator"), \
56 TraceLoggingWideString(HwID.m_UnicodeString.Buffer, "HardwareId"), \
57 TraceLoggingWideString(Manafacturer.m_UnicodeString.Buffer, "ManufacturerString") \
58 );
59
60//
61// This is part of the data for KmdfCensusEvtDeviceStart event.
62//
63#define TraceLoggingKmdfDriverConfigInfo(info, fieldName) \
64 \
65 TraceLoggingStruct(23, fieldName), \
66 \
67 TraceLoggingUInt8(info.bitmap.IsNonPnpDriver, "IsNonPnpDriver" ), \
68 TraceLoggingUInt8(info.bitmap.IsNoDispatchOverride, "IsNoDispatchOverride" ), \
69 TraceLoggingUInt8(info.bitmap.IsVerifierOn, "IsVerifierOn" ), \
70 TraceLoggingUInt8(info.bitmap.IsEnhancedVerifierOn, "IsEnhancedVerifierOn" ), \
71 TraceLoggingUInt8(info.bitmap.IsFilter, "IsFilter" ), \
72 \
73 TraceLoggingUInt8(info.bitmap.IsUsingRemoveLockOption, "IsUsingRemoveLockOption" ), \
74 TraceLoggingUInt8(info.bitmap.IsUsingNonDefaultHardwareReleaseOrder, "IsUsingNonDefaultHardwareReleaseOrder" ), \
75 TraceLoggingUInt8(info.bitmap.IsPowerPolicyOwner, "IsPowerPolicyOwner" ), \
76 TraceLoggingUInt8(info.bitmap.IsS0IdleWakeFromS0Enabled, "IsS0IdleWakeFromS0Enabled" ), \
77 TraceLoggingUInt8(info.bitmap.IsS0IdleUsbSSEnabled, "IsS0IdleUsbSSEnabled" ), \
78 \
79 TraceLoggingUInt8(info.bitmap.IsS0IdleSystemManaged, "IsS0IdleSystemManaged" ), \
80 TraceLoggingUInt8(info.bitmap.IsSxWakeEnabled, "IsSxWakeEnabled" ), \
81 TraceLoggingUInt8(info.bitmap.IsUsingLevelTriggeredLineInterrupt, "IsUsingLevelTriggeredLineInterrupt" ), \
82 TraceLoggingUInt8(info.bitmap.IsUsingEdgeTriggeredLineInterrupt, "IsUsingEdgeTriggeredLineInterrupt" ), \
83 TraceLoggingUInt8(info.bitmap.IsUsingMsiXOrSingleMsi22Interrupt, "IsUsingMsiXOrSingleMsi22Interrupt" ), \
84 \
85 TraceLoggingUInt8(info.bitmap.IsUsingMsi22MultiMessageInterrupt, "IsUsingMsi22MultiMessageInterrupt" ), \
86 TraceLoggingUInt8(info.bitmap.IsUsingMultipleInterrupt, "IsUsingMultipleInterrupt" ), \
87 TraceLoggingUInt8(info.bitmap.IsUsingPassiveLevelInterrupt, "IsUsingPassiveLevelInterrupt" ), \
88 TraceLoggingUInt8(info.bitmap.IsUsingBusMasterDma, "IsUsingBusMasterDma" ), \
89 TraceLoggingUInt8(info.bitmap.IsUsingSystemDma, "IsUsingSystemDma" ), \
90 \
91 TraceLoggingUInt8(info.bitmap.IsUsingSystemDmaDuplex, "IsUsingSystemDmaDuplex" ), \
92 TraceLoggingUInt8(info.bitmap.IsUsingStaticBusEnumration, "IsUsingStaticBusEnumration" ), \
93 TraceLoggingUInt8(info.bitmap.IsUsingDynamicBusEnumeration, "IsUsingDynamicBusEnumeration" ) \
94
95//
96// When changing the structure, do update TraceLoggingKmdfDriverConfigInfo
97// for fields name and TraceLoggingStruct(count) as well. It is good to keep
98// fields order the same but it is not required.
99//
101 struct {
127};
128
129
130VOID
133 );
134
135VOID
138 _Out_ PLARGE_INTEGER CurrentTime
139 );
140
145 _Out_ PUNICODE_STRING SetupClass
146 );
147
151 );
152
159 _In_ ULONG Tag,
161 );
162
163VOID
168 );
169
170VOID
174 _Out_ PUNICODE_STRING PropertyString
175 );
176
177VOID
179 _Inout_ PUNICODE_STRING HardwareIds
180 );
181
185QueryAndAllocString(
190 );
191
192
193#if defined(__cplusplus)
194}
195#endif
196
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
unsigned long DWORD
Definition: ntddk_ex.h:95
DriverGlobals
VOID RegistryReadLastLoggedTime(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _Out_ PLARGE_INTEGER CurrentTime)
NTSTATUS GetHardwareIdAndSetupclassFromRegistry(_In_ FxDevice *Fdo, _Out_ PUNICODE_STRING HwIds, _Out_ PUNICODE_STRING SetupClass)
VOID GetDriverInfo(_In_ PFX_DRIVER_GLOBALS Globals, _In_opt_ FxDevice *Fdo, _Out_ FxTelemetryDriverInfo *DriverInfo)
VOID FxGetDevicePropertyString(_In_ FxDevice *Fdo, _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty, _Out_ PUNICODE_STRING PropertyString)
VOID RegistryWriteCurrentTime(_In_ PFX_DRIVER_GLOBALS DriverGlobals)
VOID GetFirstHardwareId(_Inout_ PUNICODE_STRING HardwareIds)
BOOLEAN IsLoggingEnabledAndNeeded(_In_ PFX_DRIVER_GLOBALS DriverGlobals)
_Must_inspect_result_ _In_ PFX_DRIVER_GLOBALS Globals
_Must_inspect_result_ NTSTATUS FxQueryData(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_ HANDLE Key, _In_ PCUNICODE_STRING ValueName, _In_ ULONG Tag, _Out_ PKEY_VALUE_PARTIAL_INFORMATION *Info)
#define _Inout_
Definition: ms_sal.h:378
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
DRIVER_INFORMATION DriverInfo
Definition: main.c:59
uint32_t ULONG
Definition: typedefs.h:59
DWORD IsUsingNonDefaultHardwareReleaseOrder
struct FxTelemetryDriverInfo::@4826 bitmap
DWORD IsUsingLevelTriggeredLineInterrupt
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3769
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
DEVICE_REGISTRY_PROPERTY
Definition: iotypes.h:1194