@@ -80,6 +80,38 @@ def __init__(self, runtime):
80
80
"BYTE" : "BYTE" ,
81
81
}
82
82
83
+ coreCLRUserEventDataTypeMapping = {
84
+ "win:UInt8" : "TraceLoggingUInt8" ,
85
+ "win:UInt16" : "TraceLoggingUInt16" ,
86
+ "win:Int32" : "TraceLoggingInt32" ,
87
+ "win:UInt32" : "TraceLoggingUInt32" ,
88
+ "win:HexInt32" : "TraceLoggingHexInt32" ,
89
+ "win:UInt64" : "TraceLoggingUInt64" ,
90
+ "win:Int64" : "TraceLoggingInt64" ,
91
+ "win:HexInt64" : "TraceLoggingHexInt64" ,
92
+ "win:Pointer" : "TraceLoggingPointer" ,
93
+ "win:Boolean" : "TraceLoggingBoolean" ,
94
+ "win:UnicodeString" : "TraceLoggingString16" ,
95
+ "win:GUID" : "TraceLoggingGuid" ,
96
+ "win:Binary" : "TraceLoggingBinary" ,
97
+ "win:Double" : "TraceLoggingFloat64" ,
98
+ "win:AnsiString" : "TraceLoggingString" ,
99
+ }
100
+
101
+ coreCLRUserEventLogLevelMapping = {
102
+ "win:LogAlways" : "0" ,
103
+ "win:Critical" : "1" ,
104
+ "win:Error" : "2" ,
105
+ "win:Warning" : "3" ,
106
+ "win:Informational" : "4" ,
107
+ "win:Verbose" : "5" ,
108
+ }
109
+
110
+ coreCLRUserEventArrayTypeMapping = {
111
+ "win:UInt32" : "TraceLoggingUInt32Array" ,
112
+ "win:Binary" : "TraceLoggingUInt8Array" ,
113
+ "win:UInt64" : "TraceLoggingUInt64Array" ,
114
+ }
83
115
monoPalDataTypeMapping = {
84
116
#constructed types
85
117
"win:null" :" " ,
@@ -143,6 +175,25 @@ def __init__(self, runtime):
143
175
"WCHAR" : "WCHAR" ,
144
176
"BYTE" : "BYTE" ,
145
177
}
178
+ def getUserEventDataTypeMapping (runtimeFlavor ):
179
+ if runtimeFlavor .coreclr :
180
+ return coreCLRUserEventDataTypeMapping
181
+ # elif runtimeFlavor.mono:
182
+ # return monoEventPipeDataTypeMapping
183
+ # elif runtimeFlavor.nativeaot:
184
+ # return aotEventPipeDataTypeMapping
185
+
186
+ def getUserEventLogLevelMapping (runtimeFlavor ):
187
+ if runtimeFlavor .coreclr :
188
+ return coreCLRUserEventLogLevelMapping
189
+
190
+ def getArrayDataTypeMapping (runtimeFlavor ):
191
+ if runtimeFlavor .coreclr :
192
+ return coreCLRUserEventArrayTypeMapping
193
+ # elif runtimeFlavor.mono:
194
+ # return monoEventPipeDataTypeMapping
195
+ # elif runtimeFlavor.nativeaot:
196
+ # return aotEventPipeDataTypeMapping
146
197
147
198
def getEventPipeDataTypeMapping (runtimeFlavor ):
148
199
if runtimeFlavor .coreclr :
@@ -159,15 +210,15 @@ def getPalDataTypeMapping(runtimeFlavor):
159
210
return monoPalDataTypeMapping
160
211
elif runtimeFlavor .nativeaot :
161
212
return aotPalDataTypeMapping
162
-
213
+ #maybe need to add getUserEventDataTypeMapping
163
214
def includeProvider (providerName , runtimeFlavor ):
164
215
if (runtimeFlavor .coreclr or runtimeFlavor .nativeaot ) and providerName == "Microsoft-DotNETRuntimeMonoProfiler" :
165
216
return False
166
217
elif runtimeFlavor .nativeaot and (providerName == "Microsoft-Windows-DotNETRuntimeRundown" or providerName == "Microsoft-Windows-DotNETRuntimeStress" ):
167
218
return False
168
219
else :
169
220
return True
170
-
221
+
171
222
def includeEvent (inclusionList , providerName , eventName ):
172
223
if len (inclusionList ) == 0 :
173
224
return True
@@ -543,7 +594,7 @@ def generateClrallEvents(eventNodes, allTemplates, target_cpp, runtimeFlavor, wr
543
594
if runtimeFlavor .coreclr or write_xplatheader :
544
595
fnbody .append (lindent )
545
596
fnbody .append ("status &= FireEtXplat" + eventName + "(" + '' .join (line ) + ");\n " )
546
-
597
+
547
598
if runtimeFlavor .nativeaot :
548
599
if providerName == "Microsoft-Windows-DotNETRuntime" or providerName == "Microsoft-Windows-DotNETRuntimePrivate" :
549
600
fnbody .append ("#ifndef TARGET_UNIX\n " )
@@ -781,7 +832,7 @@ def updateclreventsfile(write_xplatheader, target_cpp, runtimeFlavor, eventpipe_
781
832
elif generatedFileType == "source-impl-noop" :
782
833
Clrallevents .write ('#include <CommonTypes.h>\n ' )
783
834
Clrallevents .write ('#include <CommonMacros.h>\n \n ' )
784
- Clrallevents .write ('#include <PalRedhawk.h>\n \n ' )
835
+ Clrallevents .write ('#include <PalRedhawk.h>\n \n ' )
785
836
Clrallevents .write ('#ifndef ERROR_SUCCESS\n ' )
786
837
Clrallevents .write ('#define ERROR_SUCCESS 0L\n ' )
787
838
Clrallevents .write ('#endif\n \n ' )
0 commit comments