1 /*++
2
3 Copyright (c) Microsoft Corporation
4
5 Module Name:
6
7 FxPerfTrace.hpp
8
9 Abstract:
10
11 This is header file for perf trace methods.
12
13 Author:
14
15
16
17 Environment:
18
19 Kernel mode only
20
21 Revision History:
22
23 Notes:
24
25 --*/
26
27 #pragma once
28
29 //
30 // Version starts from 2 to be in sync with ETW versioning
31 //
32 #define WDF_DPC_EVENT_VERSION_2 2
33 #define WDF_INTERRUPT_EVENT_VERSION_2 2
34 #define WDF_WORK_ITEM_EVENT_VERSION_2 2
35
36 // __REACTOS__ : functions are commented out
37
38 FORCEINLINE
39 VOID
FxPerfTraceDpc(_In_ PVOID DriverCallback)40 FxPerfTraceDpc(
41 _In_ PVOID DriverCallback
42 )
43 {
44 // PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
45
46 // //
47 // // Trace driver's ISR using perf trace callback. If the perf trace callback
48 // // is NULL, it means either perf tracing is not enabled, or this OS
49 // // doesn't support perf tracing for WDF (note only win8+ supports WDF perf
50 // // trace callbacks).
51 // //
52 // perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->DpcNotifyRoutine;
53 // if (perfTraceCallback != NULL) {
54 // (perfTraceCallback) (DriverCallback, // event data
55 // sizeof(PVOID), // sizeof event
56 // PERF_WDF_DPC, // group mask
57 // PERFINFO_LOG_TYPE_WDF_DPC, // hook id
58 // WDF_DPC_EVENT_VERSION_2 // version
59 // );
60 // }
61 }
62
63 FORCEINLINE
64 VOID
FxPerfTraceInterrupt(_In_ PVOID DriverCallback)65 FxPerfTraceInterrupt(
66 _In_ PVOID DriverCallback
67 )
68 {
69 // PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
70
71 // perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->InterruptNotifyRoutine;
72 // if (perfTraceCallback != NULL) {
73 // (perfTraceCallback) (DriverCallback, // event data
74 // sizeof(PVOID), // sizeof event
75 // PERF_WDF_INTERRUPT, // group mask
76 // PERFINFO_LOG_TYPE_WDF_INTERRUPT, // hook id
77 // WDF_INTERRUPT_EVENT_VERSION_2 // version
78 // );
79 // }
80 }
81
82 FORCEINLINE
83 VOID
FxPerfTracePassiveInterrupt(_In_ PVOID DriverCallback)84 FxPerfTracePassiveInterrupt(
85 _In_ PVOID DriverCallback
86 )
87 {
88 // PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
89
90 // perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->InterruptNotifyRoutine;
91 // if (perfTraceCallback != NULL) {
92 // (perfTraceCallback) (DriverCallback,
93 // sizeof(PVOID),
94 // PERF_WDF_INTERRUPT,
95 // PERFINFO_LOG_TYPE_WDF_PASSIVE_INTERRUPT,
96 // WDF_INTERRUPT_EVENT_VERSION_2
97 // );
98 // }
99 }
100
101 FORCEINLINE
102 VOID
FxPerfTraceWorkItem(_In_ PVOID DriverCallback)103 FxPerfTraceWorkItem(
104 _In_ PVOID DriverCallback
105 )
106 {
107 // PWMI_WDF_NOTIFY_ROUTINE perfTraceCallback = NULL;
108
109 // perfTraceCallback = FxLibraryGlobals.PerfTraceRoutines->WorkItemNotifyRoutine;
110 // if (perfTraceCallback != NULL) {
111 // (perfTraceCallback) (DriverCallback,
112 // sizeof(PVOID),
113 // PERF_WORKER_THREAD,
114 // PERFINFO_LOG_TYPE_WDF_WORK_ITEM,
115 // WDF_WORK_ITEM_EVENT_VERSION_2
116 // );
117 // }
118 }
119
120