| 1 | |
| 2 | // Licensed to the .NET Foundation under one or more agreements. |
| 3 | // The .NET Foundation licenses this file to you under the MIT license. |
| 4 | // See the LICENSE file in the project root for more information. |
| 5 | |
| 6 | /****************************************************************** |
| 7 | |
| 8 | DO NOT MODIFY. AUTOGENERATED FILE. |
| 9 | This file is generated using the logic from <root>/src/scripts/genLttngProvider.py |
| 10 | |
| 11 | ******************************************************************/ |
| 12 | |
| 13 | |
| 14 | #define TRACEPOINT_DEFINE |
| 15 | #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE |
| 16 | |
| 17 | #include "stdlib.h" |
| 18 | #include "pal_mstypes.h" |
| 19 | #include "pal_error.h" |
| 20 | #include "pal.h" |
| 21 | #define PAL_free free |
| 22 | #define PAL_realloc realloc |
| 23 | #include "pal/stackstring.hpp" |
| 24 | #include "tpdotnetruntime.h" |
| 25 | |
| 26 | #ifndef tracepoint_enabled |
| 27 | #define tracepoint_enabled(provider, name) TRUE |
| 28 | #define do_tracepoint tracepoint |
| 29 | #endif |
| 30 | |
| 31 | #define wcslen PAL_wcslen |
| 32 | |
| 33 | bool ResizeBuffer(char *&buffer, size_t& size, size_t currLen, size_t newSize, bool &fixedBuffer); |
| 34 | bool WriteToBuffer(PCWSTR str, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer); |
| 35 | bool WriteToBuffer(const char *str, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer); |
| 36 | bool WriteToBuffer(const BYTE *src, size_t len, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer); |
| 37 | |
| 38 | template <typename T> |
| 39 | bool WriteToBuffer(const T &value, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer) |
| 40 | { |
| 41 | if (sizeof(T) + offset > size) |
| 42 | { |
| 43 | if (!ResizeBuffer(buffer, size, offset, size + sizeof(T), fixedBuffer)) |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | memcpy(buffer + offset, (char *)&value, sizeof(T)); |
| 48 | offset += sizeof(T); |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | extern "C" BOOL EventXplatEnabledGCStart(){ return tracepoint_enabled(DotNETRuntime, GCStart); } |
| 53 | |
| 54 | extern "C" ULONG FireEtXplatGCStart( |
| 55 | const unsigned int Count, |
| 56 | const unsigned int Reason) |
| 57 | { |
| 58 | if (!EventXplatEnabledGCStart()) |
| 59 | return ERROR_SUCCESS; |
| 60 | |
| 61 | do_tracepoint(DotNETRuntime, |
| 62 | GCStart, |
| 63 | Count, |
| 64 | Reason); |
| 65 | |
| 66 | return ERROR_SUCCESS; |
| 67 | } |
| 68 | |
| 69 | extern "C" BOOL EventXplatEnabledGCStart_V1(){ return tracepoint_enabled(DotNETRuntime, GCStart_V1); } |
| 70 | |
| 71 | extern "C" ULONG FireEtXplatGCStart_V1( |
| 72 | const unsigned int Count, |
| 73 | const unsigned int Depth, |
| 74 | const unsigned int Reason, |
| 75 | const unsigned int Type, |
| 76 | const unsigned short ClrInstanceID) |
| 77 | { |
| 78 | if (!EventXplatEnabledGCStart_V1()) |
| 79 | return ERROR_SUCCESS; |
| 80 | |
| 81 | do_tracepoint(DotNETRuntime, |
| 82 | GCStart_V1, |
| 83 | Count, |
| 84 | Depth, |
| 85 | Reason, |
| 86 | Type, |
| 87 | ClrInstanceID); |
| 88 | |
| 89 | return ERROR_SUCCESS; |
| 90 | } |
| 91 | |
| 92 | extern "C" BOOL EventXplatEnabledGCStart_V2(){ return tracepoint_enabled(DotNETRuntime, GCStart_V2); } |
| 93 | |
| 94 | extern "C" ULONG FireEtXplatGCStart_V2( |
| 95 | const unsigned int Count, |
| 96 | const unsigned int Depth, |
| 97 | const unsigned int Reason, |
| 98 | const unsigned int Type, |
| 99 | const unsigned short ClrInstanceID, |
| 100 | const unsigned __int64 ClientSequenceNumber) |
| 101 | { |
| 102 | if (!EventXplatEnabledGCStart_V2()) |
| 103 | return ERROR_SUCCESS; |
| 104 | |
| 105 | do_tracepoint(DotNETRuntime, |
| 106 | GCStart_V2, |
| 107 | Count, |
| 108 | Depth, |
| 109 | Reason, |
| 110 | Type, |
| 111 | ClrInstanceID, |
| 112 | ClientSequenceNumber); |
| 113 | |
| 114 | return ERROR_SUCCESS; |
| 115 | } |
| 116 | |
| 117 | extern "C" BOOL EventXplatEnabledGCEnd(){ return tracepoint_enabled(DotNETRuntime, GCEnd); } |
| 118 | |
| 119 | extern "C" ULONG FireEtXplatGCEnd( |
| 120 | const unsigned int Count, |
| 121 | const unsigned short Depth) |
| 122 | { |
| 123 | if (!EventXplatEnabledGCEnd()) |
| 124 | return ERROR_SUCCESS; |
| 125 | |
| 126 | do_tracepoint(DotNETRuntime, |
| 127 | GCEnd, |
| 128 | Count, |
| 129 | Depth); |
| 130 | |
| 131 | return ERROR_SUCCESS; |
| 132 | } |
| 133 | |
| 134 | extern "C" BOOL EventXplatEnabledGCEnd_V1(){ return tracepoint_enabled(DotNETRuntime, GCEnd_V1); } |
| 135 | |
| 136 | extern "C" ULONG FireEtXplatGCEnd_V1( |
| 137 | const unsigned int Count, |
| 138 | const unsigned int Depth, |
| 139 | const unsigned short ClrInstanceID) |
| 140 | { |
| 141 | if (!EventXplatEnabledGCEnd_V1()) |
| 142 | return ERROR_SUCCESS; |
| 143 | |
| 144 | do_tracepoint(DotNETRuntime, |
| 145 | GCEnd_V1, |
| 146 | Count, |
| 147 | Depth, |
| 148 | ClrInstanceID); |
| 149 | |
| 150 | return ERROR_SUCCESS; |
| 151 | } |
| 152 | |
| 153 | extern "C" BOOL EventXplatEnabledGCRestartEEEnd(){ return tracepoint_enabled(DotNETRuntime, GCRestartEEEnd); } |
| 154 | |
| 155 | extern "C" ULONG FireEtXplatGCRestartEEEnd( |
| 156 | ) |
| 157 | { |
| 158 | if (!EventXplatEnabledGCRestartEEEnd()) |
| 159 | return ERROR_SUCCESS; |
| 160 | |
| 161 | do_tracepoint(DotNETRuntime, GCRestartEEEnd); |
| 162 | |
| 163 | return ERROR_SUCCESS; |
| 164 | } |
| 165 | |
| 166 | extern "C" BOOL EventXplatEnabledGCRestartEEEnd_V1(){ return tracepoint_enabled(DotNETRuntime, GCRestartEEEnd_V1); } |
| 167 | |
| 168 | extern "C" ULONG FireEtXplatGCRestartEEEnd_V1( |
| 169 | const unsigned short ClrInstanceID) |
| 170 | { |
| 171 | if (!EventXplatEnabledGCRestartEEEnd_V1()) |
| 172 | return ERROR_SUCCESS; |
| 173 | |
| 174 | do_tracepoint(DotNETRuntime, |
| 175 | GCRestartEEEnd_V1, |
| 176 | ClrInstanceID); |
| 177 | |
| 178 | return ERROR_SUCCESS; |
| 179 | } |
| 180 | |
| 181 | extern "C" BOOL EventXplatEnabledGCHeapStats(){ return tracepoint_enabled(DotNETRuntime, GCHeapStats); } |
| 182 | |
| 183 | extern "C" ULONG FireEtXplatGCHeapStats( |
| 184 | const unsigned __int64 GenerationSize0, |
| 185 | const unsigned __int64 TotalPromotedSize0, |
| 186 | const unsigned __int64 GenerationSize1, |
| 187 | const unsigned __int64 TotalPromotedSize1, |
| 188 | const unsigned __int64 GenerationSize2, |
| 189 | const unsigned __int64 TotalPromotedSize2, |
| 190 | const unsigned __int64 GenerationSize3, |
| 191 | const unsigned __int64 TotalPromotedSize3, |
| 192 | const unsigned __int64 FinalizationPromotedSize, |
| 193 | const unsigned __int64 FinalizationPromotedCount, |
| 194 | const unsigned int PinnedObjectCount, |
| 195 | const unsigned int SinkBlockCount, |
| 196 | const unsigned int GCHandleCount) |
| 197 | { |
| 198 | if (!EventXplatEnabledGCHeapStats()) |
| 199 | return ERROR_SUCCESS; |
| 200 | |
| 201 | char stackBuffer[92]; |
| 202 | char *buffer = stackBuffer; |
| 203 | size_t offset = 0; |
| 204 | size_t size = 92; |
| 205 | bool fixedBuffer = true; |
| 206 | |
| 207 | bool success = true; |
| 208 | success &= WriteToBuffer(GenerationSize0, buffer, offset, size, fixedBuffer); |
| 209 | success &= WriteToBuffer(TotalPromotedSize0, buffer, offset, size, fixedBuffer); |
| 210 | success &= WriteToBuffer(GenerationSize1, buffer, offset, size, fixedBuffer); |
| 211 | success &= WriteToBuffer(TotalPromotedSize1, buffer, offset, size, fixedBuffer); |
| 212 | success &= WriteToBuffer(GenerationSize2, buffer, offset, size, fixedBuffer); |
| 213 | success &= WriteToBuffer(TotalPromotedSize2, buffer, offset, size, fixedBuffer); |
| 214 | success &= WriteToBuffer(GenerationSize3, buffer, offset, size, fixedBuffer); |
| 215 | success &= WriteToBuffer(TotalPromotedSize3, buffer, offset, size, fixedBuffer); |
| 216 | success &= WriteToBuffer(FinalizationPromotedSize, buffer, offset, size, fixedBuffer); |
| 217 | success &= WriteToBuffer(FinalizationPromotedCount, buffer, offset, size, fixedBuffer); |
| 218 | success &= WriteToBuffer(PinnedObjectCount, buffer, offset, size, fixedBuffer); |
| 219 | success &= WriteToBuffer(SinkBlockCount, buffer, offset, size, fixedBuffer); |
| 220 | success &= WriteToBuffer(GCHandleCount, buffer, offset, size, fixedBuffer); |
| 221 | |
| 222 | if (!success) |
| 223 | { |
| 224 | if (!fixedBuffer) |
| 225 | delete[] buffer; |
| 226 | return ERROR_WRITE_FAULT; |
| 227 | } |
| 228 | |
| 229 | do_tracepoint(DotNETRuntime, GCHeapStats, offset, buffer); |
| 230 | |
| 231 | if (!fixedBuffer) |
| 232 | delete[] buffer; |
| 233 | |
| 234 | return ERROR_SUCCESS; |
| 235 | } |
| 236 | |
| 237 | extern "C" BOOL EventXplatEnabledGCHeapStats_V1(){ return tracepoint_enabled(DotNETRuntime, GCHeapStats_V1); } |
| 238 | |
| 239 | extern "C" ULONG FireEtXplatGCHeapStats_V1( |
| 240 | const unsigned __int64 GenerationSize0, |
| 241 | const unsigned __int64 TotalPromotedSize0, |
| 242 | const unsigned __int64 GenerationSize1, |
| 243 | const unsigned __int64 TotalPromotedSize1, |
| 244 | const unsigned __int64 GenerationSize2, |
| 245 | const unsigned __int64 TotalPromotedSize2, |
| 246 | const unsigned __int64 GenerationSize3, |
| 247 | const unsigned __int64 TotalPromotedSize3, |
| 248 | const unsigned __int64 FinalizationPromotedSize, |
| 249 | const unsigned __int64 FinalizationPromotedCount, |
| 250 | const unsigned int PinnedObjectCount, |
| 251 | const unsigned int SinkBlockCount, |
| 252 | const unsigned int GCHandleCount, |
| 253 | const unsigned short ClrInstanceID) |
| 254 | { |
| 255 | if (!EventXplatEnabledGCHeapStats_V1()) |
| 256 | return ERROR_SUCCESS; |
| 257 | |
| 258 | char stackBuffer[94]; |
| 259 | char *buffer = stackBuffer; |
| 260 | size_t offset = 0; |
| 261 | size_t size = 94; |
| 262 | bool fixedBuffer = true; |
| 263 | |
| 264 | bool success = true; |
| 265 | success &= WriteToBuffer(GenerationSize0, buffer, offset, size, fixedBuffer); |
| 266 | success &= WriteToBuffer(TotalPromotedSize0, buffer, offset, size, fixedBuffer); |
| 267 | success &= WriteToBuffer(GenerationSize1, buffer, offset, size, fixedBuffer); |
| 268 | success &= WriteToBuffer(TotalPromotedSize1, buffer, offset, size, fixedBuffer); |
| 269 | success &= WriteToBuffer(GenerationSize2, buffer, offset, size, fixedBuffer); |
| 270 | success &= WriteToBuffer(TotalPromotedSize2, buffer, offset, size, fixedBuffer); |
| 271 | success &= WriteToBuffer(GenerationSize3, buffer, offset, size, fixedBuffer); |
| 272 | success &= WriteToBuffer(TotalPromotedSize3, buffer, offset, size, fixedBuffer); |
| 273 | success &= WriteToBuffer(FinalizationPromotedSize, buffer, offset, size, fixedBuffer); |
| 274 | success &= WriteToBuffer(FinalizationPromotedCount, buffer, offset, size, fixedBuffer); |
| 275 | success &= WriteToBuffer(PinnedObjectCount, buffer, offset, size, fixedBuffer); |
| 276 | success &= WriteToBuffer(SinkBlockCount, buffer, offset, size, fixedBuffer); |
| 277 | success &= WriteToBuffer(GCHandleCount, buffer, offset, size, fixedBuffer); |
| 278 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 279 | |
| 280 | if (!success) |
| 281 | { |
| 282 | if (!fixedBuffer) |
| 283 | delete[] buffer; |
| 284 | return ERROR_WRITE_FAULT; |
| 285 | } |
| 286 | |
| 287 | do_tracepoint(DotNETRuntime, GCHeapStats_V1, offset, buffer); |
| 288 | |
| 289 | if (!fixedBuffer) |
| 290 | delete[] buffer; |
| 291 | |
| 292 | return ERROR_SUCCESS; |
| 293 | } |
| 294 | |
| 295 | extern "C" BOOL EventXplatEnabledGCCreateSegment(){ return tracepoint_enabled(DotNETRuntime, GCCreateSegment); } |
| 296 | |
| 297 | extern "C" ULONG FireEtXplatGCCreateSegment( |
| 298 | const unsigned __int64 Address, |
| 299 | const unsigned __int64 Size, |
| 300 | const unsigned int Type) |
| 301 | { |
| 302 | if (!EventXplatEnabledGCCreateSegment()) |
| 303 | return ERROR_SUCCESS; |
| 304 | |
| 305 | do_tracepoint(DotNETRuntime, |
| 306 | GCCreateSegment, |
| 307 | Address, |
| 308 | Size, |
| 309 | Type); |
| 310 | |
| 311 | return ERROR_SUCCESS; |
| 312 | } |
| 313 | |
| 314 | extern "C" BOOL EventXplatEnabledGCCreateSegment_V1(){ return tracepoint_enabled(DotNETRuntime, GCCreateSegment_V1); } |
| 315 | |
| 316 | extern "C" ULONG FireEtXplatGCCreateSegment_V1( |
| 317 | const unsigned __int64 Address, |
| 318 | const unsigned __int64 Size, |
| 319 | const unsigned int Type, |
| 320 | const unsigned short ClrInstanceID) |
| 321 | { |
| 322 | if (!EventXplatEnabledGCCreateSegment_V1()) |
| 323 | return ERROR_SUCCESS; |
| 324 | |
| 325 | do_tracepoint(DotNETRuntime, |
| 326 | GCCreateSegment_V1, |
| 327 | Address, |
| 328 | Size, |
| 329 | Type, |
| 330 | ClrInstanceID); |
| 331 | |
| 332 | return ERROR_SUCCESS; |
| 333 | } |
| 334 | |
| 335 | extern "C" BOOL EventXplatEnabledGCFreeSegment(){ return tracepoint_enabled(DotNETRuntime, GCFreeSegment); } |
| 336 | |
| 337 | extern "C" ULONG FireEtXplatGCFreeSegment( |
| 338 | const unsigned __int64 Address) |
| 339 | { |
| 340 | if (!EventXplatEnabledGCFreeSegment()) |
| 341 | return ERROR_SUCCESS; |
| 342 | |
| 343 | do_tracepoint(DotNETRuntime, |
| 344 | GCFreeSegment, |
| 345 | Address); |
| 346 | |
| 347 | return ERROR_SUCCESS; |
| 348 | } |
| 349 | |
| 350 | extern "C" BOOL EventXplatEnabledGCFreeSegment_V1(){ return tracepoint_enabled(DotNETRuntime, GCFreeSegment_V1); } |
| 351 | |
| 352 | extern "C" ULONG FireEtXplatGCFreeSegment_V1( |
| 353 | const unsigned __int64 Address, |
| 354 | const unsigned short ClrInstanceID) |
| 355 | { |
| 356 | if (!EventXplatEnabledGCFreeSegment_V1()) |
| 357 | return ERROR_SUCCESS; |
| 358 | |
| 359 | do_tracepoint(DotNETRuntime, |
| 360 | GCFreeSegment_V1, |
| 361 | Address, |
| 362 | ClrInstanceID); |
| 363 | |
| 364 | return ERROR_SUCCESS; |
| 365 | } |
| 366 | |
| 367 | extern "C" BOOL EventXplatEnabledGCRestartEEBegin(){ return tracepoint_enabled(DotNETRuntime, GCRestartEEBegin); } |
| 368 | |
| 369 | extern "C" ULONG FireEtXplatGCRestartEEBegin( |
| 370 | ) |
| 371 | { |
| 372 | if (!EventXplatEnabledGCRestartEEBegin()) |
| 373 | return ERROR_SUCCESS; |
| 374 | |
| 375 | do_tracepoint(DotNETRuntime, GCRestartEEBegin); |
| 376 | |
| 377 | return ERROR_SUCCESS; |
| 378 | } |
| 379 | |
| 380 | extern "C" BOOL EventXplatEnabledGCRestartEEBegin_V1(){ return tracepoint_enabled(DotNETRuntime, GCRestartEEBegin_V1); } |
| 381 | |
| 382 | extern "C" ULONG FireEtXplatGCRestartEEBegin_V1( |
| 383 | const unsigned short ClrInstanceID) |
| 384 | { |
| 385 | if (!EventXplatEnabledGCRestartEEBegin_V1()) |
| 386 | return ERROR_SUCCESS; |
| 387 | |
| 388 | do_tracepoint(DotNETRuntime, |
| 389 | GCRestartEEBegin_V1, |
| 390 | ClrInstanceID); |
| 391 | |
| 392 | return ERROR_SUCCESS; |
| 393 | } |
| 394 | |
| 395 | extern "C" BOOL EventXplatEnabledGCSuspendEEEnd(){ return tracepoint_enabled(DotNETRuntime, GCSuspendEEEnd); } |
| 396 | |
| 397 | extern "C" ULONG FireEtXplatGCSuspendEEEnd( |
| 398 | ) |
| 399 | { |
| 400 | if (!EventXplatEnabledGCSuspendEEEnd()) |
| 401 | return ERROR_SUCCESS; |
| 402 | |
| 403 | do_tracepoint(DotNETRuntime, GCSuspendEEEnd); |
| 404 | |
| 405 | return ERROR_SUCCESS; |
| 406 | } |
| 407 | |
| 408 | extern "C" BOOL EventXplatEnabledGCSuspendEEEnd_V1(){ return tracepoint_enabled(DotNETRuntime, GCSuspendEEEnd_V1); } |
| 409 | |
| 410 | extern "C" ULONG FireEtXplatGCSuspendEEEnd_V1( |
| 411 | const unsigned short ClrInstanceID) |
| 412 | { |
| 413 | if (!EventXplatEnabledGCSuspendEEEnd_V1()) |
| 414 | return ERROR_SUCCESS; |
| 415 | |
| 416 | do_tracepoint(DotNETRuntime, |
| 417 | GCSuspendEEEnd_V1, |
| 418 | ClrInstanceID); |
| 419 | |
| 420 | return ERROR_SUCCESS; |
| 421 | } |
| 422 | |
| 423 | extern "C" BOOL EventXplatEnabledGCSuspendEEBegin(){ return tracepoint_enabled(DotNETRuntime, GCSuspendEEBegin); } |
| 424 | |
| 425 | extern "C" ULONG FireEtXplatGCSuspendEEBegin( |
| 426 | const unsigned short Reason) |
| 427 | { |
| 428 | if (!EventXplatEnabledGCSuspendEEBegin()) |
| 429 | return ERROR_SUCCESS; |
| 430 | |
| 431 | do_tracepoint(DotNETRuntime, |
| 432 | GCSuspendEEBegin, |
| 433 | Reason); |
| 434 | |
| 435 | return ERROR_SUCCESS; |
| 436 | } |
| 437 | |
| 438 | extern "C" BOOL EventXplatEnabledGCSuspendEEBegin_V1(){ return tracepoint_enabled(DotNETRuntime, GCSuspendEEBegin_V1); } |
| 439 | |
| 440 | extern "C" ULONG FireEtXplatGCSuspendEEBegin_V1( |
| 441 | const unsigned int Reason, |
| 442 | const unsigned int Count, |
| 443 | const unsigned short ClrInstanceID) |
| 444 | { |
| 445 | if (!EventXplatEnabledGCSuspendEEBegin_V1()) |
| 446 | return ERROR_SUCCESS; |
| 447 | |
| 448 | do_tracepoint(DotNETRuntime, |
| 449 | GCSuspendEEBegin_V1, |
| 450 | Reason, |
| 451 | Count, |
| 452 | ClrInstanceID); |
| 453 | |
| 454 | return ERROR_SUCCESS; |
| 455 | } |
| 456 | |
| 457 | extern "C" BOOL EventXplatEnabledGCAllocationTick(){ return tracepoint_enabled(DotNETRuntime, GCAllocationTick); } |
| 458 | |
| 459 | extern "C" ULONG FireEtXplatGCAllocationTick( |
| 460 | const unsigned int AllocationAmount, |
| 461 | const unsigned int AllocationKind) |
| 462 | { |
| 463 | if (!EventXplatEnabledGCAllocationTick()) |
| 464 | return ERROR_SUCCESS; |
| 465 | |
| 466 | do_tracepoint(DotNETRuntime, |
| 467 | GCAllocationTick, |
| 468 | AllocationAmount, |
| 469 | AllocationKind); |
| 470 | |
| 471 | return ERROR_SUCCESS; |
| 472 | } |
| 473 | |
| 474 | extern "C" BOOL EventXplatEnabledGCAllocationTick_V1(){ return tracepoint_enabled(DotNETRuntime, GCAllocationTick_V1); } |
| 475 | |
| 476 | extern "C" ULONG FireEtXplatGCAllocationTick_V1( |
| 477 | const unsigned int AllocationAmount, |
| 478 | const unsigned int AllocationKind, |
| 479 | const unsigned short ClrInstanceID) |
| 480 | { |
| 481 | if (!EventXplatEnabledGCAllocationTick_V1()) |
| 482 | return ERROR_SUCCESS; |
| 483 | |
| 484 | do_tracepoint(DotNETRuntime, |
| 485 | GCAllocationTick_V1, |
| 486 | AllocationAmount, |
| 487 | AllocationKind, |
| 488 | ClrInstanceID); |
| 489 | |
| 490 | return ERROR_SUCCESS; |
| 491 | } |
| 492 | |
| 493 | extern "C" BOOL EventXplatEnabledGCAllocationTick_V2(){ return tracepoint_enabled(DotNETRuntime, GCAllocationTick_V2); } |
| 494 | |
| 495 | extern "C" ULONG FireEtXplatGCAllocationTick_V2( |
| 496 | const unsigned int AllocationAmount, |
| 497 | const unsigned int AllocationKind, |
| 498 | const unsigned short ClrInstanceID, |
| 499 | const unsigned __int64 AllocationAmount64, |
| 500 | const void* TypeID, |
| 501 | PCWSTR TypeName, |
| 502 | const unsigned int HeapIndex) |
| 503 | { |
| 504 | if (!EventXplatEnabledGCAllocationTick_V2()) |
| 505 | return ERROR_SUCCESS; |
| 506 | INT TypeName_path_size = -1; |
| 507 | PathCharString TypeName_PS; |
| 508 | INT TypeName_full_name_path_size = (wcslen(TypeName) + 1)*sizeof(WCHAR); |
| 509 | CHAR* TypeName_full_name = TypeName_PS.OpenStringBuffer(TypeName_full_name_path_size ); |
| 510 | if (TypeName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 511 | |
| 512 | TypeName_path_size = WideCharToMultiByte( CP_ACP, 0, TypeName, -1, TypeName_full_name, TypeName_full_name_path_size, NULL, NULL ); |
| 513 | _ASSERTE(TypeName_path_size < TypeName_full_name_path_size ); |
| 514 | TypeName_PS.CloseBuffer(TypeName_path_size ); |
| 515 | if( TypeName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 516 | do_tracepoint(DotNETRuntime, |
| 517 | GCAllocationTick_V2, |
| 518 | AllocationAmount, |
| 519 | AllocationKind, |
| 520 | ClrInstanceID, |
| 521 | AllocationAmount64, |
| 522 | (const size_t) TypeID, |
| 523 | TypeName_full_name, |
| 524 | HeapIndex); |
| 525 | |
| 526 | return ERROR_SUCCESS; |
| 527 | } |
| 528 | |
| 529 | extern "C" BOOL EventXplatEnabledGCAllocationTick_V3(){ return tracepoint_enabled(DotNETRuntime, GCAllocationTick_V3); } |
| 530 | |
| 531 | extern "C" ULONG FireEtXplatGCAllocationTick_V3( |
| 532 | const unsigned int AllocationAmount, |
| 533 | const unsigned int AllocationKind, |
| 534 | const unsigned short ClrInstanceID, |
| 535 | const unsigned __int64 AllocationAmount64, |
| 536 | const void* TypeID, |
| 537 | PCWSTR TypeName, |
| 538 | const unsigned int HeapIndex, |
| 539 | const void* Address) |
| 540 | { |
| 541 | if (!EventXplatEnabledGCAllocationTick_V3()) |
| 542 | return ERROR_SUCCESS; |
| 543 | INT TypeName_path_size = -1; |
| 544 | PathCharString TypeName_PS; |
| 545 | INT TypeName_full_name_path_size = (wcslen(TypeName) + 1)*sizeof(WCHAR); |
| 546 | CHAR* TypeName_full_name = TypeName_PS.OpenStringBuffer(TypeName_full_name_path_size ); |
| 547 | if (TypeName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 548 | |
| 549 | TypeName_path_size = WideCharToMultiByte( CP_ACP, 0, TypeName, -1, TypeName_full_name, TypeName_full_name_path_size, NULL, NULL ); |
| 550 | _ASSERTE(TypeName_path_size < TypeName_full_name_path_size ); |
| 551 | TypeName_PS.CloseBuffer(TypeName_path_size ); |
| 552 | if( TypeName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 553 | do_tracepoint(DotNETRuntime, |
| 554 | GCAllocationTick_V3, |
| 555 | AllocationAmount, |
| 556 | AllocationKind, |
| 557 | ClrInstanceID, |
| 558 | AllocationAmount64, |
| 559 | (const size_t) TypeID, |
| 560 | TypeName_full_name, |
| 561 | HeapIndex, |
| 562 | (const size_t) Address); |
| 563 | |
| 564 | return ERROR_SUCCESS; |
| 565 | } |
| 566 | |
| 567 | extern "C" BOOL EventXplatEnabledGCCreateConcurrentThread(){ return tracepoint_enabled(DotNETRuntime, GCCreateConcurrentThread); } |
| 568 | |
| 569 | extern "C" ULONG FireEtXplatGCCreateConcurrentThread( |
| 570 | ) |
| 571 | { |
| 572 | if (!EventXplatEnabledGCCreateConcurrentThread()) |
| 573 | return ERROR_SUCCESS; |
| 574 | |
| 575 | do_tracepoint(DotNETRuntime, GCCreateConcurrentThread); |
| 576 | |
| 577 | return ERROR_SUCCESS; |
| 578 | } |
| 579 | |
| 580 | extern "C" BOOL EventXplatEnabledGCCreateConcurrentThread_V1(){ return tracepoint_enabled(DotNETRuntime, GCCreateConcurrentThread_V1); } |
| 581 | |
| 582 | extern "C" ULONG FireEtXplatGCCreateConcurrentThread_V1( |
| 583 | const unsigned short ClrInstanceID) |
| 584 | { |
| 585 | if (!EventXplatEnabledGCCreateConcurrentThread_V1()) |
| 586 | return ERROR_SUCCESS; |
| 587 | |
| 588 | do_tracepoint(DotNETRuntime, |
| 589 | GCCreateConcurrentThread_V1, |
| 590 | ClrInstanceID); |
| 591 | |
| 592 | return ERROR_SUCCESS; |
| 593 | } |
| 594 | |
| 595 | extern "C" BOOL EventXplatEnabledGCTerminateConcurrentThread(){ return tracepoint_enabled(DotNETRuntime, GCTerminateConcurrentThread); } |
| 596 | |
| 597 | extern "C" ULONG FireEtXplatGCTerminateConcurrentThread( |
| 598 | ) |
| 599 | { |
| 600 | if (!EventXplatEnabledGCTerminateConcurrentThread()) |
| 601 | return ERROR_SUCCESS; |
| 602 | |
| 603 | do_tracepoint(DotNETRuntime, GCTerminateConcurrentThread); |
| 604 | |
| 605 | return ERROR_SUCCESS; |
| 606 | } |
| 607 | |
| 608 | extern "C" BOOL EventXplatEnabledGCTerminateConcurrentThread_V1(){ return tracepoint_enabled(DotNETRuntime, GCTerminateConcurrentThread_V1); } |
| 609 | |
| 610 | extern "C" ULONG FireEtXplatGCTerminateConcurrentThread_V1( |
| 611 | const unsigned short ClrInstanceID) |
| 612 | { |
| 613 | if (!EventXplatEnabledGCTerminateConcurrentThread_V1()) |
| 614 | return ERROR_SUCCESS; |
| 615 | |
| 616 | do_tracepoint(DotNETRuntime, |
| 617 | GCTerminateConcurrentThread_V1, |
| 618 | ClrInstanceID); |
| 619 | |
| 620 | return ERROR_SUCCESS; |
| 621 | } |
| 622 | |
| 623 | extern "C" BOOL EventXplatEnabledGCFinalizersEnd(){ return tracepoint_enabled(DotNETRuntime, GCFinalizersEnd); } |
| 624 | |
| 625 | extern "C" ULONG FireEtXplatGCFinalizersEnd( |
| 626 | const unsigned int Count) |
| 627 | { |
| 628 | if (!EventXplatEnabledGCFinalizersEnd()) |
| 629 | return ERROR_SUCCESS; |
| 630 | |
| 631 | do_tracepoint(DotNETRuntime, |
| 632 | GCFinalizersEnd, |
| 633 | Count); |
| 634 | |
| 635 | return ERROR_SUCCESS; |
| 636 | } |
| 637 | |
| 638 | extern "C" BOOL EventXplatEnabledGCFinalizersEnd_V1(){ return tracepoint_enabled(DotNETRuntime, GCFinalizersEnd_V1); } |
| 639 | |
| 640 | extern "C" ULONG FireEtXplatGCFinalizersEnd_V1( |
| 641 | const unsigned int Count, |
| 642 | const unsigned short ClrInstanceID) |
| 643 | { |
| 644 | if (!EventXplatEnabledGCFinalizersEnd_V1()) |
| 645 | return ERROR_SUCCESS; |
| 646 | |
| 647 | do_tracepoint(DotNETRuntime, |
| 648 | GCFinalizersEnd_V1, |
| 649 | Count, |
| 650 | ClrInstanceID); |
| 651 | |
| 652 | return ERROR_SUCCESS; |
| 653 | } |
| 654 | |
| 655 | extern "C" BOOL EventXplatEnabledGCFinalizersBegin(){ return tracepoint_enabled(DotNETRuntime, GCFinalizersBegin); } |
| 656 | |
| 657 | extern "C" ULONG FireEtXplatGCFinalizersBegin( |
| 658 | ) |
| 659 | { |
| 660 | if (!EventXplatEnabledGCFinalizersBegin()) |
| 661 | return ERROR_SUCCESS; |
| 662 | |
| 663 | do_tracepoint(DotNETRuntime, GCFinalizersBegin); |
| 664 | |
| 665 | return ERROR_SUCCESS; |
| 666 | } |
| 667 | |
| 668 | extern "C" BOOL EventXplatEnabledGCFinalizersBegin_V1(){ return tracepoint_enabled(DotNETRuntime, GCFinalizersBegin_V1); } |
| 669 | |
| 670 | extern "C" ULONG FireEtXplatGCFinalizersBegin_V1( |
| 671 | const unsigned short ClrInstanceID) |
| 672 | { |
| 673 | if (!EventXplatEnabledGCFinalizersBegin_V1()) |
| 674 | return ERROR_SUCCESS; |
| 675 | |
| 676 | do_tracepoint(DotNETRuntime, |
| 677 | GCFinalizersBegin_V1, |
| 678 | ClrInstanceID); |
| 679 | |
| 680 | return ERROR_SUCCESS; |
| 681 | } |
| 682 | |
| 683 | extern "C" BOOL EventXplatEnabledBulkType(){ return tracepoint_enabled(DotNETRuntime, BulkType); } |
| 684 | |
| 685 | extern "C" ULONG FireEtXplatBulkType( |
| 686 | const unsigned int Count, |
| 687 | const unsigned short ClrInstanceID, |
| 688 | int Values_ElementSize, |
| 689 | const void* Values) |
| 690 | { |
| 691 | if (!EventXplatEnabledBulkType()) |
| 692 | return ERROR_SUCCESS; |
| 693 | |
| 694 | char stackBuffer[38]; |
| 695 | char *buffer = stackBuffer; |
| 696 | size_t offset = 0; |
| 697 | size_t size = 38; |
| 698 | bool fixedBuffer = true; |
| 699 | |
| 700 | bool success = true; |
| 701 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 702 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 703 | success &= WriteToBuffer((const BYTE *)Values, (int)(Values_ElementSize), buffer, offset, size, fixedBuffer); |
| 704 | |
| 705 | if (!success) |
| 706 | { |
| 707 | if (!fixedBuffer) |
| 708 | delete[] buffer; |
| 709 | return ERROR_WRITE_FAULT; |
| 710 | } |
| 711 | |
| 712 | do_tracepoint(DotNETRuntime, BulkType, offset, buffer); |
| 713 | |
| 714 | if (!fixedBuffer) |
| 715 | delete[] buffer; |
| 716 | |
| 717 | return ERROR_SUCCESS; |
| 718 | } |
| 719 | |
| 720 | extern "C" BOOL EventXplatEnabledGCBulkRootEdge(){ return tracepoint_enabled(DotNETRuntime, GCBulkRootEdge); } |
| 721 | |
| 722 | extern "C" ULONG FireEtXplatGCBulkRootEdge( |
| 723 | const unsigned int Index, |
| 724 | const unsigned int Count, |
| 725 | const unsigned short ClrInstanceID, |
| 726 | int Values_ElementSize, |
| 727 | const void* Values) |
| 728 | { |
| 729 | if (!EventXplatEnabledGCBulkRootEdge()) |
| 730 | return ERROR_SUCCESS; |
| 731 | |
| 732 | char stackBuffer[42]; |
| 733 | char *buffer = stackBuffer; |
| 734 | size_t offset = 0; |
| 735 | size_t size = 42; |
| 736 | bool fixedBuffer = true; |
| 737 | |
| 738 | bool success = true; |
| 739 | success &= WriteToBuffer(Index, buffer, offset, size, fixedBuffer); |
| 740 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 741 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 742 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 743 | |
| 744 | if (!success) |
| 745 | { |
| 746 | if (!fixedBuffer) |
| 747 | delete[] buffer; |
| 748 | return ERROR_WRITE_FAULT; |
| 749 | } |
| 750 | |
| 751 | do_tracepoint(DotNETRuntime, GCBulkRootEdge, offset, buffer); |
| 752 | |
| 753 | if (!fixedBuffer) |
| 754 | delete[] buffer; |
| 755 | |
| 756 | return ERROR_SUCCESS; |
| 757 | } |
| 758 | |
| 759 | extern "C" BOOL EventXplatEnabledGCBulkRootConditionalWeakTableElementEdge(){ return tracepoint_enabled(DotNETRuntime, GCBulkRootConditionalWeakTableElementEdge); } |
| 760 | |
| 761 | extern "C" ULONG FireEtXplatGCBulkRootConditionalWeakTableElementEdge( |
| 762 | const unsigned int Index, |
| 763 | const unsigned int Count, |
| 764 | const unsigned short ClrInstanceID, |
| 765 | int Values_ElementSize, |
| 766 | const void* Values) |
| 767 | { |
| 768 | if (!EventXplatEnabledGCBulkRootConditionalWeakTableElementEdge()) |
| 769 | return ERROR_SUCCESS; |
| 770 | |
| 771 | char stackBuffer[42]; |
| 772 | char *buffer = stackBuffer; |
| 773 | size_t offset = 0; |
| 774 | size_t size = 42; |
| 775 | bool fixedBuffer = true; |
| 776 | |
| 777 | bool success = true; |
| 778 | success &= WriteToBuffer(Index, buffer, offset, size, fixedBuffer); |
| 779 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 780 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 781 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 782 | |
| 783 | if (!success) |
| 784 | { |
| 785 | if (!fixedBuffer) |
| 786 | delete[] buffer; |
| 787 | return ERROR_WRITE_FAULT; |
| 788 | } |
| 789 | |
| 790 | do_tracepoint(DotNETRuntime, GCBulkRootConditionalWeakTableElementEdge, offset, buffer); |
| 791 | |
| 792 | if (!fixedBuffer) |
| 793 | delete[] buffer; |
| 794 | |
| 795 | return ERROR_SUCCESS; |
| 796 | } |
| 797 | |
| 798 | extern "C" BOOL EventXplatEnabledGCBulkNode(){ return tracepoint_enabled(DotNETRuntime, GCBulkNode); } |
| 799 | |
| 800 | extern "C" ULONG FireEtXplatGCBulkNode( |
| 801 | const unsigned int Index, |
| 802 | const unsigned int Count, |
| 803 | const unsigned short ClrInstanceID, |
| 804 | int Values_ElementSize, |
| 805 | const void* Values) |
| 806 | { |
| 807 | if (!EventXplatEnabledGCBulkNode()) |
| 808 | return ERROR_SUCCESS; |
| 809 | |
| 810 | char stackBuffer[42]; |
| 811 | char *buffer = stackBuffer; |
| 812 | size_t offset = 0; |
| 813 | size_t size = 42; |
| 814 | bool fixedBuffer = true; |
| 815 | |
| 816 | bool success = true; |
| 817 | success &= WriteToBuffer(Index, buffer, offset, size, fixedBuffer); |
| 818 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 819 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 820 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 821 | |
| 822 | if (!success) |
| 823 | { |
| 824 | if (!fixedBuffer) |
| 825 | delete[] buffer; |
| 826 | return ERROR_WRITE_FAULT; |
| 827 | } |
| 828 | |
| 829 | do_tracepoint(DotNETRuntime, GCBulkNode, offset, buffer); |
| 830 | |
| 831 | if (!fixedBuffer) |
| 832 | delete[] buffer; |
| 833 | |
| 834 | return ERROR_SUCCESS; |
| 835 | } |
| 836 | |
| 837 | extern "C" BOOL EventXplatEnabledGCBulkEdge(){ return tracepoint_enabled(DotNETRuntime, GCBulkEdge); } |
| 838 | |
| 839 | extern "C" ULONG FireEtXplatGCBulkEdge( |
| 840 | const unsigned int Index, |
| 841 | const unsigned int Count, |
| 842 | const unsigned short ClrInstanceID, |
| 843 | int Values_ElementSize, |
| 844 | const void* Values) |
| 845 | { |
| 846 | if (!EventXplatEnabledGCBulkEdge()) |
| 847 | return ERROR_SUCCESS; |
| 848 | |
| 849 | char stackBuffer[42]; |
| 850 | char *buffer = stackBuffer; |
| 851 | size_t offset = 0; |
| 852 | size_t size = 42; |
| 853 | bool fixedBuffer = true; |
| 854 | |
| 855 | bool success = true; |
| 856 | success &= WriteToBuffer(Index, buffer, offset, size, fixedBuffer); |
| 857 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 858 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 859 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 860 | |
| 861 | if (!success) |
| 862 | { |
| 863 | if (!fixedBuffer) |
| 864 | delete[] buffer; |
| 865 | return ERROR_WRITE_FAULT; |
| 866 | } |
| 867 | |
| 868 | do_tracepoint(DotNETRuntime, GCBulkEdge, offset, buffer); |
| 869 | |
| 870 | if (!fixedBuffer) |
| 871 | delete[] buffer; |
| 872 | |
| 873 | return ERROR_SUCCESS; |
| 874 | } |
| 875 | |
| 876 | extern "C" BOOL EventXplatEnabledGCSampledObjectAllocationHigh(){ return tracepoint_enabled(DotNETRuntime, GCSampledObjectAllocationHigh); } |
| 877 | |
| 878 | extern "C" ULONG FireEtXplatGCSampledObjectAllocationHigh( |
| 879 | const void* Address, |
| 880 | const void* TypeID, |
| 881 | const unsigned int ObjectCountForTypeSample, |
| 882 | const unsigned __int64 TotalSizeForTypeSample, |
| 883 | const unsigned short ClrInstanceID) |
| 884 | { |
| 885 | if (!EventXplatEnabledGCSampledObjectAllocationHigh()) |
| 886 | return ERROR_SUCCESS; |
| 887 | |
| 888 | do_tracepoint(DotNETRuntime, |
| 889 | GCSampledObjectAllocationHigh, |
| 890 | (const size_t) Address, |
| 891 | (const size_t) TypeID, |
| 892 | ObjectCountForTypeSample, |
| 893 | TotalSizeForTypeSample, |
| 894 | ClrInstanceID); |
| 895 | |
| 896 | return ERROR_SUCCESS; |
| 897 | } |
| 898 | |
| 899 | extern "C" BOOL EventXplatEnabledGCBulkSurvivingObjectRanges(){ return tracepoint_enabled(DotNETRuntime, GCBulkSurvivingObjectRanges); } |
| 900 | |
| 901 | extern "C" ULONG FireEtXplatGCBulkSurvivingObjectRanges( |
| 902 | const unsigned int Index, |
| 903 | const unsigned int Count, |
| 904 | const unsigned short ClrInstanceID, |
| 905 | int Values_ElementSize, |
| 906 | const void* Values) |
| 907 | { |
| 908 | if (!EventXplatEnabledGCBulkSurvivingObjectRanges()) |
| 909 | return ERROR_SUCCESS; |
| 910 | |
| 911 | char stackBuffer[42]; |
| 912 | char *buffer = stackBuffer; |
| 913 | size_t offset = 0; |
| 914 | size_t size = 42; |
| 915 | bool fixedBuffer = true; |
| 916 | |
| 917 | bool success = true; |
| 918 | success &= WriteToBuffer(Index, buffer, offset, size, fixedBuffer); |
| 919 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 920 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 921 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 922 | |
| 923 | if (!success) |
| 924 | { |
| 925 | if (!fixedBuffer) |
| 926 | delete[] buffer; |
| 927 | return ERROR_WRITE_FAULT; |
| 928 | } |
| 929 | |
| 930 | do_tracepoint(DotNETRuntime, GCBulkSurvivingObjectRanges, offset, buffer); |
| 931 | |
| 932 | if (!fixedBuffer) |
| 933 | delete[] buffer; |
| 934 | |
| 935 | return ERROR_SUCCESS; |
| 936 | } |
| 937 | |
| 938 | extern "C" BOOL EventXplatEnabledGCBulkMovedObjectRanges(){ return tracepoint_enabled(DotNETRuntime, GCBulkMovedObjectRanges); } |
| 939 | |
| 940 | extern "C" ULONG FireEtXplatGCBulkMovedObjectRanges( |
| 941 | const unsigned int Index, |
| 942 | const unsigned int Count, |
| 943 | const unsigned short ClrInstanceID, |
| 944 | int Values_ElementSize, |
| 945 | const void* Values) |
| 946 | { |
| 947 | if (!EventXplatEnabledGCBulkMovedObjectRanges()) |
| 948 | return ERROR_SUCCESS; |
| 949 | |
| 950 | char stackBuffer[42]; |
| 951 | char *buffer = stackBuffer; |
| 952 | size_t offset = 0; |
| 953 | size_t size = 42; |
| 954 | bool fixedBuffer = true; |
| 955 | |
| 956 | bool success = true; |
| 957 | success &= WriteToBuffer(Index, buffer, offset, size, fixedBuffer); |
| 958 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 959 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 960 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 961 | |
| 962 | if (!success) |
| 963 | { |
| 964 | if (!fixedBuffer) |
| 965 | delete[] buffer; |
| 966 | return ERROR_WRITE_FAULT; |
| 967 | } |
| 968 | |
| 969 | do_tracepoint(DotNETRuntime, GCBulkMovedObjectRanges, offset, buffer); |
| 970 | |
| 971 | if (!fixedBuffer) |
| 972 | delete[] buffer; |
| 973 | |
| 974 | return ERROR_SUCCESS; |
| 975 | } |
| 976 | |
| 977 | extern "C" BOOL EventXplatEnabledGCGenerationRange(){ return tracepoint_enabled(DotNETRuntime, GCGenerationRange); } |
| 978 | |
| 979 | extern "C" ULONG FireEtXplatGCGenerationRange( |
| 980 | const unsigned char Generation, |
| 981 | const void* RangeStart, |
| 982 | const unsigned __int64 RangeUsedLength, |
| 983 | const unsigned __int64 RangeReservedLength, |
| 984 | const unsigned short ClrInstanceID) |
| 985 | { |
| 986 | if (!EventXplatEnabledGCGenerationRange()) |
| 987 | return ERROR_SUCCESS; |
| 988 | |
| 989 | do_tracepoint(DotNETRuntime, |
| 990 | GCGenerationRange, |
| 991 | Generation, |
| 992 | (const size_t) RangeStart, |
| 993 | RangeUsedLength, |
| 994 | RangeReservedLength, |
| 995 | ClrInstanceID); |
| 996 | |
| 997 | return ERROR_SUCCESS; |
| 998 | } |
| 999 | |
| 1000 | extern "C" BOOL EventXplatEnabledGCMarkStackRoots(){ return tracepoint_enabled(DotNETRuntime, GCMarkStackRoots); } |
| 1001 | |
| 1002 | extern "C" ULONG FireEtXplatGCMarkStackRoots( |
| 1003 | const unsigned int HeapNum, |
| 1004 | const unsigned short ClrInstanceID) |
| 1005 | { |
| 1006 | if (!EventXplatEnabledGCMarkStackRoots()) |
| 1007 | return ERROR_SUCCESS; |
| 1008 | |
| 1009 | do_tracepoint(DotNETRuntime, |
| 1010 | GCMarkStackRoots, |
| 1011 | HeapNum, |
| 1012 | ClrInstanceID); |
| 1013 | |
| 1014 | return ERROR_SUCCESS; |
| 1015 | } |
| 1016 | |
| 1017 | extern "C" BOOL EventXplatEnabledGCMarkFinalizeQueueRoots(){ return tracepoint_enabled(DotNETRuntime, GCMarkFinalizeQueueRoots); } |
| 1018 | |
| 1019 | extern "C" ULONG FireEtXplatGCMarkFinalizeQueueRoots( |
| 1020 | const unsigned int HeapNum, |
| 1021 | const unsigned short ClrInstanceID) |
| 1022 | { |
| 1023 | if (!EventXplatEnabledGCMarkFinalizeQueueRoots()) |
| 1024 | return ERROR_SUCCESS; |
| 1025 | |
| 1026 | do_tracepoint(DotNETRuntime, |
| 1027 | GCMarkFinalizeQueueRoots, |
| 1028 | HeapNum, |
| 1029 | ClrInstanceID); |
| 1030 | |
| 1031 | return ERROR_SUCCESS; |
| 1032 | } |
| 1033 | |
| 1034 | extern "C" BOOL EventXplatEnabledGCMarkHandles(){ return tracepoint_enabled(DotNETRuntime, GCMarkHandles); } |
| 1035 | |
| 1036 | extern "C" ULONG FireEtXplatGCMarkHandles( |
| 1037 | const unsigned int HeapNum, |
| 1038 | const unsigned short ClrInstanceID) |
| 1039 | { |
| 1040 | if (!EventXplatEnabledGCMarkHandles()) |
| 1041 | return ERROR_SUCCESS; |
| 1042 | |
| 1043 | do_tracepoint(DotNETRuntime, |
| 1044 | GCMarkHandles, |
| 1045 | HeapNum, |
| 1046 | ClrInstanceID); |
| 1047 | |
| 1048 | return ERROR_SUCCESS; |
| 1049 | } |
| 1050 | |
| 1051 | extern "C" BOOL EventXplatEnabledGCMarkOlderGenerationRoots(){ return tracepoint_enabled(DotNETRuntime, GCMarkOlderGenerationRoots); } |
| 1052 | |
| 1053 | extern "C" ULONG FireEtXplatGCMarkOlderGenerationRoots( |
| 1054 | const unsigned int HeapNum, |
| 1055 | const unsigned short ClrInstanceID) |
| 1056 | { |
| 1057 | if (!EventXplatEnabledGCMarkOlderGenerationRoots()) |
| 1058 | return ERROR_SUCCESS; |
| 1059 | |
| 1060 | do_tracepoint(DotNETRuntime, |
| 1061 | GCMarkOlderGenerationRoots, |
| 1062 | HeapNum, |
| 1063 | ClrInstanceID); |
| 1064 | |
| 1065 | return ERROR_SUCCESS; |
| 1066 | } |
| 1067 | |
| 1068 | extern "C" BOOL EventXplatEnabledFinalizeObject(){ return tracepoint_enabled(DotNETRuntime, FinalizeObject); } |
| 1069 | |
| 1070 | extern "C" ULONG FireEtXplatFinalizeObject( |
| 1071 | const void* TypeID, |
| 1072 | const void* ObjectID, |
| 1073 | const unsigned short ClrInstanceID) |
| 1074 | { |
| 1075 | if (!EventXplatEnabledFinalizeObject()) |
| 1076 | return ERROR_SUCCESS; |
| 1077 | |
| 1078 | do_tracepoint(DotNETRuntime, |
| 1079 | FinalizeObject, |
| 1080 | (const size_t) TypeID, |
| 1081 | (const size_t) ObjectID, |
| 1082 | ClrInstanceID); |
| 1083 | |
| 1084 | return ERROR_SUCCESS; |
| 1085 | } |
| 1086 | |
| 1087 | extern "C" BOOL EventXplatEnabledSetGCHandle(){ return tracepoint_enabled(DotNETRuntime, SetGCHandle); } |
| 1088 | |
| 1089 | extern "C" ULONG FireEtXplatSetGCHandle( |
| 1090 | const void* HandleID, |
| 1091 | const void* ObjectID, |
| 1092 | const unsigned int Kind, |
| 1093 | const unsigned int Generation, |
| 1094 | const unsigned __int64 AppDomainID, |
| 1095 | const unsigned short ClrInstanceID) |
| 1096 | { |
| 1097 | if (!EventXplatEnabledSetGCHandle()) |
| 1098 | return ERROR_SUCCESS; |
| 1099 | |
| 1100 | do_tracepoint(DotNETRuntime, |
| 1101 | SetGCHandle, |
| 1102 | (const size_t) HandleID, |
| 1103 | (const size_t) ObjectID, |
| 1104 | Kind, |
| 1105 | Generation, |
| 1106 | AppDomainID, |
| 1107 | ClrInstanceID); |
| 1108 | |
| 1109 | return ERROR_SUCCESS; |
| 1110 | } |
| 1111 | |
| 1112 | extern "C" BOOL EventXplatEnabledDestroyGCHandle(){ return tracepoint_enabled(DotNETRuntime, DestroyGCHandle); } |
| 1113 | |
| 1114 | extern "C" ULONG FireEtXplatDestroyGCHandle( |
| 1115 | const void* HandleID, |
| 1116 | const unsigned short ClrInstanceID) |
| 1117 | { |
| 1118 | if (!EventXplatEnabledDestroyGCHandle()) |
| 1119 | return ERROR_SUCCESS; |
| 1120 | |
| 1121 | do_tracepoint(DotNETRuntime, |
| 1122 | DestroyGCHandle, |
| 1123 | (const size_t) HandleID, |
| 1124 | ClrInstanceID); |
| 1125 | |
| 1126 | return ERROR_SUCCESS; |
| 1127 | } |
| 1128 | |
| 1129 | extern "C" BOOL EventXplatEnabledGCSampledObjectAllocationLow(){ return tracepoint_enabled(DotNETRuntime, GCSampledObjectAllocationLow); } |
| 1130 | |
| 1131 | extern "C" ULONG FireEtXplatGCSampledObjectAllocationLow( |
| 1132 | const void* Address, |
| 1133 | const void* TypeID, |
| 1134 | const unsigned int ObjectCountForTypeSample, |
| 1135 | const unsigned __int64 TotalSizeForTypeSample, |
| 1136 | const unsigned short ClrInstanceID) |
| 1137 | { |
| 1138 | if (!EventXplatEnabledGCSampledObjectAllocationLow()) |
| 1139 | return ERROR_SUCCESS; |
| 1140 | |
| 1141 | do_tracepoint(DotNETRuntime, |
| 1142 | GCSampledObjectAllocationLow, |
| 1143 | (const size_t) Address, |
| 1144 | (const size_t) TypeID, |
| 1145 | ObjectCountForTypeSample, |
| 1146 | TotalSizeForTypeSample, |
| 1147 | ClrInstanceID); |
| 1148 | |
| 1149 | return ERROR_SUCCESS; |
| 1150 | } |
| 1151 | |
| 1152 | extern "C" BOOL EventXplatEnabledPinObjectAtGCTime(){ return tracepoint_enabled(DotNETRuntime, PinObjectAtGCTime); } |
| 1153 | |
| 1154 | extern "C" ULONG FireEtXplatPinObjectAtGCTime( |
| 1155 | const void* HandleID, |
| 1156 | const void* ObjectID, |
| 1157 | const unsigned __int64 ObjectSize, |
| 1158 | PCWSTR TypeName, |
| 1159 | const unsigned short ClrInstanceID) |
| 1160 | { |
| 1161 | if (!EventXplatEnabledPinObjectAtGCTime()) |
| 1162 | return ERROR_SUCCESS; |
| 1163 | INT TypeName_path_size = -1; |
| 1164 | PathCharString TypeName_PS; |
| 1165 | INT TypeName_full_name_path_size = (wcslen(TypeName) + 1)*sizeof(WCHAR); |
| 1166 | CHAR* TypeName_full_name = TypeName_PS.OpenStringBuffer(TypeName_full_name_path_size ); |
| 1167 | if (TypeName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 1168 | |
| 1169 | TypeName_path_size = WideCharToMultiByte( CP_ACP, 0, TypeName, -1, TypeName_full_name, TypeName_full_name_path_size, NULL, NULL ); |
| 1170 | _ASSERTE(TypeName_path_size < TypeName_full_name_path_size ); |
| 1171 | TypeName_PS.CloseBuffer(TypeName_path_size ); |
| 1172 | if( TypeName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 1173 | do_tracepoint(DotNETRuntime, |
| 1174 | PinObjectAtGCTime, |
| 1175 | (const size_t) HandleID, |
| 1176 | (const size_t) ObjectID, |
| 1177 | ObjectSize, |
| 1178 | TypeName_full_name, |
| 1179 | ClrInstanceID); |
| 1180 | |
| 1181 | return ERROR_SUCCESS; |
| 1182 | } |
| 1183 | |
| 1184 | extern "C" BOOL EventXplatEnabledGCTriggered(){ return tracepoint_enabled(DotNETRuntime, GCTriggered); } |
| 1185 | |
| 1186 | extern "C" ULONG FireEtXplatGCTriggered( |
| 1187 | const unsigned int Reason, |
| 1188 | const unsigned short ClrInstanceID) |
| 1189 | { |
| 1190 | if (!EventXplatEnabledGCTriggered()) |
| 1191 | return ERROR_SUCCESS; |
| 1192 | |
| 1193 | do_tracepoint(DotNETRuntime, |
| 1194 | GCTriggered, |
| 1195 | Reason, |
| 1196 | ClrInstanceID); |
| 1197 | |
| 1198 | return ERROR_SUCCESS; |
| 1199 | } |
| 1200 | |
| 1201 | extern "C" BOOL EventXplatEnabledGCBulkRootCCW(){ return tracepoint_enabled(DotNETRuntime, GCBulkRootCCW); } |
| 1202 | |
| 1203 | extern "C" ULONG FireEtXplatGCBulkRootCCW( |
| 1204 | const unsigned int Count, |
| 1205 | const unsigned short ClrInstanceID, |
| 1206 | int Values_ElementSize, |
| 1207 | const void* Values) |
| 1208 | { |
| 1209 | if (!EventXplatEnabledGCBulkRootCCW()) |
| 1210 | return ERROR_SUCCESS; |
| 1211 | |
| 1212 | char stackBuffer[38]; |
| 1213 | char *buffer = stackBuffer; |
| 1214 | size_t offset = 0; |
| 1215 | size_t size = 38; |
| 1216 | bool fixedBuffer = true; |
| 1217 | |
| 1218 | bool success = true; |
| 1219 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 1220 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 1221 | success &= WriteToBuffer((const BYTE *)Values, (int)(Values_ElementSize), buffer, offset, size, fixedBuffer); |
| 1222 | |
| 1223 | if (!success) |
| 1224 | { |
| 1225 | if (!fixedBuffer) |
| 1226 | delete[] buffer; |
| 1227 | return ERROR_WRITE_FAULT; |
| 1228 | } |
| 1229 | |
| 1230 | do_tracepoint(DotNETRuntime, GCBulkRootCCW, offset, buffer); |
| 1231 | |
| 1232 | if (!fixedBuffer) |
| 1233 | delete[] buffer; |
| 1234 | |
| 1235 | return ERROR_SUCCESS; |
| 1236 | } |
| 1237 | |
| 1238 | extern "C" BOOL EventXplatEnabledGCBulkRCW(){ return tracepoint_enabled(DotNETRuntime, GCBulkRCW); } |
| 1239 | |
| 1240 | extern "C" ULONG FireEtXplatGCBulkRCW( |
| 1241 | const unsigned int Count, |
| 1242 | const unsigned short ClrInstanceID, |
| 1243 | int Values_ElementSize, |
| 1244 | const void* Values) |
| 1245 | { |
| 1246 | if (!EventXplatEnabledGCBulkRCW()) |
| 1247 | return ERROR_SUCCESS; |
| 1248 | |
| 1249 | char stackBuffer[38]; |
| 1250 | char *buffer = stackBuffer; |
| 1251 | size_t offset = 0; |
| 1252 | size_t size = 38; |
| 1253 | bool fixedBuffer = true; |
| 1254 | |
| 1255 | bool success = true; |
| 1256 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 1257 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 1258 | success &= WriteToBuffer((const BYTE *)Values, (int)(Values_ElementSize), buffer, offset, size, fixedBuffer); |
| 1259 | |
| 1260 | if (!success) |
| 1261 | { |
| 1262 | if (!fixedBuffer) |
| 1263 | delete[] buffer; |
| 1264 | return ERROR_WRITE_FAULT; |
| 1265 | } |
| 1266 | |
| 1267 | do_tracepoint(DotNETRuntime, GCBulkRCW, offset, buffer); |
| 1268 | |
| 1269 | if (!fixedBuffer) |
| 1270 | delete[] buffer; |
| 1271 | |
| 1272 | return ERROR_SUCCESS; |
| 1273 | } |
| 1274 | |
| 1275 | extern "C" BOOL EventXplatEnabledGCBulkRootStaticVar(){ return tracepoint_enabled(DotNETRuntime, GCBulkRootStaticVar); } |
| 1276 | |
| 1277 | extern "C" ULONG FireEtXplatGCBulkRootStaticVar( |
| 1278 | const unsigned int Count, |
| 1279 | const unsigned __int64 AppDomainID, |
| 1280 | const unsigned short ClrInstanceID, |
| 1281 | int Values_ElementSize, |
| 1282 | const void* Values) |
| 1283 | { |
| 1284 | if (!EventXplatEnabledGCBulkRootStaticVar()) |
| 1285 | return ERROR_SUCCESS; |
| 1286 | |
| 1287 | char stackBuffer[46]; |
| 1288 | char *buffer = stackBuffer; |
| 1289 | size_t offset = 0; |
| 1290 | size_t size = 46; |
| 1291 | bool fixedBuffer = true; |
| 1292 | |
| 1293 | bool success = true; |
| 1294 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 1295 | success &= WriteToBuffer(AppDomainID, buffer, offset, size, fixedBuffer); |
| 1296 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 1297 | success &= WriteToBuffer((const BYTE *)Values, (int)(Values_ElementSize), buffer, offset, size, fixedBuffer); |
| 1298 | |
| 1299 | if (!success) |
| 1300 | { |
| 1301 | if (!fixedBuffer) |
| 1302 | delete[] buffer; |
| 1303 | return ERROR_WRITE_FAULT; |
| 1304 | } |
| 1305 | |
| 1306 | do_tracepoint(DotNETRuntime, GCBulkRootStaticVar, offset, buffer); |
| 1307 | |
| 1308 | if (!fixedBuffer) |
| 1309 | delete[] buffer; |
| 1310 | |
| 1311 | return ERROR_SUCCESS; |
| 1312 | } |
| 1313 | |
| 1314 | extern "C" BOOL EventXplatEnabledGCDynamicEvent(){ return tracepoint_enabled(DotNETRuntime, GCDynamicEvent); } |
| 1315 | |
| 1316 | extern "C" ULONG FireEtXplatGCDynamicEvent( |
| 1317 | PCWSTR Name, |
| 1318 | const unsigned int DataSize, |
| 1319 | const BYTE* Data, |
| 1320 | const unsigned short ClrInstanceID) |
| 1321 | { |
| 1322 | if (!EventXplatEnabledGCDynamicEvent()) |
| 1323 | return ERROR_SUCCESS; |
| 1324 | |
| 1325 | char stackBuffer[71]; |
| 1326 | char *buffer = stackBuffer; |
| 1327 | size_t offset = 0; |
| 1328 | size_t size = 71; |
| 1329 | bool fixedBuffer = true; |
| 1330 | |
| 1331 | bool success = true; |
| 1332 | success &= WriteToBuffer(Name, buffer, offset, size, fixedBuffer); |
| 1333 | success &= WriteToBuffer(DataSize, buffer, offset, size, fixedBuffer); |
| 1334 | success &= WriteToBuffer((const BYTE *)Data, sizeof(const BYTE) * (int)DataSize, buffer, offset, size, fixedBuffer); |
| 1335 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 1336 | |
| 1337 | if (!success) |
| 1338 | { |
| 1339 | if (!fixedBuffer) |
| 1340 | delete[] buffer; |
| 1341 | return ERROR_WRITE_FAULT; |
| 1342 | } |
| 1343 | |
| 1344 | do_tracepoint(DotNETRuntime, GCDynamicEvent, offset, buffer); |
| 1345 | |
| 1346 | if (!fixedBuffer) |
| 1347 | delete[] buffer; |
| 1348 | |
| 1349 | return ERROR_SUCCESS; |
| 1350 | } |
| 1351 | |
| 1352 | extern "C" BOOL EventXplatEnabledWorkerThreadCreate(){ return tracepoint_enabled(DotNETRuntime, WorkerThreadCreate); } |
| 1353 | |
| 1354 | extern "C" ULONG FireEtXplatWorkerThreadCreate( |
| 1355 | const unsigned int WorkerThreadCount, |
| 1356 | const unsigned int RetiredWorkerThreads) |
| 1357 | { |
| 1358 | if (!EventXplatEnabledWorkerThreadCreate()) |
| 1359 | return ERROR_SUCCESS; |
| 1360 | |
| 1361 | do_tracepoint(DotNETRuntime, |
| 1362 | WorkerThreadCreate, |
| 1363 | WorkerThreadCount, |
| 1364 | RetiredWorkerThreads); |
| 1365 | |
| 1366 | return ERROR_SUCCESS; |
| 1367 | } |
| 1368 | |
| 1369 | extern "C" BOOL EventXplatEnabledWorkerThreadTerminate(){ return tracepoint_enabled(DotNETRuntime, WorkerThreadTerminate); } |
| 1370 | |
| 1371 | extern "C" ULONG FireEtXplatWorkerThreadTerminate( |
| 1372 | const unsigned int WorkerThreadCount, |
| 1373 | const unsigned int RetiredWorkerThreads) |
| 1374 | { |
| 1375 | if (!EventXplatEnabledWorkerThreadTerminate()) |
| 1376 | return ERROR_SUCCESS; |
| 1377 | |
| 1378 | do_tracepoint(DotNETRuntime, |
| 1379 | WorkerThreadTerminate, |
| 1380 | WorkerThreadCount, |
| 1381 | RetiredWorkerThreads); |
| 1382 | |
| 1383 | return ERROR_SUCCESS; |
| 1384 | } |
| 1385 | |
| 1386 | extern "C" BOOL EventXplatEnabledWorkerThreadRetire(){ return tracepoint_enabled(DotNETRuntime, WorkerThreadRetire); } |
| 1387 | |
| 1388 | extern "C" ULONG FireEtXplatWorkerThreadRetire( |
| 1389 | const unsigned int WorkerThreadCount, |
| 1390 | const unsigned int RetiredWorkerThreads) |
| 1391 | { |
| 1392 | if (!EventXplatEnabledWorkerThreadRetire()) |
| 1393 | return ERROR_SUCCESS; |
| 1394 | |
| 1395 | do_tracepoint(DotNETRuntime, |
| 1396 | WorkerThreadRetire, |
| 1397 | WorkerThreadCount, |
| 1398 | RetiredWorkerThreads); |
| 1399 | |
| 1400 | return ERROR_SUCCESS; |
| 1401 | } |
| 1402 | |
| 1403 | extern "C" BOOL EventXplatEnabledWorkerThreadUnretire(){ return tracepoint_enabled(DotNETRuntime, WorkerThreadUnretire); } |
| 1404 | |
| 1405 | extern "C" ULONG FireEtXplatWorkerThreadUnretire( |
| 1406 | const unsigned int WorkerThreadCount, |
| 1407 | const unsigned int RetiredWorkerThreads) |
| 1408 | { |
| 1409 | if (!EventXplatEnabledWorkerThreadUnretire()) |
| 1410 | return ERROR_SUCCESS; |
| 1411 | |
| 1412 | do_tracepoint(DotNETRuntime, |
| 1413 | WorkerThreadUnretire, |
| 1414 | WorkerThreadCount, |
| 1415 | RetiredWorkerThreads); |
| 1416 | |
| 1417 | return ERROR_SUCCESS; |
| 1418 | } |
| 1419 | |
| 1420 | extern "C" BOOL EventXplatEnabledIOThreadCreate(){ return tracepoint_enabled(DotNETRuntime, IOThreadCreate); } |
| 1421 | |
| 1422 | extern "C" ULONG FireEtXplatIOThreadCreate( |
| 1423 | const unsigned int IOThreadCount, |
| 1424 | const unsigned int RetiredIOThreads) |
| 1425 | { |
| 1426 | if (!EventXplatEnabledIOThreadCreate()) |
| 1427 | return ERROR_SUCCESS; |
| 1428 | |
| 1429 | do_tracepoint(DotNETRuntime, |
| 1430 | IOThreadCreate, |
| 1431 | IOThreadCount, |
| 1432 | RetiredIOThreads); |
| 1433 | |
| 1434 | return ERROR_SUCCESS; |
| 1435 | } |
| 1436 | |
| 1437 | extern "C" BOOL EventXplatEnabledIOThreadCreate_V1(){ return tracepoint_enabled(DotNETRuntime, IOThreadCreate_V1); } |
| 1438 | |
| 1439 | extern "C" ULONG FireEtXplatIOThreadCreate_V1( |
| 1440 | const unsigned int IOThreadCount, |
| 1441 | const unsigned int RetiredIOThreads, |
| 1442 | const unsigned short ClrInstanceID) |
| 1443 | { |
| 1444 | if (!EventXplatEnabledIOThreadCreate_V1()) |
| 1445 | return ERROR_SUCCESS; |
| 1446 | |
| 1447 | do_tracepoint(DotNETRuntime, |
| 1448 | IOThreadCreate_V1, |
| 1449 | IOThreadCount, |
| 1450 | RetiredIOThreads, |
| 1451 | ClrInstanceID); |
| 1452 | |
| 1453 | return ERROR_SUCCESS; |
| 1454 | } |
| 1455 | |
| 1456 | extern "C" BOOL EventXplatEnabledIOThreadTerminate(){ return tracepoint_enabled(DotNETRuntime, IOThreadTerminate); } |
| 1457 | |
| 1458 | extern "C" ULONG FireEtXplatIOThreadTerminate( |
| 1459 | const unsigned int IOThreadCount, |
| 1460 | const unsigned int RetiredIOThreads) |
| 1461 | { |
| 1462 | if (!EventXplatEnabledIOThreadTerminate()) |
| 1463 | return ERROR_SUCCESS; |
| 1464 | |
| 1465 | do_tracepoint(DotNETRuntime, |
| 1466 | IOThreadTerminate, |
| 1467 | IOThreadCount, |
| 1468 | RetiredIOThreads); |
| 1469 | |
| 1470 | return ERROR_SUCCESS; |
| 1471 | } |
| 1472 | |
| 1473 | extern "C" BOOL EventXplatEnabledIOThreadTerminate_V1(){ return tracepoint_enabled(DotNETRuntime, IOThreadTerminate_V1); } |
| 1474 | |
| 1475 | extern "C" ULONG FireEtXplatIOThreadTerminate_V1( |
| 1476 | const unsigned int IOThreadCount, |
| 1477 | const unsigned int RetiredIOThreads, |
| 1478 | const unsigned short ClrInstanceID) |
| 1479 | { |
| 1480 | if (!EventXplatEnabledIOThreadTerminate_V1()) |
| 1481 | return ERROR_SUCCESS; |
| 1482 | |
| 1483 | do_tracepoint(DotNETRuntime, |
| 1484 | IOThreadTerminate_V1, |
| 1485 | IOThreadCount, |
| 1486 | RetiredIOThreads, |
| 1487 | ClrInstanceID); |
| 1488 | |
| 1489 | return ERROR_SUCCESS; |
| 1490 | } |
| 1491 | |
| 1492 | extern "C" BOOL EventXplatEnabledIOThreadRetire(){ return tracepoint_enabled(DotNETRuntime, IOThreadRetire); } |
| 1493 | |
| 1494 | extern "C" ULONG FireEtXplatIOThreadRetire( |
| 1495 | const unsigned int IOThreadCount, |
| 1496 | const unsigned int RetiredIOThreads) |
| 1497 | { |
| 1498 | if (!EventXplatEnabledIOThreadRetire()) |
| 1499 | return ERROR_SUCCESS; |
| 1500 | |
| 1501 | do_tracepoint(DotNETRuntime, |
| 1502 | IOThreadRetire, |
| 1503 | IOThreadCount, |
| 1504 | RetiredIOThreads); |
| 1505 | |
| 1506 | return ERROR_SUCCESS; |
| 1507 | } |
| 1508 | |
| 1509 | extern "C" BOOL EventXplatEnabledIOThreadRetire_V1(){ return tracepoint_enabled(DotNETRuntime, IOThreadRetire_V1); } |
| 1510 | |
| 1511 | extern "C" ULONG FireEtXplatIOThreadRetire_V1( |
| 1512 | const unsigned int IOThreadCount, |
| 1513 | const unsigned int RetiredIOThreads, |
| 1514 | const unsigned short ClrInstanceID) |
| 1515 | { |
| 1516 | if (!EventXplatEnabledIOThreadRetire_V1()) |
| 1517 | return ERROR_SUCCESS; |
| 1518 | |
| 1519 | do_tracepoint(DotNETRuntime, |
| 1520 | IOThreadRetire_V1, |
| 1521 | IOThreadCount, |
| 1522 | RetiredIOThreads, |
| 1523 | ClrInstanceID); |
| 1524 | |
| 1525 | return ERROR_SUCCESS; |
| 1526 | } |
| 1527 | |
| 1528 | extern "C" BOOL EventXplatEnabledIOThreadUnretire(){ return tracepoint_enabled(DotNETRuntime, IOThreadUnretire); } |
| 1529 | |
| 1530 | extern "C" ULONG FireEtXplatIOThreadUnretire( |
| 1531 | const unsigned int IOThreadCount, |
| 1532 | const unsigned int RetiredIOThreads) |
| 1533 | { |
| 1534 | if (!EventXplatEnabledIOThreadUnretire()) |
| 1535 | return ERROR_SUCCESS; |
| 1536 | |
| 1537 | do_tracepoint(DotNETRuntime, |
| 1538 | IOThreadUnretire, |
| 1539 | IOThreadCount, |
| 1540 | RetiredIOThreads); |
| 1541 | |
| 1542 | return ERROR_SUCCESS; |
| 1543 | } |
| 1544 | |
| 1545 | extern "C" BOOL EventXplatEnabledIOThreadUnretire_V1(){ return tracepoint_enabled(DotNETRuntime, IOThreadUnretire_V1); } |
| 1546 | |
| 1547 | extern "C" ULONG FireEtXplatIOThreadUnretire_V1( |
| 1548 | const unsigned int IOThreadCount, |
| 1549 | const unsigned int RetiredIOThreads, |
| 1550 | const unsigned short ClrInstanceID) |
| 1551 | { |
| 1552 | if (!EventXplatEnabledIOThreadUnretire_V1()) |
| 1553 | return ERROR_SUCCESS; |
| 1554 | |
| 1555 | do_tracepoint(DotNETRuntime, |
| 1556 | IOThreadUnretire_V1, |
| 1557 | IOThreadCount, |
| 1558 | RetiredIOThreads, |
| 1559 | ClrInstanceID); |
| 1560 | |
| 1561 | return ERROR_SUCCESS; |
| 1562 | } |
| 1563 | |
| 1564 | extern "C" BOOL EventXplatEnabledThreadpoolSuspensionSuspendThread(){ return tracepoint_enabled(DotNETRuntime, ThreadpoolSuspensionSuspendThread); } |
| 1565 | |
| 1566 | extern "C" ULONG FireEtXplatThreadpoolSuspensionSuspendThread( |
| 1567 | const unsigned int ClrThreadID, |
| 1568 | const unsigned int CpuUtilization) |
| 1569 | { |
| 1570 | if (!EventXplatEnabledThreadpoolSuspensionSuspendThread()) |
| 1571 | return ERROR_SUCCESS; |
| 1572 | |
| 1573 | do_tracepoint(DotNETRuntime, |
| 1574 | ThreadpoolSuspensionSuspendThread, |
| 1575 | ClrThreadID, |
| 1576 | CpuUtilization); |
| 1577 | |
| 1578 | return ERROR_SUCCESS; |
| 1579 | } |
| 1580 | |
| 1581 | extern "C" BOOL EventXplatEnabledThreadpoolSuspensionResumeThread(){ return tracepoint_enabled(DotNETRuntime, ThreadpoolSuspensionResumeThread); } |
| 1582 | |
| 1583 | extern "C" ULONG FireEtXplatThreadpoolSuspensionResumeThread( |
| 1584 | const unsigned int ClrThreadID, |
| 1585 | const unsigned int CpuUtilization) |
| 1586 | { |
| 1587 | if (!EventXplatEnabledThreadpoolSuspensionResumeThread()) |
| 1588 | return ERROR_SUCCESS; |
| 1589 | |
| 1590 | do_tracepoint(DotNETRuntime, |
| 1591 | ThreadpoolSuspensionResumeThread, |
| 1592 | ClrThreadID, |
| 1593 | CpuUtilization); |
| 1594 | |
| 1595 | return ERROR_SUCCESS; |
| 1596 | } |
| 1597 | |
| 1598 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadStart(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadStart); } |
| 1599 | |
| 1600 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadStart( |
| 1601 | const unsigned int ActiveWorkerThreadCount, |
| 1602 | const unsigned int RetiredWorkerThreadCount, |
| 1603 | const unsigned short ClrInstanceID) |
| 1604 | { |
| 1605 | if (!EventXplatEnabledThreadPoolWorkerThreadStart()) |
| 1606 | return ERROR_SUCCESS; |
| 1607 | |
| 1608 | do_tracepoint(DotNETRuntime, |
| 1609 | ThreadPoolWorkerThreadStart, |
| 1610 | ActiveWorkerThreadCount, |
| 1611 | RetiredWorkerThreadCount, |
| 1612 | ClrInstanceID); |
| 1613 | |
| 1614 | return ERROR_SUCCESS; |
| 1615 | } |
| 1616 | |
| 1617 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadStop(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadStop); } |
| 1618 | |
| 1619 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadStop( |
| 1620 | const unsigned int ActiveWorkerThreadCount, |
| 1621 | const unsigned int RetiredWorkerThreadCount, |
| 1622 | const unsigned short ClrInstanceID) |
| 1623 | { |
| 1624 | if (!EventXplatEnabledThreadPoolWorkerThreadStop()) |
| 1625 | return ERROR_SUCCESS; |
| 1626 | |
| 1627 | do_tracepoint(DotNETRuntime, |
| 1628 | ThreadPoolWorkerThreadStop, |
| 1629 | ActiveWorkerThreadCount, |
| 1630 | RetiredWorkerThreadCount, |
| 1631 | ClrInstanceID); |
| 1632 | |
| 1633 | return ERROR_SUCCESS; |
| 1634 | } |
| 1635 | |
| 1636 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadRetirementStart(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadRetirementStart); } |
| 1637 | |
| 1638 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadRetirementStart( |
| 1639 | const unsigned int ActiveWorkerThreadCount, |
| 1640 | const unsigned int RetiredWorkerThreadCount, |
| 1641 | const unsigned short ClrInstanceID) |
| 1642 | { |
| 1643 | if (!EventXplatEnabledThreadPoolWorkerThreadRetirementStart()) |
| 1644 | return ERROR_SUCCESS; |
| 1645 | |
| 1646 | do_tracepoint(DotNETRuntime, |
| 1647 | ThreadPoolWorkerThreadRetirementStart, |
| 1648 | ActiveWorkerThreadCount, |
| 1649 | RetiredWorkerThreadCount, |
| 1650 | ClrInstanceID); |
| 1651 | |
| 1652 | return ERROR_SUCCESS; |
| 1653 | } |
| 1654 | |
| 1655 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadRetirementStop(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadRetirementStop); } |
| 1656 | |
| 1657 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadRetirementStop( |
| 1658 | const unsigned int ActiveWorkerThreadCount, |
| 1659 | const unsigned int RetiredWorkerThreadCount, |
| 1660 | const unsigned short ClrInstanceID) |
| 1661 | { |
| 1662 | if (!EventXplatEnabledThreadPoolWorkerThreadRetirementStop()) |
| 1663 | return ERROR_SUCCESS; |
| 1664 | |
| 1665 | do_tracepoint(DotNETRuntime, |
| 1666 | ThreadPoolWorkerThreadRetirementStop, |
| 1667 | ActiveWorkerThreadCount, |
| 1668 | RetiredWorkerThreadCount, |
| 1669 | ClrInstanceID); |
| 1670 | |
| 1671 | return ERROR_SUCCESS; |
| 1672 | } |
| 1673 | |
| 1674 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadAdjustmentSample(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadAdjustmentSample); } |
| 1675 | |
| 1676 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadAdjustmentSample( |
| 1677 | const double Throughput, |
| 1678 | const unsigned short ClrInstanceID) |
| 1679 | { |
| 1680 | if (!EventXplatEnabledThreadPoolWorkerThreadAdjustmentSample()) |
| 1681 | return ERROR_SUCCESS; |
| 1682 | |
| 1683 | do_tracepoint(DotNETRuntime, |
| 1684 | ThreadPoolWorkerThreadAdjustmentSample, |
| 1685 | Throughput, |
| 1686 | ClrInstanceID); |
| 1687 | |
| 1688 | return ERROR_SUCCESS; |
| 1689 | } |
| 1690 | |
| 1691 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadAdjustmentAdjustment(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadAdjustmentAdjustment); } |
| 1692 | |
| 1693 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadAdjustmentAdjustment( |
| 1694 | const double AverageThroughput, |
| 1695 | const unsigned int NewWorkerThreadCount, |
| 1696 | const unsigned int Reason, |
| 1697 | const unsigned short ClrInstanceID) |
| 1698 | { |
| 1699 | if (!EventXplatEnabledThreadPoolWorkerThreadAdjustmentAdjustment()) |
| 1700 | return ERROR_SUCCESS; |
| 1701 | |
| 1702 | do_tracepoint(DotNETRuntime, |
| 1703 | ThreadPoolWorkerThreadAdjustmentAdjustment, |
| 1704 | AverageThroughput, |
| 1705 | NewWorkerThreadCount, |
| 1706 | Reason, |
| 1707 | ClrInstanceID); |
| 1708 | |
| 1709 | return ERROR_SUCCESS; |
| 1710 | } |
| 1711 | |
| 1712 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadAdjustmentStats(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadAdjustmentStats); } |
| 1713 | |
| 1714 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadAdjustmentStats( |
| 1715 | const double Duration, |
| 1716 | const double Throughput, |
| 1717 | const double ThreadWave, |
| 1718 | const double ThroughputWave, |
| 1719 | const double ThroughputErrorEstimate, |
| 1720 | const double AverageThroughputErrorEstimate, |
| 1721 | const double ThroughputRatio, |
| 1722 | const double Confidence, |
| 1723 | const double NewControlSetting, |
| 1724 | const unsigned short NewThreadWaveMagnitude, |
| 1725 | const unsigned short ClrInstanceID) |
| 1726 | { |
| 1727 | if (!EventXplatEnabledThreadPoolWorkerThreadAdjustmentStats()) |
| 1728 | return ERROR_SUCCESS; |
| 1729 | |
| 1730 | char stackBuffer[76]; |
| 1731 | char *buffer = stackBuffer; |
| 1732 | size_t offset = 0; |
| 1733 | size_t size = 76; |
| 1734 | bool fixedBuffer = true; |
| 1735 | |
| 1736 | bool success = true; |
| 1737 | success &= WriteToBuffer(Duration, buffer, offset, size, fixedBuffer); |
| 1738 | success &= WriteToBuffer(Throughput, buffer, offset, size, fixedBuffer); |
| 1739 | success &= WriteToBuffer(ThreadWave, buffer, offset, size, fixedBuffer); |
| 1740 | success &= WriteToBuffer(ThroughputWave, buffer, offset, size, fixedBuffer); |
| 1741 | success &= WriteToBuffer(ThroughputErrorEstimate, buffer, offset, size, fixedBuffer); |
| 1742 | success &= WriteToBuffer(AverageThroughputErrorEstimate, buffer, offset, size, fixedBuffer); |
| 1743 | success &= WriteToBuffer(ThroughputRatio, buffer, offset, size, fixedBuffer); |
| 1744 | success &= WriteToBuffer(Confidence, buffer, offset, size, fixedBuffer); |
| 1745 | success &= WriteToBuffer(NewControlSetting, buffer, offset, size, fixedBuffer); |
| 1746 | success &= WriteToBuffer(NewThreadWaveMagnitude, buffer, offset, size, fixedBuffer); |
| 1747 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 1748 | |
| 1749 | if (!success) |
| 1750 | { |
| 1751 | if (!fixedBuffer) |
| 1752 | delete[] buffer; |
| 1753 | return ERROR_WRITE_FAULT; |
| 1754 | } |
| 1755 | |
| 1756 | do_tracepoint(DotNETRuntime, ThreadPoolWorkerThreadAdjustmentStats, offset, buffer); |
| 1757 | |
| 1758 | if (!fixedBuffer) |
| 1759 | delete[] buffer; |
| 1760 | |
| 1761 | return ERROR_SUCCESS; |
| 1762 | } |
| 1763 | |
| 1764 | extern "C" BOOL EventXplatEnabledThreadPoolWorkerThreadWait(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkerThreadWait); } |
| 1765 | |
| 1766 | extern "C" ULONG FireEtXplatThreadPoolWorkerThreadWait( |
| 1767 | const unsigned int ActiveWorkerThreadCount, |
| 1768 | const unsigned int RetiredWorkerThreadCount, |
| 1769 | const unsigned short ClrInstanceID) |
| 1770 | { |
| 1771 | if (!EventXplatEnabledThreadPoolWorkerThreadWait()) |
| 1772 | return ERROR_SUCCESS; |
| 1773 | |
| 1774 | do_tracepoint(DotNETRuntime, |
| 1775 | ThreadPoolWorkerThreadWait, |
| 1776 | ActiveWorkerThreadCount, |
| 1777 | RetiredWorkerThreadCount, |
| 1778 | ClrInstanceID); |
| 1779 | |
| 1780 | return ERROR_SUCCESS; |
| 1781 | } |
| 1782 | |
| 1783 | extern "C" BOOL EventXplatEnabledThreadPoolWorkingThreadCount(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolWorkingThreadCount); } |
| 1784 | |
| 1785 | extern "C" ULONG FireEtXplatThreadPoolWorkingThreadCount( |
| 1786 | const unsigned int Count, |
| 1787 | const unsigned short ClrInstanceID) |
| 1788 | { |
| 1789 | if (!EventXplatEnabledThreadPoolWorkingThreadCount()) |
| 1790 | return ERROR_SUCCESS; |
| 1791 | |
| 1792 | do_tracepoint(DotNETRuntime, |
| 1793 | ThreadPoolWorkingThreadCount, |
| 1794 | Count, |
| 1795 | ClrInstanceID); |
| 1796 | |
| 1797 | return ERROR_SUCCESS; |
| 1798 | } |
| 1799 | |
| 1800 | extern "C" BOOL EventXplatEnabledThreadPoolEnqueue(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolEnqueue); } |
| 1801 | |
| 1802 | extern "C" ULONG FireEtXplatThreadPoolEnqueue( |
| 1803 | const void* WorkID, |
| 1804 | const unsigned short ClrInstanceID) |
| 1805 | { |
| 1806 | if (!EventXplatEnabledThreadPoolEnqueue()) |
| 1807 | return ERROR_SUCCESS; |
| 1808 | |
| 1809 | do_tracepoint(DotNETRuntime, |
| 1810 | ThreadPoolEnqueue, |
| 1811 | (const size_t) WorkID, |
| 1812 | ClrInstanceID); |
| 1813 | |
| 1814 | return ERROR_SUCCESS; |
| 1815 | } |
| 1816 | |
| 1817 | extern "C" BOOL EventXplatEnabledThreadPoolDequeue(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolDequeue); } |
| 1818 | |
| 1819 | extern "C" ULONG FireEtXplatThreadPoolDequeue( |
| 1820 | const void* WorkID, |
| 1821 | const unsigned short ClrInstanceID) |
| 1822 | { |
| 1823 | if (!EventXplatEnabledThreadPoolDequeue()) |
| 1824 | return ERROR_SUCCESS; |
| 1825 | |
| 1826 | do_tracepoint(DotNETRuntime, |
| 1827 | ThreadPoolDequeue, |
| 1828 | (const size_t) WorkID, |
| 1829 | ClrInstanceID); |
| 1830 | |
| 1831 | return ERROR_SUCCESS; |
| 1832 | } |
| 1833 | |
| 1834 | extern "C" BOOL EventXplatEnabledThreadPoolIOEnqueue(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolIOEnqueue); } |
| 1835 | |
| 1836 | extern "C" ULONG FireEtXplatThreadPoolIOEnqueue( |
| 1837 | const void* NativeOverlapped, |
| 1838 | const void* Overlapped, |
| 1839 | const BOOL MultiDequeues, |
| 1840 | const unsigned short ClrInstanceID) |
| 1841 | { |
| 1842 | if (!EventXplatEnabledThreadPoolIOEnqueue()) |
| 1843 | return ERROR_SUCCESS; |
| 1844 | |
| 1845 | do_tracepoint(DotNETRuntime, |
| 1846 | ThreadPoolIOEnqueue, |
| 1847 | (const size_t) NativeOverlapped, |
| 1848 | (const size_t) Overlapped, |
| 1849 | MultiDequeues, |
| 1850 | ClrInstanceID); |
| 1851 | |
| 1852 | return ERROR_SUCCESS; |
| 1853 | } |
| 1854 | |
| 1855 | extern "C" BOOL EventXplatEnabledThreadPoolIODequeue(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolIODequeue); } |
| 1856 | |
| 1857 | extern "C" ULONG FireEtXplatThreadPoolIODequeue( |
| 1858 | const void* NativeOverlapped, |
| 1859 | const void* Overlapped, |
| 1860 | const unsigned short ClrInstanceID) |
| 1861 | { |
| 1862 | if (!EventXplatEnabledThreadPoolIODequeue()) |
| 1863 | return ERROR_SUCCESS; |
| 1864 | |
| 1865 | do_tracepoint(DotNETRuntime, |
| 1866 | ThreadPoolIODequeue, |
| 1867 | (const size_t) NativeOverlapped, |
| 1868 | (const size_t) Overlapped, |
| 1869 | ClrInstanceID); |
| 1870 | |
| 1871 | return ERROR_SUCCESS; |
| 1872 | } |
| 1873 | |
| 1874 | extern "C" BOOL EventXplatEnabledThreadPoolIOPack(){ return tracepoint_enabled(DotNETRuntime, ThreadPoolIOPack); } |
| 1875 | |
| 1876 | extern "C" ULONG FireEtXplatThreadPoolIOPack( |
| 1877 | const void* NativeOverlapped, |
| 1878 | const void* Overlapped, |
| 1879 | const unsigned short ClrInstanceID) |
| 1880 | { |
| 1881 | if (!EventXplatEnabledThreadPoolIOPack()) |
| 1882 | return ERROR_SUCCESS; |
| 1883 | |
| 1884 | do_tracepoint(DotNETRuntime, |
| 1885 | ThreadPoolIOPack, |
| 1886 | (const size_t) NativeOverlapped, |
| 1887 | (const size_t) Overlapped, |
| 1888 | ClrInstanceID); |
| 1889 | |
| 1890 | return ERROR_SUCCESS; |
| 1891 | } |
| 1892 | |
| 1893 | extern "C" BOOL EventXplatEnabledThreadCreating(){ return tracepoint_enabled(DotNETRuntime, ThreadCreating); } |
| 1894 | |
| 1895 | extern "C" ULONG FireEtXplatThreadCreating( |
| 1896 | const void* ID, |
| 1897 | const unsigned short ClrInstanceID) |
| 1898 | { |
| 1899 | if (!EventXplatEnabledThreadCreating()) |
| 1900 | return ERROR_SUCCESS; |
| 1901 | |
| 1902 | do_tracepoint(DotNETRuntime, |
| 1903 | ThreadCreating, |
| 1904 | (const size_t) ID, |
| 1905 | ClrInstanceID); |
| 1906 | |
| 1907 | return ERROR_SUCCESS; |
| 1908 | } |
| 1909 | |
| 1910 | extern "C" BOOL EventXplatEnabledThreadRunning(){ return tracepoint_enabled(DotNETRuntime, ThreadRunning); } |
| 1911 | |
| 1912 | extern "C" ULONG FireEtXplatThreadRunning( |
| 1913 | const void* ID, |
| 1914 | const unsigned short ClrInstanceID) |
| 1915 | { |
| 1916 | if (!EventXplatEnabledThreadRunning()) |
| 1917 | return ERROR_SUCCESS; |
| 1918 | |
| 1919 | do_tracepoint(DotNETRuntime, |
| 1920 | ThreadRunning, |
| 1921 | (const size_t) ID, |
| 1922 | ClrInstanceID); |
| 1923 | |
| 1924 | return ERROR_SUCCESS; |
| 1925 | } |
| 1926 | |
| 1927 | extern "C" BOOL EventXplatEnabledExceptionThrown(){ return tracepoint_enabled(DotNETRuntime, ExceptionThrown); } |
| 1928 | |
| 1929 | extern "C" ULONG FireEtXplatExceptionThrown( |
| 1930 | ) |
| 1931 | { |
| 1932 | if (!EventXplatEnabledExceptionThrown()) |
| 1933 | return ERROR_SUCCESS; |
| 1934 | |
| 1935 | do_tracepoint(DotNETRuntime, ExceptionThrown); |
| 1936 | |
| 1937 | return ERROR_SUCCESS; |
| 1938 | } |
| 1939 | |
| 1940 | extern "C" BOOL EventXplatEnabledExceptionThrown_V1(){ return tracepoint_enabled(DotNETRuntime, ExceptionThrown_V1); } |
| 1941 | |
| 1942 | extern "C" ULONG FireEtXplatExceptionThrown_V1( |
| 1943 | PCWSTR ExceptionType, |
| 1944 | PCWSTR ExceptionMessage, |
| 1945 | const void* ExceptionEIP, |
| 1946 | const unsigned int ExceptionHRESULT, |
| 1947 | const unsigned short ExceptionFlags, |
| 1948 | const unsigned short ClrInstanceID) |
| 1949 | { |
| 1950 | if (!EventXplatEnabledExceptionThrown_V1()) |
| 1951 | return ERROR_SUCCESS; |
| 1952 | INT ExceptionType_path_size = -1; |
| 1953 | PathCharString ExceptionType_PS; |
| 1954 | INT ExceptionType_full_name_path_size = (wcslen(ExceptionType) + 1)*sizeof(WCHAR); |
| 1955 | CHAR* ExceptionType_full_name = ExceptionType_PS.OpenStringBuffer(ExceptionType_full_name_path_size ); |
| 1956 | if (ExceptionType_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 1957 | INT ExceptionMessage_path_size = -1; |
| 1958 | PathCharString ExceptionMessage_PS; |
| 1959 | INT ExceptionMessage_full_name_path_size = (wcslen(ExceptionMessage) + 1)*sizeof(WCHAR); |
| 1960 | CHAR* ExceptionMessage_full_name = ExceptionMessage_PS.OpenStringBuffer(ExceptionMessage_full_name_path_size ); |
| 1961 | if (ExceptionMessage_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 1962 | |
| 1963 | ExceptionType_path_size = WideCharToMultiByte( CP_ACP, 0, ExceptionType, -1, ExceptionType_full_name, ExceptionType_full_name_path_size, NULL, NULL ); |
| 1964 | _ASSERTE(ExceptionType_path_size < ExceptionType_full_name_path_size ); |
| 1965 | ExceptionType_PS.CloseBuffer(ExceptionType_path_size ); |
| 1966 | if( ExceptionType_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 1967 | ExceptionMessage_path_size = WideCharToMultiByte( CP_ACP, 0, ExceptionMessage, -1, ExceptionMessage_full_name, ExceptionMessage_full_name_path_size, NULL, NULL ); |
| 1968 | _ASSERTE(ExceptionMessage_path_size < ExceptionMessage_full_name_path_size ); |
| 1969 | ExceptionMessage_PS.CloseBuffer(ExceptionMessage_path_size ); |
| 1970 | if( ExceptionMessage_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 1971 | do_tracepoint(DotNETRuntime, |
| 1972 | ExceptionThrown_V1, |
| 1973 | ExceptionType_full_name, |
| 1974 | ExceptionMessage_full_name, |
| 1975 | (const size_t) ExceptionEIP, |
| 1976 | ExceptionHRESULT, |
| 1977 | ExceptionFlags, |
| 1978 | ClrInstanceID); |
| 1979 | |
| 1980 | return ERROR_SUCCESS; |
| 1981 | } |
| 1982 | |
| 1983 | extern "C" BOOL EventXplatEnabledExceptionCatchStart(){ return tracepoint_enabled(DotNETRuntime, ExceptionCatchStart); } |
| 1984 | |
| 1985 | extern "C" ULONG FireEtXplatExceptionCatchStart( |
| 1986 | const unsigned __int64 EntryEIP, |
| 1987 | const unsigned __int64 MethodID, |
| 1988 | PCWSTR MethodName, |
| 1989 | const unsigned short ClrInstanceID) |
| 1990 | { |
| 1991 | if (!EventXplatEnabledExceptionCatchStart()) |
| 1992 | return ERROR_SUCCESS; |
| 1993 | INT MethodName_path_size = -1; |
| 1994 | PathCharString MethodName_PS; |
| 1995 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 1996 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 1997 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 1998 | |
| 1999 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2000 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2001 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2002 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2003 | do_tracepoint(DotNETRuntime, |
| 2004 | ExceptionCatchStart, |
| 2005 | EntryEIP, |
| 2006 | MethodID, |
| 2007 | MethodName_full_name, |
| 2008 | ClrInstanceID); |
| 2009 | |
| 2010 | return ERROR_SUCCESS; |
| 2011 | } |
| 2012 | |
| 2013 | extern "C" BOOL EventXplatEnabledExceptionCatchStop(){ return tracepoint_enabled(DotNETRuntime, ExceptionCatchStop); } |
| 2014 | |
| 2015 | extern "C" ULONG FireEtXplatExceptionCatchStop( |
| 2016 | ) |
| 2017 | { |
| 2018 | if (!EventXplatEnabledExceptionCatchStop()) |
| 2019 | return ERROR_SUCCESS; |
| 2020 | |
| 2021 | do_tracepoint(DotNETRuntime, ExceptionCatchStop); |
| 2022 | |
| 2023 | return ERROR_SUCCESS; |
| 2024 | } |
| 2025 | |
| 2026 | extern "C" BOOL EventXplatEnabledExceptionFinallyStart(){ return tracepoint_enabled(DotNETRuntime, ExceptionFinallyStart); } |
| 2027 | |
| 2028 | extern "C" ULONG FireEtXplatExceptionFinallyStart( |
| 2029 | const unsigned __int64 EntryEIP, |
| 2030 | const unsigned __int64 MethodID, |
| 2031 | PCWSTR MethodName, |
| 2032 | const unsigned short ClrInstanceID) |
| 2033 | { |
| 2034 | if (!EventXplatEnabledExceptionFinallyStart()) |
| 2035 | return ERROR_SUCCESS; |
| 2036 | INT MethodName_path_size = -1; |
| 2037 | PathCharString MethodName_PS; |
| 2038 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 2039 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 2040 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2041 | |
| 2042 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2043 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2044 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2045 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2046 | do_tracepoint(DotNETRuntime, |
| 2047 | ExceptionFinallyStart, |
| 2048 | EntryEIP, |
| 2049 | MethodID, |
| 2050 | MethodName_full_name, |
| 2051 | ClrInstanceID); |
| 2052 | |
| 2053 | return ERROR_SUCCESS; |
| 2054 | } |
| 2055 | |
| 2056 | extern "C" BOOL EventXplatEnabledExceptionFinallyStop(){ return tracepoint_enabled(DotNETRuntime, ExceptionFinallyStop); } |
| 2057 | |
| 2058 | extern "C" ULONG FireEtXplatExceptionFinallyStop( |
| 2059 | ) |
| 2060 | { |
| 2061 | if (!EventXplatEnabledExceptionFinallyStop()) |
| 2062 | return ERROR_SUCCESS; |
| 2063 | |
| 2064 | do_tracepoint(DotNETRuntime, ExceptionFinallyStop); |
| 2065 | |
| 2066 | return ERROR_SUCCESS; |
| 2067 | } |
| 2068 | |
| 2069 | extern "C" BOOL EventXplatEnabledExceptionFilterStart(){ return tracepoint_enabled(DotNETRuntime, ExceptionFilterStart); } |
| 2070 | |
| 2071 | extern "C" ULONG FireEtXplatExceptionFilterStart( |
| 2072 | const unsigned __int64 EntryEIP, |
| 2073 | const unsigned __int64 MethodID, |
| 2074 | PCWSTR MethodName, |
| 2075 | const unsigned short ClrInstanceID) |
| 2076 | { |
| 2077 | if (!EventXplatEnabledExceptionFilterStart()) |
| 2078 | return ERROR_SUCCESS; |
| 2079 | INT MethodName_path_size = -1; |
| 2080 | PathCharString MethodName_PS; |
| 2081 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 2082 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 2083 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2084 | |
| 2085 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2086 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2087 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2088 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2089 | do_tracepoint(DotNETRuntime, |
| 2090 | ExceptionFilterStart, |
| 2091 | EntryEIP, |
| 2092 | MethodID, |
| 2093 | MethodName_full_name, |
| 2094 | ClrInstanceID); |
| 2095 | |
| 2096 | return ERROR_SUCCESS; |
| 2097 | } |
| 2098 | |
| 2099 | extern "C" BOOL EventXplatEnabledExceptionFilterStop(){ return tracepoint_enabled(DotNETRuntime, ExceptionFilterStop); } |
| 2100 | |
| 2101 | extern "C" ULONG FireEtXplatExceptionFilterStop( |
| 2102 | ) |
| 2103 | { |
| 2104 | if (!EventXplatEnabledExceptionFilterStop()) |
| 2105 | return ERROR_SUCCESS; |
| 2106 | |
| 2107 | do_tracepoint(DotNETRuntime, ExceptionFilterStop); |
| 2108 | |
| 2109 | return ERROR_SUCCESS; |
| 2110 | } |
| 2111 | |
| 2112 | extern "C" BOOL EventXplatEnabledExceptionThrownStop(){ return tracepoint_enabled(DotNETRuntime, ExceptionThrownStop); } |
| 2113 | |
| 2114 | extern "C" ULONG FireEtXplatExceptionThrownStop( |
| 2115 | ) |
| 2116 | { |
| 2117 | if (!EventXplatEnabledExceptionThrownStop()) |
| 2118 | return ERROR_SUCCESS; |
| 2119 | |
| 2120 | do_tracepoint(DotNETRuntime, ExceptionThrownStop); |
| 2121 | |
| 2122 | return ERROR_SUCCESS; |
| 2123 | } |
| 2124 | |
| 2125 | extern "C" BOOL EventXplatEnabledContention(){ return tracepoint_enabled(DotNETRuntime, Contention); } |
| 2126 | |
| 2127 | extern "C" ULONG FireEtXplatContention( |
| 2128 | ) |
| 2129 | { |
| 2130 | if (!EventXplatEnabledContention()) |
| 2131 | return ERROR_SUCCESS; |
| 2132 | |
| 2133 | do_tracepoint(DotNETRuntime, Contention); |
| 2134 | |
| 2135 | return ERROR_SUCCESS; |
| 2136 | } |
| 2137 | |
| 2138 | extern "C" BOOL EventXplatEnabledContentionStart_V1(){ return tracepoint_enabled(DotNETRuntime, ContentionStart_V1); } |
| 2139 | |
| 2140 | extern "C" ULONG FireEtXplatContentionStart_V1( |
| 2141 | const unsigned char ContentionFlags, |
| 2142 | const unsigned short ClrInstanceID) |
| 2143 | { |
| 2144 | if (!EventXplatEnabledContentionStart_V1()) |
| 2145 | return ERROR_SUCCESS; |
| 2146 | |
| 2147 | do_tracepoint(DotNETRuntime, |
| 2148 | ContentionStart_V1, |
| 2149 | ContentionFlags, |
| 2150 | ClrInstanceID); |
| 2151 | |
| 2152 | return ERROR_SUCCESS; |
| 2153 | } |
| 2154 | |
| 2155 | extern "C" BOOL EventXplatEnabledContentionStop(){ return tracepoint_enabled(DotNETRuntime, ContentionStop); } |
| 2156 | |
| 2157 | extern "C" ULONG FireEtXplatContentionStop( |
| 2158 | const unsigned char ContentionFlags, |
| 2159 | const unsigned short ClrInstanceID) |
| 2160 | { |
| 2161 | if (!EventXplatEnabledContentionStop()) |
| 2162 | return ERROR_SUCCESS; |
| 2163 | |
| 2164 | do_tracepoint(DotNETRuntime, |
| 2165 | ContentionStop, |
| 2166 | ContentionFlags, |
| 2167 | ClrInstanceID); |
| 2168 | |
| 2169 | return ERROR_SUCCESS; |
| 2170 | } |
| 2171 | |
| 2172 | extern "C" BOOL EventXplatEnabledCLRStackWalk(){ return tracepoint_enabled(DotNETRuntime, CLRStackWalk); } |
| 2173 | |
| 2174 | extern "C" ULONG FireEtXplatCLRStackWalk( |
| 2175 | const unsigned short ClrInstanceID, |
| 2176 | const unsigned char Reserved1, |
| 2177 | const unsigned char Reserved2, |
| 2178 | const unsigned int FrameCount, |
| 2179 | const void** Stack) |
| 2180 | { |
| 2181 | if (!EventXplatEnabledCLRStackWalk()) |
| 2182 | return ERROR_SUCCESS; |
| 2183 | |
| 2184 | do_tracepoint(DotNETRuntime, |
| 2185 | CLRStackWalk, |
| 2186 | ClrInstanceID, |
| 2187 | Reserved1, |
| 2188 | Reserved2, |
| 2189 | FrameCount, |
| 2190 | (const size_t*) Stack); |
| 2191 | |
| 2192 | return ERROR_SUCCESS; |
| 2193 | } |
| 2194 | |
| 2195 | extern "C" BOOL EventXplatEnabledAppDomainMemAllocated(){ return tracepoint_enabled(DotNETRuntime, AppDomainMemAllocated); } |
| 2196 | |
| 2197 | extern "C" ULONG FireEtXplatAppDomainMemAllocated( |
| 2198 | const unsigned __int64 AppDomainID, |
| 2199 | const unsigned __int64 Allocated, |
| 2200 | const unsigned short ClrInstanceID) |
| 2201 | { |
| 2202 | if (!EventXplatEnabledAppDomainMemAllocated()) |
| 2203 | return ERROR_SUCCESS; |
| 2204 | |
| 2205 | do_tracepoint(DotNETRuntime, |
| 2206 | AppDomainMemAllocated, |
| 2207 | AppDomainID, |
| 2208 | Allocated, |
| 2209 | ClrInstanceID); |
| 2210 | |
| 2211 | return ERROR_SUCCESS; |
| 2212 | } |
| 2213 | |
| 2214 | extern "C" BOOL EventXplatEnabledAppDomainMemSurvived(){ return tracepoint_enabled(DotNETRuntime, AppDomainMemSurvived); } |
| 2215 | |
| 2216 | extern "C" ULONG FireEtXplatAppDomainMemSurvived( |
| 2217 | const unsigned __int64 AppDomainID, |
| 2218 | const unsigned __int64 Survived, |
| 2219 | const unsigned __int64 ProcessSurvived, |
| 2220 | const unsigned short ClrInstanceID) |
| 2221 | { |
| 2222 | if (!EventXplatEnabledAppDomainMemSurvived()) |
| 2223 | return ERROR_SUCCESS; |
| 2224 | |
| 2225 | do_tracepoint(DotNETRuntime, |
| 2226 | AppDomainMemSurvived, |
| 2227 | AppDomainID, |
| 2228 | Survived, |
| 2229 | ProcessSurvived, |
| 2230 | ClrInstanceID); |
| 2231 | |
| 2232 | return ERROR_SUCCESS; |
| 2233 | } |
| 2234 | |
| 2235 | extern "C" BOOL EventXplatEnabledThreadCreated(){ return tracepoint_enabled(DotNETRuntime, ThreadCreated); } |
| 2236 | |
| 2237 | extern "C" ULONG FireEtXplatThreadCreated( |
| 2238 | const unsigned __int64 ManagedThreadID, |
| 2239 | const unsigned __int64 AppDomainID, |
| 2240 | const unsigned int Flags, |
| 2241 | const unsigned int ManagedThreadIndex, |
| 2242 | const unsigned int OSThreadID, |
| 2243 | const unsigned short ClrInstanceID) |
| 2244 | { |
| 2245 | if (!EventXplatEnabledThreadCreated()) |
| 2246 | return ERROR_SUCCESS; |
| 2247 | |
| 2248 | do_tracepoint(DotNETRuntime, |
| 2249 | ThreadCreated, |
| 2250 | ManagedThreadID, |
| 2251 | AppDomainID, |
| 2252 | Flags, |
| 2253 | ManagedThreadIndex, |
| 2254 | OSThreadID, |
| 2255 | ClrInstanceID); |
| 2256 | |
| 2257 | return ERROR_SUCCESS; |
| 2258 | } |
| 2259 | |
| 2260 | extern "C" BOOL EventXplatEnabledThreadTerminated(){ return tracepoint_enabled(DotNETRuntime, ThreadTerminated); } |
| 2261 | |
| 2262 | extern "C" ULONG FireEtXplatThreadTerminated( |
| 2263 | const unsigned __int64 ManagedThreadID, |
| 2264 | const unsigned __int64 AppDomainID, |
| 2265 | const unsigned short ClrInstanceID) |
| 2266 | { |
| 2267 | if (!EventXplatEnabledThreadTerminated()) |
| 2268 | return ERROR_SUCCESS; |
| 2269 | |
| 2270 | do_tracepoint(DotNETRuntime, |
| 2271 | ThreadTerminated, |
| 2272 | ManagedThreadID, |
| 2273 | AppDomainID, |
| 2274 | ClrInstanceID); |
| 2275 | |
| 2276 | return ERROR_SUCCESS; |
| 2277 | } |
| 2278 | |
| 2279 | extern "C" BOOL EventXplatEnabledThreadDomainEnter(){ return tracepoint_enabled(DotNETRuntime, ThreadDomainEnter); } |
| 2280 | |
| 2281 | extern "C" ULONG FireEtXplatThreadDomainEnter( |
| 2282 | const unsigned __int64 ManagedThreadID, |
| 2283 | const unsigned __int64 AppDomainID, |
| 2284 | const unsigned short ClrInstanceID) |
| 2285 | { |
| 2286 | if (!EventXplatEnabledThreadDomainEnter()) |
| 2287 | return ERROR_SUCCESS; |
| 2288 | |
| 2289 | do_tracepoint(DotNETRuntime, |
| 2290 | ThreadDomainEnter, |
| 2291 | ManagedThreadID, |
| 2292 | AppDomainID, |
| 2293 | ClrInstanceID); |
| 2294 | |
| 2295 | return ERROR_SUCCESS; |
| 2296 | } |
| 2297 | |
| 2298 | extern "C" BOOL EventXplatEnabledILStubGenerated(){ return tracepoint_enabled(DotNETRuntime, ILStubGenerated); } |
| 2299 | |
| 2300 | extern "C" ULONG FireEtXplatILStubGenerated( |
| 2301 | const unsigned short ClrInstanceID, |
| 2302 | const unsigned __int64 ModuleID, |
| 2303 | const unsigned __int64 StubMethodID, |
| 2304 | const unsigned int StubFlags, |
| 2305 | const unsigned int ManagedInteropMethodToken, |
| 2306 | PCWSTR ManagedInteropMethodNamespace, |
| 2307 | PCWSTR ManagedInteropMethodName, |
| 2308 | PCWSTR ManagedInteropMethodSignature, |
| 2309 | PCWSTR NativeMethodSignature, |
| 2310 | PCWSTR StubMethodSignature, |
| 2311 | PCWSTR StubMethodILCode) |
| 2312 | { |
| 2313 | if (!EventXplatEnabledILStubGenerated()) |
| 2314 | return ERROR_SUCCESS; |
| 2315 | |
| 2316 | char stackBuffer[410]; |
| 2317 | char *buffer = stackBuffer; |
| 2318 | size_t offset = 0; |
| 2319 | size_t size = 410; |
| 2320 | bool fixedBuffer = true; |
| 2321 | |
| 2322 | bool success = true; |
| 2323 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 2324 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 2325 | success &= WriteToBuffer(StubMethodID, buffer, offset, size, fixedBuffer); |
| 2326 | success &= WriteToBuffer(StubFlags, buffer, offset, size, fixedBuffer); |
| 2327 | success &= WriteToBuffer(ManagedInteropMethodToken, buffer, offset, size, fixedBuffer); |
| 2328 | success &= WriteToBuffer(ManagedInteropMethodNamespace, buffer, offset, size, fixedBuffer); |
| 2329 | success &= WriteToBuffer(ManagedInteropMethodName, buffer, offset, size, fixedBuffer); |
| 2330 | success &= WriteToBuffer(ManagedInteropMethodSignature, buffer, offset, size, fixedBuffer); |
| 2331 | success &= WriteToBuffer(NativeMethodSignature, buffer, offset, size, fixedBuffer); |
| 2332 | success &= WriteToBuffer(StubMethodSignature, buffer, offset, size, fixedBuffer); |
| 2333 | success &= WriteToBuffer(StubMethodILCode, buffer, offset, size, fixedBuffer); |
| 2334 | |
| 2335 | if (!success) |
| 2336 | { |
| 2337 | if (!fixedBuffer) |
| 2338 | delete[] buffer; |
| 2339 | return ERROR_WRITE_FAULT; |
| 2340 | } |
| 2341 | |
| 2342 | do_tracepoint(DotNETRuntime, ILStubGenerated, offset, buffer); |
| 2343 | |
| 2344 | if (!fixedBuffer) |
| 2345 | delete[] buffer; |
| 2346 | |
| 2347 | return ERROR_SUCCESS; |
| 2348 | } |
| 2349 | |
| 2350 | extern "C" BOOL EventXplatEnabledILStubCacheHit(){ return tracepoint_enabled(DotNETRuntime, ILStubCacheHit); } |
| 2351 | |
| 2352 | extern "C" ULONG FireEtXplatILStubCacheHit( |
| 2353 | const unsigned short ClrInstanceID, |
| 2354 | const unsigned __int64 ModuleID, |
| 2355 | const unsigned __int64 StubMethodID, |
| 2356 | const unsigned int ManagedInteropMethodToken, |
| 2357 | PCWSTR ManagedInteropMethodNamespace, |
| 2358 | PCWSTR ManagedInteropMethodName, |
| 2359 | PCWSTR ManagedInteropMethodSignature) |
| 2360 | { |
| 2361 | if (!EventXplatEnabledILStubCacheHit()) |
| 2362 | return ERROR_SUCCESS; |
| 2363 | INT ManagedInteropMethodNamespace_path_size = -1; |
| 2364 | PathCharString ManagedInteropMethodNamespace_PS; |
| 2365 | INT ManagedInteropMethodNamespace_full_name_path_size = (wcslen(ManagedInteropMethodNamespace) + 1)*sizeof(WCHAR); |
| 2366 | CHAR* ManagedInteropMethodNamespace_full_name = ManagedInteropMethodNamespace_PS.OpenStringBuffer(ManagedInteropMethodNamespace_full_name_path_size ); |
| 2367 | if (ManagedInteropMethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2368 | INT ManagedInteropMethodName_path_size = -1; |
| 2369 | PathCharString ManagedInteropMethodName_PS; |
| 2370 | INT ManagedInteropMethodName_full_name_path_size = (wcslen(ManagedInteropMethodName) + 1)*sizeof(WCHAR); |
| 2371 | CHAR* ManagedInteropMethodName_full_name = ManagedInteropMethodName_PS.OpenStringBuffer(ManagedInteropMethodName_full_name_path_size ); |
| 2372 | if (ManagedInteropMethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2373 | INT ManagedInteropMethodSignature_path_size = -1; |
| 2374 | PathCharString ManagedInteropMethodSignature_PS; |
| 2375 | INT ManagedInteropMethodSignature_full_name_path_size = (wcslen(ManagedInteropMethodSignature) + 1)*sizeof(WCHAR); |
| 2376 | CHAR* ManagedInteropMethodSignature_full_name = ManagedInteropMethodSignature_PS.OpenStringBuffer(ManagedInteropMethodSignature_full_name_path_size ); |
| 2377 | if (ManagedInteropMethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2378 | |
| 2379 | ManagedInteropMethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, ManagedInteropMethodNamespace, -1, ManagedInteropMethodNamespace_full_name, ManagedInteropMethodNamespace_full_name_path_size, NULL, NULL ); |
| 2380 | _ASSERTE(ManagedInteropMethodNamespace_path_size < ManagedInteropMethodNamespace_full_name_path_size ); |
| 2381 | ManagedInteropMethodNamespace_PS.CloseBuffer(ManagedInteropMethodNamespace_path_size ); |
| 2382 | if( ManagedInteropMethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2383 | ManagedInteropMethodName_path_size = WideCharToMultiByte( CP_ACP, 0, ManagedInteropMethodName, -1, ManagedInteropMethodName_full_name, ManagedInteropMethodName_full_name_path_size, NULL, NULL ); |
| 2384 | _ASSERTE(ManagedInteropMethodName_path_size < ManagedInteropMethodName_full_name_path_size ); |
| 2385 | ManagedInteropMethodName_PS.CloseBuffer(ManagedInteropMethodName_path_size ); |
| 2386 | if( ManagedInteropMethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2387 | ManagedInteropMethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, ManagedInteropMethodSignature, -1, ManagedInteropMethodSignature_full_name, ManagedInteropMethodSignature_full_name_path_size, NULL, NULL ); |
| 2388 | _ASSERTE(ManagedInteropMethodSignature_path_size < ManagedInteropMethodSignature_full_name_path_size ); |
| 2389 | ManagedInteropMethodSignature_PS.CloseBuffer(ManagedInteropMethodSignature_path_size ); |
| 2390 | if( ManagedInteropMethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2391 | do_tracepoint(DotNETRuntime, |
| 2392 | ILStubCacheHit, |
| 2393 | ClrInstanceID, |
| 2394 | ModuleID, |
| 2395 | StubMethodID, |
| 2396 | ManagedInteropMethodToken, |
| 2397 | ManagedInteropMethodNamespace_full_name, |
| 2398 | ManagedInteropMethodName_full_name, |
| 2399 | ManagedInteropMethodSignature_full_name); |
| 2400 | |
| 2401 | return ERROR_SUCCESS; |
| 2402 | } |
| 2403 | |
| 2404 | extern "C" BOOL EventXplatEnabledDCStartCompleteV2(){ return tracepoint_enabled(DotNETRuntime, DCStartCompleteV2); } |
| 2405 | |
| 2406 | extern "C" ULONG FireEtXplatDCStartCompleteV2( |
| 2407 | ) |
| 2408 | { |
| 2409 | if (!EventXplatEnabledDCStartCompleteV2()) |
| 2410 | return ERROR_SUCCESS; |
| 2411 | |
| 2412 | do_tracepoint(DotNETRuntime, DCStartCompleteV2); |
| 2413 | |
| 2414 | return ERROR_SUCCESS; |
| 2415 | } |
| 2416 | |
| 2417 | extern "C" BOOL EventXplatEnabledDCEndCompleteV2(){ return tracepoint_enabled(DotNETRuntime, DCEndCompleteV2); } |
| 2418 | |
| 2419 | extern "C" ULONG FireEtXplatDCEndCompleteV2( |
| 2420 | ) |
| 2421 | { |
| 2422 | if (!EventXplatEnabledDCEndCompleteV2()) |
| 2423 | return ERROR_SUCCESS; |
| 2424 | |
| 2425 | do_tracepoint(DotNETRuntime, DCEndCompleteV2); |
| 2426 | |
| 2427 | return ERROR_SUCCESS; |
| 2428 | } |
| 2429 | |
| 2430 | extern "C" BOOL EventXplatEnabledMethodDCStartV2(){ return tracepoint_enabled(DotNETRuntime, MethodDCStartV2); } |
| 2431 | |
| 2432 | extern "C" ULONG FireEtXplatMethodDCStartV2( |
| 2433 | const unsigned __int64 MethodID, |
| 2434 | const unsigned __int64 ModuleID, |
| 2435 | const unsigned __int64 MethodStartAddress, |
| 2436 | const unsigned int MethodSize, |
| 2437 | const unsigned int MethodToken, |
| 2438 | const unsigned int MethodFlags) |
| 2439 | { |
| 2440 | if (!EventXplatEnabledMethodDCStartV2()) |
| 2441 | return ERROR_SUCCESS; |
| 2442 | |
| 2443 | do_tracepoint(DotNETRuntime, |
| 2444 | MethodDCStartV2, |
| 2445 | MethodID, |
| 2446 | ModuleID, |
| 2447 | MethodStartAddress, |
| 2448 | MethodSize, |
| 2449 | MethodToken, |
| 2450 | MethodFlags); |
| 2451 | |
| 2452 | return ERROR_SUCCESS; |
| 2453 | } |
| 2454 | |
| 2455 | extern "C" BOOL EventXplatEnabledMethodDCEndV2(){ return tracepoint_enabled(DotNETRuntime, MethodDCEndV2); } |
| 2456 | |
| 2457 | extern "C" ULONG FireEtXplatMethodDCEndV2( |
| 2458 | const unsigned __int64 MethodID, |
| 2459 | const unsigned __int64 ModuleID, |
| 2460 | const unsigned __int64 MethodStartAddress, |
| 2461 | const unsigned int MethodSize, |
| 2462 | const unsigned int MethodToken, |
| 2463 | const unsigned int MethodFlags) |
| 2464 | { |
| 2465 | if (!EventXplatEnabledMethodDCEndV2()) |
| 2466 | return ERROR_SUCCESS; |
| 2467 | |
| 2468 | do_tracepoint(DotNETRuntime, |
| 2469 | MethodDCEndV2, |
| 2470 | MethodID, |
| 2471 | ModuleID, |
| 2472 | MethodStartAddress, |
| 2473 | MethodSize, |
| 2474 | MethodToken, |
| 2475 | MethodFlags); |
| 2476 | |
| 2477 | return ERROR_SUCCESS; |
| 2478 | } |
| 2479 | |
| 2480 | extern "C" BOOL EventXplatEnabledMethodDCStartVerboseV2(){ return tracepoint_enabled(DotNETRuntime, MethodDCStartVerboseV2); } |
| 2481 | |
| 2482 | extern "C" ULONG FireEtXplatMethodDCStartVerboseV2( |
| 2483 | const unsigned __int64 MethodID, |
| 2484 | const unsigned __int64 ModuleID, |
| 2485 | const unsigned __int64 MethodStartAddress, |
| 2486 | const unsigned int MethodSize, |
| 2487 | const unsigned int MethodToken, |
| 2488 | const unsigned int MethodFlags, |
| 2489 | PCWSTR MethodNamespace, |
| 2490 | PCWSTR MethodName, |
| 2491 | PCWSTR MethodSignature) |
| 2492 | { |
| 2493 | if (!EventXplatEnabledMethodDCStartVerboseV2()) |
| 2494 | return ERROR_SUCCESS; |
| 2495 | INT MethodNamespace_path_size = -1; |
| 2496 | PathCharString MethodNamespace_PS; |
| 2497 | INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR); |
| 2498 | CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size ); |
| 2499 | if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2500 | INT MethodName_path_size = -1; |
| 2501 | PathCharString MethodName_PS; |
| 2502 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 2503 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 2504 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2505 | INT MethodSignature_path_size = -1; |
| 2506 | PathCharString MethodSignature_PS; |
| 2507 | INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR); |
| 2508 | CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size ); |
| 2509 | if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2510 | |
| 2511 | MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL ); |
| 2512 | _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size ); |
| 2513 | MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size ); |
| 2514 | if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2515 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2516 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2517 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2518 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2519 | MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL ); |
| 2520 | _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size ); |
| 2521 | MethodSignature_PS.CloseBuffer(MethodSignature_path_size ); |
| 2522 | if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2523 | do_tracepoint(DotNETRuntime, |
| 2524 | MethodDCStartVerboseV2, |
| 2525 | MethodID, |
| 2526 | ModuleID, |
| 2527 | MethodStartAddress, |
| 2528 | MethodSize, |
| 2529 | MethodToken, |
| 2530 | MethodFlags, |
| 2531 | MethodNamespace_full_name, |
| 2532 | MethodName_full_name, |
| 2533 | MethodSignature_full_name); |
| 2534 | |
| 2535 | return ERROR_SUCCESS; |
| 2536 | } |
| 2537 | |
| 2538 | extern "C" BOOL EventXplatEnabledMethodDCEndVerboseV2(){ return tracepoint_enabled(DotNETRuntime, MethodDCEndVerboseV2); } |
| 2539 | |
| 2540 | extern "C" ULONG FireEtXplatMethodDCEndVerboseV2( |
| 2541 | const unsigned __int64 MethodID, |
| 2542 | const unsigned __int64 ModuleID, |
| 2543 | const unsigned __int64 MethodStartAddress, |
| 2544 | const unsigned int MethodSize, |
| 2545 | const unsigned int MethodToken, |
| 2546 | const unsigned int MethodFlags, |
| 2547 | PCWSTR MethodNamespace, |
| 2548 | PCWSTR MethodName, |
| 2549 | PCWSTR MethodSignature) |
| 2550 | { |
| 2551 | if (!EventXplatEnabledMethodDCEndVerboseV2()) |
| 2552 | return ERROR_SUCCESS; |
| 2553 | INT MethodNamespace_path_size = -1; |
| 2554 | PathCharString MethodNamespace_PS; |
| 2555 | INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR); |
| 2556 | CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size ); |
| 2557 | if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2558 | INT MethodName_path_size = -1; |
| 2559 | PathCharString MethodName_PS; |
| 2560 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 2561 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 2562 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2563 | INT MethodSignature_path_size = -1; |
| 2564 | PathCharString MethodSignature_PS; |
| 2565 | INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR); |
| 2566 | CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size ); |
| 2567 | if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2568 | |
| 2569 | MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL ); |
| 2570 | _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size ); |
| 2571 | MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size ); |
| 2572 | if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2573 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2574 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2575 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2576 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2577 | MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL ); |
| 2578 | _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size ); |
| 2579 | MethodSignature_PS.CloseBuffer(MethodSignature_path_size ); |
| 2580 | if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2581 | do_tracepoint(DotNETRuntime, |
| 2582 | MethodDCEndVerboseV2, |
| 2583 | MethodID, |
| 2584 | ModuleID, |
| 2585 | MethodStartAddress, |
| 2586 | MethodSize, |
| 2587 | MethodToken, |
| 2588 | MethodFlags, |
| 2589 | MethodNamespace_full_name, |
| 2590 | MethodName_full_name, |
| 2591 | MethodSignature_full_name); |
| 2592 | |
| 2593 | return ERROR_SUCCESS; |
| 2594 | } |
| 2595 | |
| 2596 | extern "C" BOOL EventXplatEnabledMethodLoad(){ return tracepoint_enabled(DotNETRuntime, MethodLoad); } |
| 2597 | |
| 2598 | extern "C" ULONG FireEtXplatMethodLoad( |
| 2599 | const unsigned __int64 MethodID, |
| 2600 | const unsigned __int64 ModuleID, |
| 2601 | const unsigned __int64 MethodStartAddress, |
| 2602 | const unsigned int MethodSize, |
| 2603 | const unsigned int MethodToken, |
| 2604 | const unsigned int MethodFlags) |
| 2605 | { |
| 2606 | if (!EventXplatEnabledMethodLoad()) |
| 2607 | return ERROR_SUCCESS; |
| 2608 | |
| 2609 | do_tracepoint(DotNETRuntime, |
| 2610 | MethodLoad, |
| 2611 | MethodID, |
| 2612 | ModuleID, |
| 2613 | MethodStartAddress, |
| 2614 | MethodSize, |
| 2615 | MethodToken, |
| 2616 | MethodFlags); |
| 2617 | |
| 2618 | return ERROR_SUCCESS; |
| 2619 | } |
| 2620 | |
| 2621 | extern "C" BOOL EventXplatEnabledMethodLoad_V1(){ return tracepoint_enabled(DotNETRuntime, MethodLoad_V1); } |
| 2622 | |
| 2623 | extern "C" ULONG FireEtXplatMethodLoad_V1( |
| 2624 | const unsigned __int64 MethodID, |
| 2625 | const unsigned __int64 ModuleID, |
| 2626 | const unsigned __int64 MethodStartAddress, |
| 2627 | const unsigned int MethodSize, |
| 2628 | const unsigned int MethodToken, |
| 2629 | const unsigned int MethodFlags, |
| 2630 | const unsigned short ClrInstanceID) |
| 2631 | { |
| 2632 | if (!EventXplatEnabledMethodLoad_V1()) |
| 2633 | return ERROR_SUCCESS; |
| 2634 | |
| 2635 | do_tracepoint(DotNETRuntime, |
| 2636 | MethodLoad_V1, |
| 2637 | MethodID, |
| 2638 | ModuleID, |
| 2639 | MethodStartAddress, |
| 2640 | MethodSize, |
| 2641 | MethodToken, |
| 2642 | MethodFlags, |
| 2643 | ClrInstanceID); |
| 2644 | |
| 2645 | return ERROR_SUCCESS; |
| 2646 | } |
| 2647 | |
| 2648 | extern "C" BOOL EventXplatEnabledMethodLoad_V2(){ return tracepoint_enabled(DotNETRuntime, MethodLoad_V2); } |
| 2649 | |
| 2650 | extern "C" ULONG FireEtXplatMethodLoad_V2( |
| 2651 | const unsigned __int64 MethodID, |
| 2652 | const unsigned __int64 ModuleID, |
| 2653 | const unsigned __int64 MethodStartAddress, |
| 2654 | const unsigned int MethodSize, |
| 2655 | const unsigned int MethodToken, |
| 2656 | const unsigned int MethodFlags, |
| 2657 | const unsigned short ClrInstanceID, |
| 2658 | const unsigned __int64 ReJITID) |
| 2659 | { |
| 2660 | if (!EventXplatEnabledMethodLoad_V2()) |
| 2661 | return ERROR_SUCCESS; |
| 2662 | |
| 2663 | do_tracepoint(DotNETRuntime, |
| 2664 | MethodLoad_V2, |
| 2665 | MethodID, |
| 2666 | ModuleID, |
| 2667 | MethodStartAddress, |
| 2668 | MethodSize, |
| 2669 | MethodToken, |
| 2670 | MethodFlags, |
| 2671 | ClrInstanceID, |
| 2672 | ReJITID); |
| 2673 | |
| 2674 | return ERROR_SUCCESS; |
| 2675 | } |
| 2676 | |
| 2677 | extern "C" BOOL EventXplatEnabledMethodUnload(){ return tracepoint_enabled(DotNETRuntime, MethodUnload); } |
| 2678 | |
| 2679 | extern "C" ULONG FireEtXplatMethodUnload( |
| 2680 | const unsigned __int64 MethodID, |
| 2681 | const unsigned __int64 ModuleID, |
| 2682 | const unsigned __int64 MethodStartAddress, |
| 2683 | const unsigned int MethodSize, |
| 2684 | const unsigned int MethodToken, |
| 2685 | const unsigned int MethodFlags) |
| 2686 | { |
| 2687 | if (!EventXplatEnabledMethodUnload()) |
| 2688 | return ERROR_SUCCESS; |
| 2689 | |
| 2690 | do_tracepoint(DotNETRuntime, |
| 2691 | MethodUnload, |
| 2692 | MethodID, |
| 2693 | ModuleID, |
| 2694 | MethodStartAddress, |
| 2695 | MethodSize, |
| 2696 | MethodToken, |
| 2697 | MethodFlags); |
| 2698 | |
| 2699 | return ERROR_SUCCESS; |
| 2700 | } |
| 2701 | |
| 2702 | extern "C" BOOL EventXplatEnabledMethodUnload_V1(){ return tracepoint_enabled(DotNETRuntime, MethodUnload_V1); } |
| 2703 | |
| 2704 | extern "C" ULONG FireEtXplatMethodUnload_V1( |
| 2705 | const unsigned __int64 MethodID, |
| 2706 | const unsigned __int64 ModuleID, |
| 2707 | const unsigned __int64 MethodStartAddress, |
| 2708 | const unsigned int MethodSize, |
| 2709 | const unsigned int MethodToken, |
| 2710 | const unsigned int MethodFlags, |
| 2711 | const unsigned short ClrInstanceID) |
| 2712 | { |
| 2713 | if (!EventXplatEnabledMethodUnload_V1()) |
| 2714 | return ERROR_SUCCESS; |
| 2715 | |
| 2716 | do_tracepoint(DotNETRuntime, |
| 2717 | MethodUnload_V1, |
| 2718 | MethodID, |
| 2719 | ModuleID, |
| 2720 | MethodStartAddress, |
| 2721 | MethodSize, |
| 2722 | MethodToken, |
| 2723 | MethodFlags, |
| 2724 | ClrInstanceID); |
| 2725 | |
| 2726 | return ERROR_SUCCESS; |
| 2727 | } |
| 2728 | |
| 2729 | extern "C" BOOL EventXplatEnabledMethodUnload_V2(){ return tracepoint_enabled(DotNETRuntime, MethodUnload_V2); } |
| 2730 | |
| 2731 | extern "C" ULONG FireEtXplatMethodUnload_V2( |
| 2732 | const unsigned __int64 MethodID, |
| 2733 | const unsigned __int64 ModuleID, |
| 2734 | const unsigned __int64 MethodStartAddress, |
| 2735 | const unsigned int MethodSize, |
| 2736 | const unsigned int MethodToken, |
| 2737 | const unsigned int MethodFlags, |
| 2738 | const unsigned short ClrInstanceID, |
| 2739 | const unsigned __int64 ReJITID) |
| 2740 | { |
| 2741 | if (!EventXplatEnabledMethodUnload_V2()) |
| 2742 | return ERROR_SUCCESS; |
| 2743 | |
| 2744 | do_tracepoint(DotNETRuntime, |
| 2745 | MethodUnload_V2, |
| 2746 | MethodID, |
| 2747 | ModuleID, |
| 2748 | MethodStartAddress, |
| 2749 | MethodSize, |
| 2750 | MethodToken, |
| 2751 | MethodFlags, |
| 2752 | ClrInstanceID, |
| 2753 | ReJITID); |
| 2754 | |
| 2755 | return ERROR_SUCCESS; |
| 2756 | } |
| 2757 | |
| 2758 | extern "C" BOOL EventXplatEnabledMethodLoadVerbose(){ return tracepoint_enabled(DotNETRuntime, MethodLoadVerbose); } |
| 2759 | |
| 2760 | extern "C" ULONG FireEtXplatMethodLoadVerbose( |
| 2761 | const unsigned __int64 MethodID, |
| 2762 | const unsigned __int64 ModuleID, |
| 2763 | const unsigned __int64 MethodStartAddress, |
| 2764 | const unsigned int MethodSize, |
| 2765 | const unsigned int MethodToken, |
| 2766 | const unsigned int MethodFlags, |
| 2767 | PCWSTR MethodNamespace, |
| 2768 | PCWSTR MethodName, |
| 2769 | PCWSTR MethodSignature) |
| 2770 | { |
| 2771 | if (!EventXplatEnabledMethodLoadVerbose()) |
| 2772 | return ERROR_SUCCESS; |
| 2773 | INT MethodNamespace_path_size = -1; |
| 2774 | PathCharString MethodNamespace_PS; |
| 2775 | INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR); |
| 2776 | CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size ); |
| 2777 | if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2778 | INT MethodName_path_size = -1; |
| 2779 | PathCharString MethodName_PS; |
| 2780 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 2781 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 2782 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2783 | INT MethodSignature_path_size = -1; |
| 2784 | PathCharString MethodSignature_PS; |
| 2785 | INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR); |
| 2786 | CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size ); |
| 2787 | if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2788 | |
| 2789 | MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL ); |
| 2790 | _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size ); |
| 2791 | MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size ); |
| 2792 | if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2793 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2794 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2795 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2796 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2797 | MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL ); |
| 2798 | _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size ); |
| 2799 | MethodSignature_PS.CloseBuffer(MethodSignature_path_size ); |
| 2800 | if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2801 | do_tracepoint(DotNETRuntime, |
| 2802 | MethodLoadVerbose, |
| 2803 | MethodID, |
| 2804 | ModuleID, |
| 2805 | MethodStartAddress, |
| 2806 | MethodSize, |
| 2807 | MethodToken, |
| 2808 | MethodFlags, |
| 2809 | MethodNamespace_full_name, |
| 2810 | MethodName_full_name, |
| 2811 | MethodSignature_full_name); |
| 2812 | |
| 2813 | return ERROR_SUCCESS; |
| 2814 | } |
| 2815 | |
| 2816 | extern "C" BOOL EventXplatEnabledMethodLoadVerbose_V1(){ return tracepoint_enabled(DotNETRuntime, MethodLoadVerbose_V1); } |
| 2817 | |
| 2818 | extern "C" ULONG FireEtXplatMethodLoadVerbose_V1( |
| 2819 | const unsigned __int64 MethodID, |
| 2820 | const unsigned __int64 ModuleID, |
| 2821 | const unsigned __int64 MethodStartAddress, |
| 2822 | const unsigned int MethodSize, |
| 2823 | const unsigned int MethodToken, |
| 2824 | const unsigned int MethodFlags, |
| 2825 | PCWSTR MethodNamespace, |
| 2826 | PCWSTR MethodName, |
| 2827 | PCWSTR MethodSignature, |
| 2828 | const unsigned short ClrInstanceID) |
| 2829 | { |
| 2830 | if (!EventXplatEnabledMethodLoadVerbose_V1()) |
| 2831 | return ERROR_SUCCESS; |
| 2832 | |
| 2833 | char stackBuffer[230]; |
| 2834 | char *buffer = stackBuffer; |
| 2835 | size_t offset = 0; |
| 2836 | size_t size = 230; |
| 2837 | bool fixedBuffer = true; |
| 2838 | |
| 2839 | bool success = true; |
| 2840 | success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer); |
| 2841 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 2842 | success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer); |
| 2843 | success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer); |
| 2844 | success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer); |
| 2845 | success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer); |
| 2846 | success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer); |
| 2847 | success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer); |
| 2848 | success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer); |
| 2849 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 2850 | |
| 2851 | if (!success) |
| 2852 | { |
| 2853 | if (!fixedBuffer) |
| 2854 | delete[] buffer; |
| 2855 | return ERROR_WRITE_FAULT; |
| 2856 | } |
| 2857 | |
| 2858 | do_tracepoint(DotNETRuntime, MethodLoadVerbose_V1, offset, buffer); |
| 2859 | |
| 2860 | if (!fixedBuffer) |
| 2861 | delete[] buffer; |
| 2862 | |
| 2863 | return ERROR_SUCCESS; |
| 2864 | } |
| 2865 | |
| 2866 | extern "C" BOOL EventXplatEnabledMethodLoadVerbose_V2(){ return tracepoint_enabled(DotNETRuntime, MethodLoadVerbose_V2); } |
| 2867 | |
| 2868 | extern "C" ULONG FireEtXplatMethodLoadVerbose_V2( |
| 2869 | const unsigned __int64 MethodID, |
| 2870 | const unsigned __int64 ModuleID, |
| 2871 | const unsigned __int64 MethodStartAddress, |
| 2872 | const unsigned int MethodSize, |
| 2873 | const unsigned int MethodToken, |
| 2874 | const unsigned int MethodFlags, |
| 2875 | PCWSTR MethodNamespace, |
| 2876 | PCWSTR MethodName, |
| 2877 | PCWSTR MethodSignature, |
| 2878 | const unsigned short ClrInstanceID, |
| 2879 | const unsigned __int64 ReJITID) |
| 2880 | { |
| 2881 | if (!EventXplatEnabledMethodLoadVerbose_V2()) |
| 2882 | return ERROR_SUCCESS; |
| 2883 | |
| 2884 | char stackBuffer[238]; |
| 2885 | char *buffer = stackBuffer; |
| 2886 | size_t offset = 0; |
| 2887 | size_t size = 238; |
| 2888 | bool fixedBuffer = true; |
| 2889 | |
| 2890 | bool success = true; |
| 2891 | success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer); |
| 2892 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 2893 | success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer); |
| 2894 | success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer); |
| 2895 | success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer); |
| 2896 | success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer); |
| 2897 | success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer); |
| 2898 | success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer); |
| 2899 | success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer); |
| 2900 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 2901 | success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer); |
| 2902 | |
| 2903 | if (!success) |
| 2904 | { |
| 2905 | if (!fixedBuffer) |
| 2906 | delete[] buffer; |
| 2907 | return ERROR_WRITE_FAULT; |
| 2908 | } |
| 2909 | |
| 2910 | do_tracepoint(DotNETRuntime, MethodLoadVerbose_V2, offset, buffer); |
| 2911 | |
| 2912 | if (!fixedBuffer) |
| 2913 | delete[] buffer; |
| 2914 | |
| 2915 | return ERROR_SUCCESS; |
| 2916 | } |
| 2917 | |
| 2918 | extern "C" BOOL EventXplatEnabledMethodUnloadVerbose(){ return tracepoint_enabled(DotNETRuntime, MethodUnloadVerbose); } |
| 2919 | |
| 2920 | extern "C" ULONG FireEtXplatMethodUnloadVerbose( |
| 2921 | const unsigned __int64 MethodID, |
| 2922 | const unsigned __int64 ModuleID, |
| 2923 | const unsigned __int64 MethodStartAddress, |
| 2924 | const unsigned int MethodSize, |
| 2925 | const unsigned int MethodToken, |
| 2926 | const unsigned int MethodFlags, |
| 2927 | PCWSTR MethodNamespace, |
| 2928 | PCWSTR MethodName, |
| 2929 | PCWSTR MethodSignature) |
| 2930 | { |
| 2931 | if (!EventXplatEnabledMethodUnloadVerbose()) |
| 2932 | return ERROR_SUCCESS; |
| 2933 | INT MethodNamespace_path_size = -1; |
| 2934 | PathCharString MethodNamespace_PS; |
| 2935 | INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR); |
| 2936 | CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size ); |
| 2937 | if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2938 | INT MethodName_path_size = -1; |
| 2939 | PathCharString MethodName_PS; |
| 2940 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 2941 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 2942 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2943 | INT MethodSignature_path_size = -1; |
| 2944 | PathCharString MethodSignature_PS; |
| 2945 | INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR); |
| 2946 | CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size ); |
| 2947 | if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 2948 | |
| 2949 | MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL ); |
| 2950 | _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size ); |
| 2951 | MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size ); |
| 2952 | if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2953 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 2954 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 2955 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 2956 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2957 | MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL ); |
| 2958 | _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size ); |
| 2959 | MethodSignature_PS.CloseBuffer(MethodSignature_path_size ); |
| 2960 | if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 2961 | do_tracepoint(DotNETRuntime, |
| 2962 | MethodUnloadVerbose, |
| 2963 | MethodID, |
| 2964 | ModuleID, |
| 2965 | MethodStartAddress, |
| 2966 | MethodSize, |
| 2967 | MethodToken, |
| 2968 | MethodFlags, |
| 2969 | MethodNamespace_full_name, |
| 2970 | MethodName_full_name, |
| 2971 | MethodSignature_full_name); |
| 2972 | |
| 2973 | return ERROR_SUCCESS; |
| 2974 | } |
| 2975 | |
| 2976 | extern "C" BOOL EventXplatEnabledMethodUnloadVerbose_V1(){ return tracepoint_enabled(DotNETRuntime, MethodUnloadVerbose_V1); } |
| 2977 | |
| 2978 | extern "C" ULONG FireEtXplatMethodUnloadVerbose_V1( |
| 2979 | const unsigned __int64 MethodID, |
| 2980 | const unsigned __int64 ModuleID, |
| 2981 | const unsigned __int64 MethodStartAddress, |
| 2982 | const unsigned int MethodSize, |
| 2983 | const unsigned int MethodToken, |
| 2984 | const unsigned int MethodFlags, |
| 2985 | PCWSTR MethodNamespace, |
| 2986 | PCWSTR MethodName, |
| 2987 | PCWSTR MethodSignature, |
| 2988 | const unsigned short ClrInstanceID) |
| 2989 | { |
| 2990 | if (!EventXplatEnabledMethodUnloadVerbose_V1()) |
| 2991 | return ERROR_SUCCESS; |
| 2992 | |
| 2993 | char stackBuffer[230]; |
| 2994 | char *buffer = stackBuffer; |
| 2995 | size_t offset = 0; |
| 2996 | size_t size = 230; |
| 2997 | bool fixedBuffer = true; |
| 2998 | |
| 2999 | bool success = true; |
| 3000 | success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer); |
| 3001 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 3002 | success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer); |
| 3003 | success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer); |
| 3004 | success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer); |
| 3005 | success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer); |
| 3006 | success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer); |
| 3007 | success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer); |
| 3008 | success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer); |
| 3009 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3010 | |
| 3011 | if (!success) |
| 3012 | { |
| 3013 | if (!fixedBuffer) |
| 3014 | delete[] buffer; |
| 3015 | return ERROR_WRITE_FAULT; |
| 3016 | } |
| 3017 | |
| 3018 | do_tracepoint(DotNETRuntime, MethodUnloadVerbose_V1, offset, buffer); |
| 3019 | |
| 3020 | if (!fixedBuffer) |
| 3021 | delete[] buffer; |
| 3022 | |
| 3023 | return ERROR_SUCCESS; |
| 3024 | } |
| 3025 | |
| 3026 | extern "C" BOOL EventXplatEnabledMethodUnloadVerbose_V2(){ return tracepoint_enabled(DotNETRuntime, MethodUnloadVerbose_V2); } |
| 3027 | |
| 3028 | extern "C" ULONG FireEtXplatMethodUnloadVerbose_V2( |
| 3029 | const unsigned __int64 MethodID, |
| 3030 | const unsigned __int64 ModuleID, |
| 3031 | const unsigned __int64 MethodStartAddress, |
| 3032 | const unsigned int MethodSize, |
| 3033 | const unsigned int MethodToken, |
| 3034 | const unsigned int MethodFlags, |
| 3035 | PCWSTR MethodNamespace, |
| 3036 | PCWSTR MethodName, |
| 3037 | PCWSTR MethodSignature, |
| 3038 | const unsigned short ClrInstanceID, |
| 3039 | const unsigned __int64 ReJITID) |
| 3040 | { |
| 3041 | if (!EventXplatEnabledMethodUnloadVerbose_V2()) |
| 3042 | return ERROR_SUCCESS; |
| 3043 | |
| 3044 | char stackBuffer[238]; |
| 3045 | char *buffer = stackBuffer; |
| 3046 | size_t offset = 0; |
| 3047 | size_t size = 238; |
| 3048 | bool fixedBuffer = true; |
| 3049 | |
| 3050 | bool success = true; |
| 3051 | success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer); |
| 3052 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 3053 | success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer); |
| 3054 | success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer); |
| 3055 | success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer); |
| 3056 | success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer); |
| 3057 | success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer); |
| 3058 | success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer); |
| 3059 | success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer); |
| 3060 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3061 | success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer); |
| 3062 | |
| 3063 | if (!success) |
| 3064 | { |
| 3065 | if (!fixedBuffer) |
| 3066 | delete[] buffer; |
| 3067 | return ERROR_WRITE_FAULT; |
| 3068 | } |
| 3069 | |
| 3070 | do_tracepoint(DotNETRuntime, MethodUnloadVerbose_V2, offset, buffer); |
| 3071 | |
| 3072 | if (!fixedBuffer) |
| 3073 | delete[] buffer; |
| 3074 | |
| 3075 | return ERROR_SUCCESS; |
| 3076 | } |
| 3077 | |
| 3078 | extern "C" BOOL EventXplatEnabledMethodJittingStarted(){ return tracepoint_enabled(DotNETRuntime, MethodJittingStarted); } |
| 3079 | |
| 3080 | extern "C" ULONG FireEtXplatMethodJittingStarted( |
| 3081 | const unsigned __int64 MethodID, |
| 3082 | const unsigned __int64 ModuleID, |
| 3083 | const unsigned int MethodToken, |
| 3084 | const unsigned int MethodILSize, |
| 3085 | PCWSTR MethodNamespace, |
| 3086 | PCWSTR MethodName, |
| 3087 | PCWSTR MethodSignature) |
| 3088 | { |
| 3089 | if (!EventXplatEnabledMethodJittingStarted()) |
| 3090 | return ERROR_SUCCESS; |
| 3091 | INT MethodNamespace_path_size = -1; |
| 3092 | PathCharString MethodNamespace_PS; |
| 3093 | INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR); |
| 3094 | CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size ); |
| 3095 | if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3096 | INT MethodName_path_size = -1; |
| 3097 | PathCharString MethodName_PS; |
| 3098 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 3099 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 3100 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3101 | INT MethodSignature_path_size = -1; |
| 3102 | PathCharString MethodSignature_PS; |
| 3103 | INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR); |
| 3104 | CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size ); |
| 3105 | if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3106 | |
| 3107 | MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL ); |
| 3108 | _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size ); |
| 3109 | MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size ); |
| 3110 | if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3111 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 3112 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 3113 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 3114 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3115 | MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL ); |
| 3116 | _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size ); |
| 3117 | MethodSignature_PS.CloseBuffer(MethodSignature_path_size ); |
| 3118 | if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3119 | do_tracepoint(DotNETRuntime, |
| 3120 | MethodJittingStarted, |
| 3121 | MethodID, |
| 3122 | ModuleID, |
| 3123 | MethodToken, |
| 3124 | MethodILSize, |
| 3125 | MethodNamespace_full_name, |
| 3126 | MethodName_full_name, |
| 3127 | MethodSignature_full_name); |
| 3128 | |
| 3129 | return ERROR_SUCCESS; |
| 3130 | } |
| 3131 | |
| 3132 | extern "C" BOOL EventXplatEnabledMethodJittingStarted_V1(){ return tracepoint_enabled(DotNETRuntime, MethodJittingStarted_V1); } |
| 3133 | |
| 3134 | extern "C" ULONG FireEtXplatMethodJittingStarted_V1( |
| 3135 | const unsigned __int64 MethodID, |
| 3136 | const unsigned __int64 ModuleID, |
| 3137 | const unsigned int MethodToken, |
| 3138 | const unsigned int MethodILSize, |
| 3139 | PCWSTR MethodNamespace, |
| 3140 | PCWSTR MethodName, |
| 3141 | PCWSTR MethodSignature, |
| 3142 | const unsigned short ClrInstanceID) |
| 3143 | { |
| 3144 | if (!EventXplatEnabledMethodJittingStarted_V1()) |
| 3145 | return ERROR_SUCCESS; |
| 3146 | INT MethodNamespace_path_size = -1; |
| 3147 | PathCharString MethodNamespace_PS; |
| 3148 | INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR); |
| 3149 | CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size ); |
| 3150 | if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3151 | INT MethodName_path_size = -1; |
| 3152 | PathCharString MethodName_PS; |
| 3153 | INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR); |
| 3154 | CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size ); |
| 3155 | if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3156 | INT MethodSignature_path_size = -1; |
| 3157 | PathCharString MethodSignature_PS; |
| 3158 | INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR); |
| 3159 | CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size ); |
| 3160 | if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3161 | |
| 3162 | MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL ); |
| 3163 | _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size ); |
| 3164 | MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size ); |
| 3165 | if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3166 | MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL ); |
| 3167 | _ASSERTE(MethodName_path_size < MethodName_full_name_path_size ); |
| 3168 | MethodName_PS.CloseBuffer(MethodName_path_size ); |
| 3169 | if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3170 | MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL ); |
| 3171 | _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size ); |
| 3172 | MethodSignature_PS.CloseBuffer(MethodSignature_path_size ); |
| 3173 | if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3174 | do_tracepoint(DotNETRuntime, |
| 3175 | MethodJittingStarted_V1, |
| 3176 | MethodID, |
| 3177 | ModuleID, |
| 3178 | MethodToken, |
| 3179 | MethodILSize, |
| 3180 | MethodNamespace_full_name, |
| 3181 | MethodName_full_name, |
| 3182 | MethodSignature_full_name, |
| 3183 | ClrInstanceID); |
| 3184 | |
| 3185 | return ERROR_SUCCESS; |
| 3186 | } |
| 3187 | |
| 3188 | extern "C" BOOL EventXplatEnabledMethodJitInliningSucceeded(){ return tracepoint_enabled(DotNETRuntime, MethodJitInliningSucceeded); } |
| 3189 | |
| 3190 | extern "C" ULONG FireEtXplatMethodJitInliningSucceeded( |
| 3191 | PCWSTR MethodBeingCompiledNamespace, |
| 3192 | PCWSTR MethodBeingCompiledName, |
| 3193 | PCWSTR MethodBeingCompiledNameSignature, |
| 3194 | PCWSTR InlinerNamespace, |
| 3195 | PCWSTR InlinerName, |
| 3196 | PCWSTR InlinerNameSignature, |
| 3197 | PCWSTR InlineeNamespace, |
| 3198 | PCWSTR InlineeName, |
| 3199 | PCWSTR InlineeNameSignature, |
| 3200 | const unsigned short ClrInstanceID) |
| 3201 | { |
| 3202 | if (!EventXplatEnabledMethodJitInliningSucceeded()) |
| 3203 | return ERROR_SUCCESS; |
| 3204 | |
| 3205 | char stackBuffer[578]; |
| 3206 | char *buffer = stackBuffer; |
| 3207 | size_t offset = 0; |
| 3208 | size_t size = 578; |
| 3209 | bool fixedBuffer = true; |
| 3210 | |
| 3211 | bool success = true; |
| 3212 | success &= WriteToBuffer(MethodBeingCompiledNamespace, buffer, offset, size, fixedBuffer); |
| 3213 | success &= WriteToBuffer(MethodBeingCompiledName, buffer, offset, size, fixedBuffer); |
| 3214 | success &= WriteToBuffer(MethodBeingCompiledNameSignature, buffer, offset, size, fixedBuffer); |
| 3215 | success &= WriteToBuffer(InlinerNamespace, buffer, offset, size, fixedBuffer); |
| 3216 | success &= WriteToBuffer(InlinerName, buffer, offset, size, fixedBuffer); |
| 3217 | success &= WriteToBuffer(InlinerNameSignature, buffer, offset, size, fixedBuffer); |
| 3218 | success &= WriteToBuffer(InlineeNamespace, buffer, offset, size, fixedBuffer); |
| 3219 | success &= WriteToBuffer(InlineeName, buffer, offset, size, fixedBuffer); |
| 3220 | success &= WriteToBuffer(InlineeNameSignature, buffer, offset, size, fixedBuffer); |
| 3221 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3222 | |
| 3223 | if (!success) |
| 3224 | { |
| 3225 | if (!fixedBuffer) |
| 3226 | delete[] buffer; |
| 3227 | return ERROR_WRITE_FAULT; |
| 3228 | } |
| 3229 | |
| 3230 | do_tracepoint(DotNETRuntime, MethodJitInliningSucceeded, offset, buffer); |
| 3231 | |
| 3232 | if (!fixedBuffer) |
| 3233 | delete[] buffer; |
| 3234 | |
| 3235 | return ERROR_SUCCESS; |
| 3236 | } |
| 3237 | |
| 3238 | extern "C" BOOL EventXplatEnabledMethodJitInliningFailedAnsi(){ return tracepoint_enabled(DotNETRuntime, MethodJitInliningFailedAnsi); } |
| 3239 | |
| 3240 | extern "C" ULONG FireEtXplatMethodJitInliningFailedAnsi( |
| 3241 | PCWSTR MethodBeingCompiledNamespace, |
| 3242 | PCWSTR MethodBeingCompiledName, |
| 3243 | PCWSTR MethodBeingCompiledNameSignature, |
| 3244 | PCWSTR InlinerNamespace, |
| 3245 | PCWSTR InlinerName, |
| 3246 | PCWSTR InlinerNameSignature, |
| 3247 | PCWSTR InlineeNamespace, |
| 3248 | PCWSTR InlineeName, |
| 3249 | PCWSTR InlineeNameSignature, |
| 3250 | const BOOL FailAlways, |
| 3251 | LPCSTR FailReason, |
| 3252 | const unsigned short ClrInstanceID) |
| 3253 | { |
| 3254 | if (!EventXplatEnabledMethodJitInliningFailedAnsi()) |
| 3255 | return ERROR_SUCCESS; |
| 3256 | |
| 3257 | char stackBuffer[614]; |
| 3258 | char *buffer = stackBuffer; |
| 3259 | size_t offset = 0; |
| 3260 | size_t size = 614; |
| 3261 | bool fixedBuffer = true; |
| 3262 | |
| 3263 | bool success = true; |
| 3264 | success &= WriteToBuffer(MethodBeingCompiledNamespace, buffer, offset, size, fixedBuffer); |
| 3265 | success &= WriteToBuffer(MethodBeingCompiledName, buffer, offset, size, fixedBuffer); |
| 3266 | success &= WriteToBuffer(MethodBeingCompiledNameSignature, buffer, offset, size, fixedBuffer); |
| 3267 | success &= WriteToBuffer(InlinerNamespace, buffer, offset, size, fixedBuffer); |
| 3268 | success &= WriteToBuffer(InlinerName, buffer, offset, size, fixedBuffer); |
| 3269 | success &= WriteToBuffer(InlinerNameSignature, buffer, offset, size, fixedBuffer); |
| 3270 | success &= WriteToBuffer(InlineeNamespace, buffer, offset, size, fixedBuffer); |
| 3271 | success &= WriteToBuffer(InlineeName, buffer, offset, size, fixedBuffer); |
| 3272 | success &= WriteToBuffer(InlineeNameSignature, buffer, offset, size, fixedBuffer); |
| 3273 | success &= WriteToBuffer(FailAlways, buffer, offset, size, fixedBuffer); |
| 3274 | success &= WriteToBuffer(FailReason, buffer, offset, size, fixedBuffer); |
| 3275 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3276 | |
| 3277 | if (!success) |
| 3278 | { |
| 3279 | if (!fixedBuffer) |
| 3280 | delete[] buffer; |
| 3281 | return ERROR_WRITE_FAULT; |
| 3282 | } |
| 3283 | |
| 3284 | do_tracepoint(DotNETRuntime, MethodJitInliningFailedAnsi, offset, buffer); |
| 3285 | |
| 3286 | if (!fixedBuffer) |
| 3287 | delete[] buffer; |
| 3288 | |
| 3289 | return ERROR_SUCCESS; |
| 3290 | } |
| 3291 | |
| 3292 | extern "C" BOOL EventXplatEnabledMethodJitTailCallSucceeded(){ return tracepoint_enabled(DotNETRuntime, MethodJitTailCallSucceeded); } |
| 3293 | |
| 3294 | extern "C" ULONG FireEtXplatMethodJitTailCallSucceeded( |
| 3295 | PCWSTR MethodBeingCompiledNamespace, |
| 3296 | PCWSTR MethodBeingCompiledName, |
| 3297 | PCWSTR MethodBeingCompiledNameSignature, |
| 3298 | PCWSTR CallerNamespace, |
| 3299 | PCWSTR CallerName, |
| 3300 | PCWSTR CallerNameSignature, |
| 3301 | PCWSTR CalleeNamespace, |
| 3302 | PCWSTR CalleeName, |
| 3303 | PCWSTR CalleeNameSignature, |
| 3304 | const BOOL TailPrefix, |
| 3305 | const unsigned int TailCallType, |
| 3306 | const unsigned short ClrInstanceID) |
| 3307 | { |
| 3308 | if (!EventXplatEnabledMethodJitTailCallSucceeded()) |
| 3309 | return ERROR_SUCCESS; |
| 3310 | |
| 3311 | char stackBuffer[586]; |
| 3312 | char *buffer = stackBuffer; |
| 3313 | size_t offset = 0; |
| 3314 | size_t size = 586; |
| 3315 | bool fixedBuffer = true; |
| 3316 | |
| 3317 | bool success = true; |
| 3318 | success &= WriteToBuffer(MethodBeingCompiledNamespace, buffer, offset, size, fixedBuffer); |
| 3319 | success &= WriteToBuffer(MethodBeingCompiledName, buffer, offset, size, fixedBuffer); |
| 3320 | success &= WriteToBuffer(MethodBeingCompiledNameSignature, buffer, offset, size, fixedBuffer); |
| 3321 | success &= WriteToBuffer(CallerNamespace, buffer, offset, size, fixedBuffer); |
| 3322 | success &= WriteToBuffer(CallerName, buffer, offset, size, fixedBuffer); |
| 3323 | success &= WriteToBuffer(CallerNameSignature, buffer, offset, size, fixedBuffer); |
| 3324 | success &= WriteToBuffer(CalleeNamespace, buffer, offset, size, fixedBuffer); |
| 3325 | success &= WriteToBuffer(CalleeName, buffer, offset, size, fixedBuffer); |
| 3326 | success &= WriteToBuffer(CalleeNameSignature, buffer, offset, size, fixedBuffer); |
| 3327 | success &= WriteToBuffer(TailPrefix, buffer, offset, size, fixedBuffer); |
| 3328 | success &= WriteToBuffer(TailCallType, buffer, offset, size, fixedBuffer); |
| 3329 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3330 | |
| 3331 | if (!success) |
| 3332 | { |
| 3333 | if (!fixedBuffer) |
| 3334 | delete[] buffer; |
| 3335 | return ERROR_WRITE_FAULT; |
| 3336 | } |
| 3337 | |
| 3338 | do_tracepoint(DotNETRuntime, MethodJitTailCallSucceeded, offset, buffer); |
| 3339 | |
| 3340 | if (!fixedBuffer) |
| 3341 | delete[] buffer; |
| 3342 | |
| 3343 | return ERROR_SUCCESS; |
| 3344 | } |
| 3345 | |
| 3346 | extern "C" BOOL EventXplatEnabledMethodJitTailCallFailedAnsi(){ return tracepoint_enabled(DotNETRuntime, MethodJitTailCallFailedAnsi); } |
| 3347 | |
| 3348 | extern "C" ULONG FireEtXplatMethodJitTailCallFailedAnsi( |
| 3349 | PCWSTR MethodBeingCompiledNamespace, |
| 3350 | PCWSTR MethodBeingCompiledName, |
| 3351 | PCWSTR MethodBeingCompiledNameSignature, |
| 3352 | PCWSTR CallerNamespace, |
| 3353 | PCWSTR CallerName, |
| 3354 | PCWSTR CallerNameSignature, |
| 3355 | PCWSTR CalleeNamespace, |
| 3356 | PCWSTR CalleeName, |
| 3357 | PCWSTR CalleeNameSignature, |
| 3358 | const BOOL TailPrefix, |
| 3359 | LPCSTR FailReason, |
| 3360 | const unsigned short ClrInstanceID) |
| 3361 | { |
| 3362 | if (!EventXplatEnabledMethodJitTailCallFailedAnsi()) |
| 3363 | return ERROR_SUCCESS; |
| 3364 | |
| 3365 | char stackBuffer[614]; |
| 3366 | char *buffer = stackBuffer; |
| 3367 | size_t offset = 0; |
| 3368 | size_t size = 614; |
| 3369 | bool fixedBuffer = true; |
| 3370 | |
| 3371 | bool success = true; |
| 3372 | success &= WriteToBuffer(MethodBeingCompiledNamespace, buffer, offset, size, fixedBuffer); |
| 3373 | success &= WriteToBuffer(MethodBeingCompiledName, buffer, offset, size, fixedBuffer); |
| 3374 | success &= WriteToBuffer(MethodBeingCompiledNameSignature, buffer, offset, size, fixedBuffer); |
| 3375 | success &= WriteToBuffer(CallerNamespace, buffer, offset, size, fixedBuffer); |
| 3376 | success &= WriteToBuffer(CallerName, buffer, offset, size, fixedBuffer); |
| 3377 | success &= WriteToBuffer(CallerNameSignature, buffer, offset, size, fixedBuffer); |
| 3378 | success &= WriteToBuffer(CalleeNamespace, buffer, offset, size, fixedBuffer); |
| 3379 | success &= WriteToBuffer(CalleeName, buffer, offset, size, fixedBuffer); |
| 3380 | success &= WriteToBuffer(CalleeNameSignature, buffer, offset, size, fixedBuffer); |
| 3381 | success &= WriteToBuffer(TailPrefix, buffer, offset, size, fixedBuffer); |
| 3382 | success &= WriteToBuffer(FailReason, buffer, offset, size, fixedBuffer); |
| 3383 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3384 | |
| 3385 | if (!success) |
| 3386 | { |
| 3387 | if (!fixedBuffer) |
| 3388 | delete[] buffer; |
| 3389 | return ERROR_WRITE_FAULT; |
| 3390 | } |
| 3391 | |
| 3392 | do_tracepoint(DotNETRuntime, MethodJitTailCallFailedAnsi, offset, buffer); |
| 3393 | |
| 3394 | if (!fixedBuffer) |
| 3395 | delete[] buffer; |
| 3396 | |
| 3397 | return ERROR_SUCCESS; |
| 3398 | } |
| 3399 | |
| 3400 | extern "C" BOOL EventXplatEnabledMethodILToNativeMap(){ return tracepoint_enabled(DotNETRuntime, MethodILToNativeMap); } |
| 3401 | |
| 3402 | extern "C" ULONG FireEtXplatMethodILToNativeMap( |
| 3403 | const unsigned __int64 MethodID, |
| 3404 | const unsigned __int64 ReJITID, |
| 3405 | const unsigned char MethodExtent, |
| 3406 | const unsigned short CountOfMapEntries, |
| 3407 | const unsigned int* ILOffsets, |
| 3408 | const unsigned int* NativeOffsets, |
| 3409 | const unsigned short ClrInstanceID) |
| 3410 | { |
| 3411 | if (!EventXplatEnabledMethodILToNativeMap()) |
| 3412 | return ERROR_SUCCESS; |
| 3413 | |
| 3414 | char stackBuffer[32]; |
| 3415 | char *buffer = stackBuffer; |
| 3416 | size_t offset = 0; |
| 3417 | size_t size = 32; |
| 3418 | bool fixedBuffer = true; |
| 3419 | |
| 3420 | bool success = true; |
| 3421 | success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer); |
| 3422 | success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer); |
| 3423 | success &= WriteToBuffer(MethodExtent, buffer, offset, size, fixedBuffer); |
| 3424 | success &= WriteToBuffer(CountOfMapEntries, buffer, offset, size, fixedBuffer); |
| 3425 | success &= WriteToBuffer((const BYTE *)ILOffsets, sizeof(const unsigned int) * (int)CountOfMapEntries, buffer, offset, size, fixedBuffer); |
| 3426 | success &= WriteToBuffer((const BYTE *)NativeOffsets, sizeof(const unsigned int) * (int)CountOfMapEntries, buffer, offset, size, fixedBuffer); |
| 3427 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3428 | |
| 3429 | if (!success) |
| 3430 | { |
| 3431 | if (!fixedBuffer) |
| 3432 | delete[] buffer; |
| 3433 | return ERROR_WRITE_FAULT; |
| 3434 | } |
| 3435 | |
| 3436 | do_tracepoint(DotNETRuntime, MethodILToNativeMap, offset, buffer); |
| 3437 | |
| 3438 | if (!fixedBuffer) |
| 3439 | delete[] buffer; |
| 3440 | |
| 3441 | return ERROR_SUCCESS; |
| 3442 | } |
| 3443 | |
| 3444 | extern "C" BOOL EventXplatEnabledMethodJitTailCallFailed(){ return tracepoint_enabled(DotNETRuntime, MethodJitTailCallFailed); } |
| 3445 | |
| 3446 | extern "C" ULONG FireEtXplatMethodJitTailCallFailed( |
| 3447 | PCWSTR MethodBeingCompiledNamespace, |
| 3448 | PCWSTR MethodBeingCompiledName, |
| 3449 | PCWSTR MethodBeingCompiledNameSignature, |
| 3450 | PCWSTR CallerNamespace, |
| 3451 | PCWSTR CallerName, |
| 3452 | PCWSTR CallerNameSignature, |
| 3453 | PCWSTR CalleeNamespace, |
| 3454 | PCWSTR CalleeName, |
| 3455 | PCWSTR CalleeNameSignature, |
| 3456 | const BOOL TailPrefix, |
| 3457 | PCWSTR FailReason, |
| 3458 | const unsigned short ClrInstanceID) |
| 3459 | { |
| 3460 | if (!EventXplatEnabledMethodJitTailCallFailed()) |
| 3461 | return ERROR_SUCCESS; |
| 3462 | |
| 3463 | char stackBuffer[646]; |
| 3464 | char *buffer = stackBuffer; |
| 3465 | size_t offset = 0; |
| 3466 | size_t size = 646; |
| 3467 | bool fixedBuffer = true; |
| 3468 | |
| 3469 | bool success = true; |
| 3470 | success &= WriteToBuffer(MethodBeingCompiledNamespace, buffer, offset, size, fixedBuffer); |
| 3471 | success &= WriteToBuffer(MethodBeingCompiledName, buffer, offset, size, fixedBuffer); |
| 3472 | success &= WriteToBuffer(MethodBeingCompiledNameSignature, buffer, offset, size, fixedBuffer); |
| 3473 | success &= WriteToBuffer(CallerNamespace, buffer, offset, size, fixedBuffer); |
| 3474 | success &= WriteToBuffer(CallerName, buffer, offset, size, fixedBuffer); |
| 3475 | success &= WriteToBuffer(CallerNameSignature, buffer, offset, size, fixedBuffer); |
| 3476 | success &= WriteToBuffer(CalleeNamespace, buffer, offset, size, fixedBuffer); |
| 3477 | success &= WriteToBuffer(CalleeName, buffer, offset, size, fixedBuffer); |
| 3478 | success &= WriteToBuffer(CalleeNameSignature, buffer, offset, size, fixedBuffer); |
| 3479 | success &= WriteToBuffer(TailPrefix, buffer, offset, size, fixedBuffer); |
| 3480 | success &= WriteToBuffer(FailReason, buffer, offset, size, fixedBuffer); |
| 3481 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3482 | |
| 3483 | if (!success) |
| 3484 | { |
| 3485 | if (!fixedBuffer) |
| 3486 | delete[] buffer; |
| 3487 | return ERROR_WRITE_FAULT; |
| 3488 | } |
| 3489 | |
| 3490 | do_tracepoint(DotNETRuntime, MethodJitTailCallFailed, offset, buffer); |
| 3491 | |
| 3492 | if (!fixedBuffer) |
| 3493 | delete[] buffer; |
| 3494 | |
| 3495 | return ERROR_SUCCESS; |
| 3496 | } |
| 3497 | |
| 3498 | extern "C" BOOL EventXplatEnabledMethodJitInliningFailed(){ return tracepoint_enabled(DotNETRuntime, MethodJitInliningFailed); } |
| 3499 | |
| 3500 | extern "C" ULONG FireEtXplatMethodJitInliningFailed( |
| 3501 | PCWSTR MethodBeingCompiledNamespace, |
| 3502 | PCWSTR MethodBeingCompiledName, |
| 3503 | PCWSTR MethodBeingCompiledNameSignature, |
| 3504 | PCWSTR InlinerNamespace, |
| 3505 | PCWSTR InlinerName, |
| 3506 | PCWSTR InlinerNameSignature, |
| 3507 | PCWSTR InlineeNamespace, |
| 3508 | PCWSTR InlineeName, |
| 3509 | PCWSTR InlineeNameSignature, |
| 3510 | const BOOL FailAlways, |
| 3511 | PCWSTR FailReason, |
| 3512 | const unsigned short ClrInstanceID) |
| 3513 | { |
| 3514 | if (!EventXplatEnabledMethodJitInliningFailed()) |
| 3515 | return ERROR_SUCCESS; |
| 3516 | |
| 3517 | char stackBuffer[646]; |
| 3518 | char *buffer = stackBuffer; |
| 3519 | size_t offset = 0; |
| 3520 | size_t size = 646; |
| 3521 | bool fixedBuffer = true; |
| 3522 | |
| 3523 | bool success = true; |
| 3524 | success &= WriteToBuffer(MethodBeingCompiledNamespace, buffer, offset, size, fixedBuffer); |
| 3525 | success &= WriteToBuffer(MethodBeingCompiledName, buffer, offset, size, fixedBuffer); |
| 3526 | success &= WriteToBuffer(MethodBeingCompiledNameSignature, buffer, offset, size, fixedBuffer); |
| 3527 | success &= WriteToBuffer(InlinerNamespace, buffer, offset, size, fixedBuffer); |
| 3528 | success &= WriteToBuffer(InlinerName, buffer, offset, size, fixedBuffer); |
| 3529 | success &= WriteToBuffer(InlinerNameSignature, buffer, offset, size, fixedBuffer); |
| 3530 | success &= WriteToBuffer(InlineeNamespace, buffer, offset, size, fixedBuffer); |
| 3531 | success &= WriteToBuffer(InlineeName, buffer, offset, size, fixedBuffer); |
| 3532 | success &= WriteToBuffer(InlineeNameSignature, buffer, offset, size, fixedBuffer); |
| 3533 | success &= WriteToBuffer(FailAlways, buffer, offset, size, fixedBuffer); |
| 3534 | success &= WriteToBuffer(FailReason, buffer, offset, size, fixedBuffer); |
| 3535 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3536 | |
| 3537 | if (!success) |
| 3538 | { |
| 3539 | if (!fixedBuffer) |
| 3540 | delete[] buffer; |
| 3541 | return ERROR_WRITE_FAULT; |
| 3542 | } |
| 3543 | |
| 3544 | do_tracepoint(DotNETRuntime, MethodJitInliningFailed, offset, buffer); |
| 3545 | |
| 3546 | if (!fixedBuffer) |
| 3547 | delete[] buffer; |
| 3548 | |
| 3549 | return ERROR_SUCCESS; |
| 3550 | } |
| 3551 | |
| 3552 | extern "C" BOOL EventXplatEnabledModuleDCStartV2(){ return tracepoint_enabled(DotNETRuntime, ModuleDCStartV2); } |
| 3553 | |
| 3554 | extern "C" ULONG FireEtXplatModuleDCStartV2( |
| 3555 | const unsigned __int64 ModuleID, |
| 3556 | const unsigned __int64 AssemblyID, |
| 3557 | const unsigned int ModuleFlags, |
| 3558 | const unsigned int Reserved1, |
| 3559 | PCWSTR ModuleILPath, |
| 3560 | PCWSTR ModuleNativePath) |
| 3561 | { |
| 3562 | if (!EventXplatEnabledModuleDCStartV2()) |
| 3563 | return ERROR_SUCCESS; |
| 3564 | INT ModuleILPath_path_size = -1; |
| 3565 | PathCharString ModuleILPath_PS; |
| 3566 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3567 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3568 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3569 | INT ModuleNativePath_path_size = -1; |
| 3570 | PathCharString ModuleNativePath_PS; |
| 3571 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3572 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3573 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3574 | |
| 3575 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3576 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3577 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3578 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3579 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3580 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3581 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3582 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3583 | do_tracepoint(DotNETRuntime, |
| 3584 | ModuleDCStartV2, |
| 3585 | ModuleID, |
| 3586 | AssemblyID, |
| 3587 | ModuleFlags, |
| 3588 | Reserved1, |
| 3589 | ModuleILPath_full_name, |
| 3590 | ModuleNativePath_full_name); |
| 3591 | |
| 3592 | return ERROR_SUCCESS; |
| 3593 | } |
| 3594 | |
| 3595 | extern "C" BOOL EventXplatEnabledModuleDCEndV2(){ return tracepoint_enabled(DotNETRuntime, ModuleDCEndV2); } |
| 3596 | |
| 3597 | extern "C" ULONG FireEtXplatModuleDCEndV2( |
| 3598 | const unsigned __int64 ModuleID, |
| 3599 | const unsigned __int64 AssemblyID, |
| 3600 | const unsigned int ModuleFlags, |
| 3601 | const unsigned int Reserved1, |
| 3602 | PCWSTR ModuleILPath, |
| 3603 | PCWSTR ModuleNativePath) |
| 3604 | { |
| 3605 | if (!EventXplatEnabledModuleDCEndV2()) |
| 3606 | return ERROR_SUCCESS; |
| 3607 | INT ModuleILPath_path_size = -1; |
| 3608 | PathCharString ModuleILPath_PS; |
| 3609 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3610 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3611 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3612 | INT ModuleNativePath_path_size = -1; |
| 3613 | PathCharString ModuleNativePath_PS; |
| 3614 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3615 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3616 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3617 | |
| 3618 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3619 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3620 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3621 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3622 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3623 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3624 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3625 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3626 | do_tracepoint(DotNETRuntime, |
| 3627 | ModuleDCEndV2, |
| 3628 | ModuleID, |
| 3629 | AssemblyID, |
| 3630 | ModuleFlags, |
| 3631 | Reserved1, |
| 3632 | ModuleILPath_full_name, |
| 3633 | ModuleNativePath_full_name); |
| 3634 | |
| 3635 | return ERROR_SUCCESS; |
| 3636 | } |
| 3637 | |
| 3638 | extern "C" BOOL EventXplatEnabledDomainModuleLoad(){ return tracepoint_enabled(DotNETRuntime, DomainModuleLoad); } |
| 3639 | |
| 3640 | extern "C" ULONG FireEtXplatDomainModuleLoad( |
| 3641 | const unsigned __int64 ModuleID, |
| 3642 | const unsigned __int64 AssemblyID, |
| 3643 | const unsigned __int64 AppDomainID, |
| 3644 | const unsigned int ModuleFlags, |
| 3645 | const unsigned int Reserved1, |
| 3646 | PCWSTR ModuleILPath, |
| 3647 | PCWSTR ModuleNativePath) |
| 3648 | { |
| 3649 | if (!EventXplatEnabledDomainModuleLoad()) |
| 3650 | return ERROR_SUCCESS; |
| 3651 | INT ModuleILPath_path_size = -1; |
| 3652 | PathCharString ModuleILPath_PS; |
| 3653 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3654 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3655 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3656 | INT ModuleNativePath_path_size = -1; |
| 3657 | PathCharString ModuleNativePath_PS; |
| 3658 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3659 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3660 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3661 | |
| 3662 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3663 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3664 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3665 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3666 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3667 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3668 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3669 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3670 | do_tracepoint(DotNETRuntime, |
| 3671 | DomainModuleLoad, |
| 3672 | ModuleID, |
| 3673 | AssemblyID, |
| 3674 | AppDomainID, |
| 3675 | ModuleFlags, |
| 3676 | Reserved1, |
| 3677 | ModuleILPath_full_name, |
| 3678 | ModuleNativePath_full_name); |
| 3679 | |
| 3680 | return ERROR_SUCCESS; |
| 3681 | } |
| 3682 | |
| 3683 | extern "C" BOOL EventXplatEnabledDomainModuleLoad_V1(){ return tracepoint_enabled(DotNETRuntime, DomainModuleLoad_V1); } |
| 3684 | |
| 3685 | extern "C" ULONG FireEtXplatDomainModuleLoad_V1( |
| 3686 | const unsigned __int64 ModuleID, |
| 3687 | const unsigned __int64 AssemblyID, |
| 3688 | const unsigned __int64 AppDomainID, |
| 3689 | const unsigned int ModuleFlags, |
| 3690 | const unsigned int Reserved1, |
| 3691 | PCWSTR ModuleILPath, |
| 3692 | PCWSTR ModuleNativePath, |
| 3693 | const unsigned short ClrInstanceID) |
| 3694 | { |
| 3695 | if (!EventXplatEnabledDomainModuleLoad_V1()) |
| 3696 | return ERROR_SUCCESS; |
| 3697 | INT ModuleILPath_path_size = -1; |
| 3698 | PathCharString ModuleILPath_PS; |
| 3699 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3700 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3701 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3702 | INT ModuleNativePath_path_size = -1; |
| 3703 | PathCharString ModuleNativePath_PS; |
| 3704 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3705 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3706 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3707 | |
| 3708 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3709 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3710 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3711 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3712 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3713 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3714 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3715 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3716 | do_tracepoint(DotNETRuntime, |
| 3717 | DomainModuleLoad_V1, |
| 3718 | ModuleID, |
| 3719 | AssemblyID, |
| 3720 | AppDomainID, |
| 3721 | ModuleFlags, |
| 3722 | Reserved1, |
| 3723 | ModuleILPath_full_name, |
| 3724 | ModuleNativePath_full_name, |
| 3725 | ClrInstanceID); |
| 3726 | |
| 3727 | return ERROR_SUCCESS; |
| 3728 | } |
| 3729 | |
| 3730 | extern "C" BOOL EventXplatEnabledModuleLoad(){ return tracepoint_enabled(DotNETRuntime, ModuleLoad); } |
| 3731 | |
| 3732 | extern "C" ULONG FireEtXplatModuleLoad( |
| 3733 | const unsigned __int64 ModuleID, |
| 3734 | const unsigned __int64 AssemblyID, |
| 3735 | const unsigned int ModuleFlags, |
| 3736 | const unsigned int Reserved1, |
| 3737 | PCWSTR ModuleILPath, |
| 3738 | PCWSTR ModuleNativePath) |
| 3739 | { |
| 3740 | if (!EventXplatEnabledModuleLoad()) |
| 3741 | return ERROR_SUCCESS; |
| 3742 | INT ModuleILPath_path_size = -1; |
| 3743 | PathCharString ModuleILPath_PS; |
| 3744 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3745 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3746 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3747 | INT ModuleNativePath_path_size = -1; |
| 3748 | PathCharString ModuleNativePath_PS; |
| 3749 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3750 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3751 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3752 | |
| 3753 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3754 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3755 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3756 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3757 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3758 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3759 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3760 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3761 | do_tracepoint(DotNETRuntime, |
| 3762 | ModuleLoad, |
| 3763 | ModuleID, |
| 3764 | AssemblyID, |
| 3765 | ModuleFlags, |
| 3766 | Reserved1, |
| 3767 | ModuleILPath_full_name, |
| 3768 | ModuleNativePath_full_name); |
| 3769 | |
| 3770 | return ERROR_SUCCESS; |
| 3771 | } |
| 3772 | |
| 3773 | extern "C" BOOL EventXplatEnabledModuleLoad_V1(){ return tracepoint_enabled(DotNETRuntime, ModuleLoad_V1); } |
| 3774 | |
| 3775 | extern "C" ULONG FireEtXplatModuleLoad_V1( |
| 3776 | const unsigned __int64 ModuleID, |
| 3777 | const unsigned __int64 AssemblyID, |
| 3778 | const unsigned int ModuleFlags, |
| 3779 | const unsigned int Reserved1, |
| 3780 | PCWSTR ModuleILPath, |
| 3781 | PCWSTR ModuleNativePath, |
| 3782 | const unsigned short ClrInstanceID) |
| 3783 | { |
| 3784 | if (!EventXplatEnabledModuleLoad_V1()) |
| 3785 | return ERROR_SUCCESS; |
| 3786 | INT ModuleILPath_path_size = -1; |
| 3787 | PathCharString ModuleILPath_PS; |
| 3788 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3789 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3790 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3791 | INT ModuleNativePath_path_size = -1; |
| 3792 | PathCharString ModuleNativePath_PS; |
| 3793 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3794 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3795 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3796 | |
| 3797 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3798 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3799 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3800 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3801 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3802 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3803 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3804 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3805 | do_tracepoint(DotNETRuntime, |
| 3806 | ModuleLoad_V1, |
| 3807 | ModuleID, |
| 3808 | AssemblyID, |
| 3809 | ModuleFlags, |
| 3810 | Reserved1, |
| 3811 | ModuleILPath_full_name, |
| 3812 | ModuleNativePath_full_name, |
| 3813 | ClrInstanceID); |
| 3814 | |
| 3815 | return ERROR_SUCCESS; |
| 3816 | } |
| 3817 | |
| 3818 | extern "C" BOOL EventXplatEnabledModuleLoad_V2(){ return tracepoint_enabled(DotNETRuntime, ModuleLoad_V2); } |
| 3819 | |
| 3820 | extern "C" ULONG FireEtXplatModuleLoad_V2( |
| 3821 | const unsigned __int64 ModuleID, |
| 3822 | const unsigned __int64 AssemblyID, |
| 3823 | const unsigned int ModuleFlags, |
| 3824 | const unsigned int Reserved1, |
| 3825 | PCWSTR ModuleILPath, |
| 3826 | PCWSTR ModuleNativePath, |
| 3827 | const unsigned short ClrInstanceID, |
| 3828 | const GUID* ManagedPdbSignature, |
| 3829 | const unsigned int ManagedPdbAge, |
| 3830 | PCWSTR ManagedPdbBuildPath, |
| 3831 | const GUID* NativePdbSignature, |
| 3832 | const unsigned int NativePdbAge, |
| 3833 | PCWSTR NativePdbBuildPath) |
| 3834 | { |
| 3835 | if (!EventXplatEnabledModuleLoad_V2()) |
| 3836 | return ERROR_SUCCESS; |
| 3837 | |
| 3838 | char stackBuffer[290]; |
| 3839 | char *buffer = stackBuffer; |
| 3840 | size_t offset = 0; |
| 3841 | size_t size = 290; |
| 3842 | bool fixedBuffer = true; |
| 3843 | |
| 3844 | bool success = true; |
| 3845 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 3846 | success &= WriteToBuffer(AssemblyID, buffer, offset, size, fixedBuffer); |
| 3847 | success &= WriteToBuffer(ModuleFlags, buffer, offset, size, fixedBuffer); |
| 3848 | success &= WriteToBuffer(Reserved1, buffer, offset, size, fixedBuffer); |
| 3849 | success &= WriteToBuffer(ModuleILPath, buffer, offset, size, fixedBuffer); |
| 3850 | success &= WriteToBuffer(ModuleNativePath, buffer, offset, size, fixedBuffer); |
| 3851 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3852 | success &= WriteToBuffer(*ManagedPdbSignature, buffer, offset, size, fixedBuffer); |
| 3853 | success &= WriteToBuffer(ManagedPdbAge, buffer, offset, size, fixedBuffer); |
| 3854 | success &= WriteToBuffer(ManagedPdbBuildPath, buffer, offset, size, fixedBuffer); |
| 3855 | success &= WriteToBuffer(*NativePdbSignature, buffer, offset, size, fixedBuffer); |
| 3856 | success &= WriteToBuffer(NativePdbAge, buffer, offset, size, fixedBuffer); |
| 3857 | success &= WriteToBuffer(NativePdbBuildPath, buffer, offset, size, fixedBuffer); |
| 3858 | |
| 3859 | if (!success) |
| 3860 | { |
| 3861 | if (!fixedBuffer) |
| 3862 | delete[] buffer; |
| 3863 | return ERROR_WRITE_FAULT; |
| 3864 | } |
| 3865 | |
| 3866 | do_tracepoint(DotNETRuntime, ModuleLoad_V2, offset, buffer); |
| 3867 | |
| 3868 | if (!fixedBuffer) |
| 3869 | delete[] buffer; |
| 3870 | |
| 3871 | return ERROR_SUCCESS; |
| 3872 | } |
| 3873 | |
| 3874 | extern "C" BOOL EventXplatEnabledModuleUnload(){ return tracepoint_enabled(DotNETRuntime, ModuleUnload); } |
| 3875 | |
| 3876 | extern "C" ULONG FireEtXplatModuleUnload( |
| 3877 | const unsigned __int64 ModuleID, |
| 3878 | const unsigned __int64 AssemblyID, |
| 3879 | const unsigned int ModuleFlags, |
| 3880 | const unsigned int Reserved1, |
| 3881 | PCWSTR ModuleILPath, |
| 3882 | PCWSTR ModuleNativePath) |
| 3883 | { |
| 3884 | if (!EventXplatEnabledModuleUnload()) |
| 3885 | return ERROR_SUCCESS; |
| 3886 | INT ModuleILPath_path_size = -1; |
| 3887 | PathCharString ModuleILPath_PS; |
| 3888 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3889 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3890 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3891 | INT ModuleNativePath_path_size = -1; |
| 3892 | PathCharString ModuleNativePath_PS; |
| 3893 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3894 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3895 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3896 | |
| 3897 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3898 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3899 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3900 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3901 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3902 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3903 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3904 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3905 | do_tracepoint(DotNETRuntime, |
| 3906 | ModuleUnload, |
| 3907 | ModuleID, |
| 3908 | AssemblyID, |
| 3909 | ModuleFlags, |
| 3910 | Reserved1, |
| 3911 | ModuleILPath_full_name, |
| 3912 | ModuleNativePath_full_name); |
| 3913 | |
| 3914 | return ERROR_SUCCESS; |
| 3915 | } |
| 3916 | |
| 3917 | extern "C" BOOL EventXplatEnabledModuleUnload_V1(){ return tracepoint_enabled(DotNETRuntime, ModuleUnload_V1); } |
| 3918 | |
| 3919 | extern "C" ULONG FireEtXplatModuleUnload_V1( |
| 3920 | const unsigned __int64 ModuleID, |
| 3921 | const unsigned __int64 AssemblyID, |
| 3922 | const unsigned int ModuleFlags, |
| 3923 | const unsigned int Reserved1, |
| 3924 | PCWSTR ModuleILPath, |
| 3925 | PCWSTR ModuleNativePath, |
| 3926 | const unsigned short ClrInstanceID) |
| 3927 | { |
| 3928 | if (!EventXplatEnabledModuleUnload_V1()) |
| 3929 | return ERROR_SUCCESS; |
| 3930 | INT ModuleILPath_path_size = -1; |
| 3931 | PathCharString ModuleILPath_PS; |
| 3932 | INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR); |
| 3933 | CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size ); |
| 3934 | if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3935 | INT ModuleNativePath_path_size = -1; |
| 3936 | PathCharString ModuleNativePath_PS; |
| 3937 | INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR); |
| 3938 | CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size ); |
| 3939 | if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 3940 | |
| 3941 | ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL ); |
| 3942 | _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size ); |
| 3943 | ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size ); |
| 3944 | if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3945 | ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL ); |
| 3946 | _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size ); |
| 3947 | ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size ); |
| 3948 | if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 3949 | do_tracepoint(DotNETRuntime, |
| 3950 | ModuleUnload_V1, |
| 3951 | ModuleID, |
| 3952 | AssemblyID, |
| 3953 | ModuleFlags, |
| 3954 | Reserved1, |
| 3955 | ModuleILPath_full_name, |
| 3956 | ModuleNativePath_full_name, |
| 3957 | ClrInstanceID); |
| 3958 | |
| 3959 | return ERROR_SUCCESS; |
| 3960 | } |
| 3961 | |
| 3962 | extern "C" BOOL EventXplatEnabledModuleUnload_V2(){ return tracepoint_enabled(DotNETRuntime, ModuleUnload_V2); } |
| 3963 | |
| 3964 | extern "C" ULONG FireEtXplatModuleUnload_V2( |
| 3965 | const unsigned __int64 ModuleID, |
| 3966 | const unsigned __int64 AssemblyID, |
| 3967 | const unsigned int ModuleFlags, |
| 3968 | const unsigned int Reserved1, |
| 3969 | PCWSTR ModuleILPath, |
| 3970 | PCWSTR ModuleNativePath, |
| 3971 | const unsigned short ClrInstanceID, |
| 3972 | const GUID* ManagedPdbSignature, |
| 3973 | const unsigned int ManagedPdbAge, |
| 3974 | PCWSTR ManagedPdbBuildPath, |
| 3975 | const GUID* NativePdbSignature, |
| 3976 | const unsigned int NativePdbAge, |
| 3977 | PCWSTR NativePdbBuildPath) |
| 3978 | { |
| 3979 | if (!EventXplatEnabledModuleUnload_V2()) |
| 3980 | return ERROR_SUCCESS; |
| 3981 | |
| 3982 | char stackBuffer[290]; |
| 3983 | char *buffer = stackBuffer; |
| 3984 | size_t offset = 0; |
| 3985 | size_t size = 290; |
| 3986 | bool fixedBuffer = true; |
| 3987 | |
| 3988 | bool success = true; |
| 3989 | success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer); |
| 3990 | success &= WriteToBuffer(AssemblyID, buffer, offset, size, fixedBuffer); |
| 3991 | success &= WriteToBuffer(ModuleFlags, buffer, offset, size, fixedBuffer); |
| 3992 | success &= WriteToBuffer(Reserved1, buffer, offset, size, fixedBuffer); |
| 3993 | success &= WriteToBuffer(ModuleILPath, buffer, offset, size, fixedBuffer); |
| 3994 | success &= WriteToBuffer(ModuleNativePath, buffer, offset, size, fixedBuffer); |
| 3995 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 3996 | success &= WriteToBuffer(*ManagedPdbSignature, buffer, offset, size, fixedBuffer); |
| 3997 | success &= WriteToBuffer(ManagedPdbAge, buffer, offset, size, fixedBuffer); |
| 3998 | success &= WriteToBuffer(ManagedPdbBuildPath, buffer, offset, size, fixedBuffer); |
| 3999 | success &= WriteToBuffer(*NativePdbSignature, buffer, offset, size, fixedBuffer); |
| 4000 | success &= WriteToBuffer(NativePdbAge, buffer, offset, size, fixedBuffer); |
| 4001 | success &= WriteToBuffer(NativePdbBuildPath, buffer, offset, size, fixedBuffer); |
| 4002 | |
| 4003 | if (!success) |
| 4004 | { |
| 4005 | if (!fixedBuffer) |
| 4006 | delete[] buffer; |
| 4007 | return ERROR_WRITE_FAULT; |
| 4008 | } |
| 4009 | |
| 4010 | do_tracepoint(DotNETRuntime, ModuleUnload_V2, offset, buffer); |
| 4011 | |
| 4012 | if (!fixedBuffer) |
| 4013 | delete[] buffer; |
| 4014 | |
| 4015 | return ERROR_SUCCESS; |
| 4016 | } |
| 4017 | |
| 4018 | extern "C" BOOL EventXplatEnabledAssemblyLoad(){ return tracepoint_enabled(DotNETRuntime, AssemblyLoad); } |
| 4019 | |
| 4020 | extern "C" ULONG FireEtXplatAssemblyLoad( |
| 4021 | const unsigned __int64 AssemblyID, |
| 4022 | const unsigned __int64 AppDomainID, |
| 4023 | const unsigned int AssemblyFlags, |
| 4024 | PCWSTR FullyQualifiedAssemblyName) |
| 4025 | { |
| 4026 | if (!EventXplatEnabledAssemblyLoad()) |
| 4027 | return ERROR_SUCCESS; |
| 4028 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4029 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4030 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4031 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4032 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4033 | |
| 4034 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4035 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4036 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4037 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4038 | do_tracepoint(DotNETRuntime, |
| 4039 | AssemblyLoad, |
| 4040 | AssemblyID, |
| 4041 | AppDomainID, |
| 4042 | AssemblyFlags, |
| 4043 | FullyQualifiedAssemblyName_full_name); |
| 4044 | |
| 4045 | return ERROR_SUCCESS; |
| 4046 | } |
| 4047 | |
| 4048 | extern "C" BOOL EventXplatEnabledAssemblyLoad_V1(){ return tracepoint_enabled(DotNETRuntime, AssemblyLoad_V1); } |
| 4049 | |
| 4050 | extern "C" ULONG FireEtXplatAssemblyLoad_V1( |
| 4051 | const unsigned __int64 AssemblyID, |
| 4052 | const unsigned __int64 AppDomainID, |
| 4053 | const unsigned __int64 BindingID, |
| 4054 | const unsigned int AssemblyFlags, |
| 4055 | PCWSTR FullyQualifiedAssemblyName, |
| 4056 | const unsigned short ClrInstanceID) |
| 4057 | { |
| 4058 | if (!EventXplatEnabledAssemblyLoad_V1()) |
| 4059 | return ERROR_SUCCESS; |
| 4060 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4061 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4062 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4063 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4064 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4065 | |
| 4066 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4067 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4068 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4069 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4070 | do_tracepoint(DotNETRuntime, |
| 4071 | AssemblyLoad_V1, |
| 4072 | AssemblyID, |
| 4073 | AppDomainID, |
| 4074 | BindingID, |
| 4075 | AssemblyFlags, |
| 4076 | FullyQualifiedAssemblyName_full_name, |
| 4077 | ClrInstanceID); |
| 4078 | |
| 4079 | return ERROR_SUCCESS; |
| 4080 | } |
| 4081 | |
| 4082 | extern "C" BOOL EventXplatEnabledAssemblyUnload(){ return tracepoint_enabled(DotNETRuntime, AssemblyUnload); } |
| 4083 | |
| 4084 | extern "C" ULONG FireEtXplatAssemblyUnload( |
| 4085 | const unsigned __int64 AssemblyID, |
| 4086 | const unsigned __int64 AppDomainID, |
| 4087 | const unsigned int AssemblyFlags, |
| 4088 | PCWSTR FullyQualifiedAssemblyName) |
| 4089 | { |
| 4090 | if (!EventXplatEnabledAssemblyUnload()) |
| 4091 | return ERROR_SUCCESS; |
| 4092 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4093 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4094 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4095 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4096 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4097 | |
| 4098 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4099 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4100 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4101 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4102 | do_tracepoint(DotNETRuntime, |
| 4103 | AssemblyUnload, |
| 4104 | AssemblyID, |
| 4105 | AppDomainID, |
| 4106 | AssemblyFlags, |
| 4107 | FullyQualifiedAssemblyName_full_name); |
| 4108 | |
| 4109 | return ERROR_SUCCESS; |
| 4110 | } |
| 4111 | |
| 4112 | extern "C" BOOL EventXplatEnabledAssemblyUnload_V1(){ return tracepoint_enabled(DotNETRuntime, AssemblyUnload_V1); } |
| 4113 | |
| 4114 | extern "C" ULONG FireEtXplatAssemblyUnload_V1( |
| 4115 | const unsigned __int64 AssemblyID, |
| 4116 | const unsigned __int64 AppDomainID, |
| 4117 | const unsigned __int64 BindingID, |
| 4118 | const unsigned int AssemblyFlags, |
| 4119 | PCWSTR FullyQualifiedAssemblyName, |
| 4120 | const unsigned short ClrInstanceID) |
| 4121 | { |
| 4122 | if (!EventXplatEnabledAssemblyUnload_V1()) |
| 4123 | return ERROR_SUCCESS; |
| 4124 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4125 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4126 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4127 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4128 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4129 | |
| 4130 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4131 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4132 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4133 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4134 | do_tracepoint(DotNETRuntime, |
| 4135 | AssemblyUnload_V1, |
| 4136 | AssemblyID, |
| 4137 | AppDomainID, |
| 4138 | BindingID, |
| 4139 | AssemblyFlags, |
| 4140 | FullyQualifiedAssemblyName_full_name, |
| 4141 | ClrInstanceID); |
| 4142 | |
| 4143 | return ERROR_SUCCESS; |
| 4144 | } |
| 4145 | |
| 4146 | extern "C" BOOL EventXplatEnabledAppDomainLoad(){ return tracepoint_enabled(DotNETRuntime, AppDomainLoad); } |
| 4147 | |
| 4148 | extern "C" ULONG FireEtXplatAppDomainLoad( |
| 4149 | const unsigned __int64 AppDomainID, |
| 4150 | const unsigned int AppDomainFlags, |
| 4151 | PCWSTR AppDomainName) |
| 4152 | { |
| 4153 | if (!EventXplatEnabledAppDomainLoad()) |
| 4154 | return ERROR_SUCCESS; |
| 4155 | INT AppDomainName_path_size = -1; |
| 4156 | PathCharString AppDomainName_PS; |
| 4157 | INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR); |
| 4158 | CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size ); |
| 4159 | if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4160 | |
| 4161 | AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL ); |
| 4162 | _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size ); |
| 4163 | AppDomainName_PS.CloseBuffer(AppDomainName_path_size ); |
| 4164 | if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4165 | do_tracepoint(DotNETRuntime, |
| 4166 | AppDomainLoad, |
| 4167 | AppDomainID, |
| 4168 | AppDomainFlags, |
| 4169 | AppDomainName_full_name); |
| 4170 | |
| 4171 | return ERROR_SUCCESS; |
| 4172 | } |
| 4173 | |
| 4174 | extern "C" BOOL EventXplatEnabledAppDomainLoad_V1(){ return tracepoint_enabled(DotNETRuntime, AppDomainLoad_V1); } |
| 4175 | |
| 4176 | extern "C" ULONG FireEtXplatAppDomainLoad_V1( |
| 4177 | const unsigned __int64 AppDomainID, |
| 4178 | const unsigned int AppDomainFlags, |
| 4179 | PCWSTR AppDomainName, |
| 4180 | const unsigned int AppDomainIndex, |
| 4181 | const unsigned short ClrInstanceID) |
| 4182 | { |
| 4183 | if (!EventXplatEnabledAppDomainLoad_V1()) |
| 4184 | return ERROR_SUCCESS; |
| 4185 | INT AppDomainName_path_size = -1; |
| 4186 | PathCharString AppDomainName_PS; |
| 4187 | INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR); |
| 4188 | CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size ); |
| 4189 | if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4190 | |
| 4191 | AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL ); |
| 4192 | _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size ); |
| 4193 | AppDomainName_PS.CloseBuffer(AppDomainName_path_size ); |
| 4194 | if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4195 | do_tracepoint(DotNETRuntime, |
| 4196 | AppDomainLoad_V1, |
| 4197 | AppDomainID, |
| 4198 | AppDomainFlags, |
| 4199 | AppDomainName_full_name, |
| 4200 | AppDomainIndex, |
| 4201 | ClrInstanceID); |
| 4202 | |
| 4203 | return ERROR_SUCCESS; |
| 4204 | } |
| 4205 | |
| 4206 | extern "C" BOOL EventXplatEnabledAppDomainUnload(){ return tracepoint_enabled(DotNETRuntime, AppDomainUnload); } |
| 4207 | |
| 4208 | extern "C" ULONG FireEtXplatAppDomainUnload( |
| 4209 | const unsigned __int64 AppDomainID, |
| 4210 | const unsigned int AppDomainFlags, |
| 4211 | PCWSTR AppDomainName) |
| 4212 | { |
| 4213 | if (!EventXplatEnabledAppDomainUnload()) |
| 4214 | return ERROR_SUCCESS; |
| 4215 | INT AppDomainName_path_size = -1; |
| 4216 | PathCharString AppDomainName_PS; |
| 4217 | INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR); |
| 4218 | CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size ); |
| 4219 | if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4220 | |
| 4221 | AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL ); |
| 4222 | _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size ); |
| 4223 | AppDomainName_PS.CloseBuffer(AppDomainName_path_size ); |
| 4224 | if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4225 | do_tracepoint(DotNETRuntime, |
| 4226 | AppDomainUnload, |
| 4227 | AppDomainID, |
| 4228 | AppDomainFlags, |
| 4229 | AppDomainName_full_name); |
| 4230 | |
| 4231 | return ERROR_SUCCESS; |
| 4232 | } |
| 4233 | |
| 4234 | extern "C" BOOL EventXplatEnabledAppDomainUnload_V1(){ return tracepoint_enabled(DotNETRuntime, AppDomainUnload_V1); } |
| 4235 | |
| 4236 | extern "C" ULONG FireEtXplatAppDomainUnload_V1( |
| 4237 | const unsigned __int64 AppDomainID, |
| 4238 | const unsigned int AppDomainFlags, |
| 4239 | PCWSTR AppDomainName, |
| 4240 | const unsigned int AppDomainIndex, |
| 4241 | const unsigned short ClrInstanceID) |
| 4242 | { |
| 4243 | if (!EventXplatEnabledAppDomainUnload_V1()) |
| 4244 | return ERROR_SUCCESS; |
| 4245 | INT AppDomainName_path_size = -1; |
| 4246 | PathCharString AppDomainName_PS; |
| 4247 | INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR); |
| 4248 | CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size ); |
| 4249 | if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4250 | |
| 4251 | AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL ); |
| 4252 | _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size ); |
| 4253 | AppDomainName_PS.CloseBuffer(AppDomainName_path_size ); |
| 4254 | if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4255 | do_tracepoint(DotNETRuntime, |
| 4256 | AppDomainUnload_V1, |
| 4257 | AppDomainID, |
| 4258 | AppDomainFlags, |
| 4259 | AppDomainName_full_name, |
| 4260 | AppDomainIndex, |
| 4261 | ClrInstanceID); |
| 4262 | |
| 4263 | return ERROR_SUCCESS; |
| 4264 | } |
| 4265 | |
| 4266 | extern "C" BOOL EventXplatEnabledModuleRangeLoad(){ return tracepoint_enabled(DotNETRuntime, ModuleRangeLoad); } |
| 4267 | |
| 4268 | extern "C" ULONG FireEtXplatModuleRangeLoad( |
| 4269 | const unsigned short ClrInstanceID, |
| 4270 | const unsigned __int64 ModuleID, |
| 4271 | const unsigned int RangeBegin, |
| 4272 | const unsigned int RangeSize, |
| 4273 | const unsigned char RangeType) |
| 4274 | { |
| 4275 | if (!EventXplatEnabledModuleRangeLoad()) |
| 4276 | return ERROR_SUCCESS; |
| 4277 | |
| 4278 | do_tracepoint(DotNETRuntime, |
| 4279 | ModuleRangeLoad, |
| 4280 | ClrInstanceID, |
| 4281 | ModuleID, |
| 4282 | RangeBegin, |
| 4283 | RangeSize, |
| 4284 | RangeType); |
| 4285 | |
| 4286 | return ERROR_SUCCESS; |
| 4287 | } |
| 4288 | |
| 4289 | extern "C" BOOL EventXplatEnabledStrongNameVerificationStart(){ return tracepoint_enabled(DotNETRuntime, StrongNameVerificationStart); } |
| 4290 | |
| 4291 | extern "C" ULONG FireEtXplatStrongNameVerificationStart( |
| 4292 | const unsigned int VerificationFlags, |
| 4293 | const unsigned int ErrorCode, |
| 4294 | PCWSTR FullyQualifiedAssemblyName) |
| 4295 | { |
| 4296 | if (!EventXplatEnabledStrongNameVerificationStart()) |
| 4297 | return ERROR_SUCCESS; |
| 4298 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4299 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4300 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4301 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4302 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4303 | |
| 4304 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4305 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4306 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4307 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4308 | do_tracepoint(DotNETRuntime, |
| 4309 | StrongNameVerificationStart, |
| 4310 | VerificationFlags, |
| 4311 | ErrorCode, |
| 4312 | FullyQualifiedAssemblyName_full_name); |
| 4313 | |
| 4314 | return ERROR_SUCCESS; |
| 4315 | } |
| 4316 | |
| 4317 | extern "C" BOOL EventXplatEnabledStrongNameVerificationStart_V1(){ return tracepoint_enabled(DotNETRuntime, StrongNameVerificationStart_V1); } |
| 4318 | |
| 4319 | extern "C" ULONG FireEtXplatStrongNameVerificationStart_V1( |
| 4320 | const unsigned int VerificationFlags, |
| 4321 | const unsigned int ErrorCode, |
| 4322 | PCWSTR FullyQualifiedAssemblyName, |
| 4323 | const unsigned short ClrInstanceID) |
| 4324 | { |
| 4325 | if (!EventXplatEnabledStrongNameVerificationStart_V1()) |
| 4326 | return ERROR_SUCCESS; |
| 4327 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4328 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4329 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4330 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4331 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4332 | |
| 4333 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4334 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4335 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4336 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4337 | do_tracepoint(DotNETRuntime, |
| 4338 | StrongNameVerificationStart_V1, |
| 4339 | VerificationFlags, |
| 4340 | ErrorCode, |
| 4341 | FullyQualifiedAssemblyName_full_name, |
| 4342 | ClrInstanceID); |
| 4343 | |
| 4344 | return ERROR_SUCCESS; |
| 4345 | } |
| 4346 | |
| 4347 | extern "C" BOOL EventXplatEnabledStrongNameVerificationStop(){ return tracepoint_enabled(DotNETRuntime, StrongNameVerificationStop); } |
| 4348 | |
| 4349 | extern "C" ULONG FireEtXplatStrongNameVerificationStop( |
| 4350 | const unsigned int VerificationFlags, |
| 4351 | const unsigned int ErrorCode, |
| 4352 | PCWSTR FullyQualifiedAssemblyName) |
| 4353 | { |
| 4354 | if (!EventXplatEnabledStrongNameVerificationStop()) |
| 4355 | return ERROR_SUCCESS; |
| 4356 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4357 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4358 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4359 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4360 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4361 | |
| 4362 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4363 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4364 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4365 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4366 | do_tracepoint(DotNETRuntime, |
| 4367 | StrongNameVerificationStop, |
| 4368 | VerificationFlags, |
| 4369 | ErrorCode, |
| 4370 | FullyQualifiedAssemblyName_full_name); |
| 4371 | |
| 4372 | return ERROR_SUCCESS; |
| 4373 | } |
| 4374 | |
| 4375 | extern "C" BOOL EventXplatEnabledStrongNameVerificationStop_V1(){ return tracepoint_enabled(DotNETRuntime, StrongNameVerificationStop_V1); } |
| 4376 | |
| 4377 | extern "C" ULONG FireEtXplatStrongNameVerificationStop_V1( |
| 4378 | const unsigned int VerificationFlags, |
| 4379 | const unsigned int ErrorCode, |
| 4380 | PCWSTR FullyQualifiedAssemblyName, |
| 4381 | const unsigned short ClrInstanceID) |
| 4382 | { |
| 4383 | if (!EventXplatEnabledStrongNameVerificationStop_V1()) |
| 4384 | return ERROR_SUCCESS; |
| 4385 | INT FullyQualifiedAssemblyName_path_size = -1; |
| 4386 | PathCharString FullyQualifiedAssemblyName_PS; |
| 4387 | INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR); |
| 4388 | CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size ); |
| 4389 | if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4390 | |
| 4391 | FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL ); |
| 4392 | _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size ); |
| 4393 | FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size ); |
| 4394 | if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4395 | do_tracepoint(DotNETRuntime, |
| 4396 | StrongNameVerificationStop_V1, |
| 4397 | VerificationFlags, |
| 4398 | ErrorCode, |
| 4399 | FullyQualifiedAssemblyName_full_name, |
| 4400 | ClrInstanceID); |
| 4401 | |
| 4402 | return ERROR_SUCCESS; |
| 4403 | } |
| 4404 | |
| 4405 | extern "C" BOOL EventXplatEnabledAuthenticodeVerificationStart(){ return tracepoint_enabled(DotNETRuntime, AuthenticodeVerificationStart); } |
| 4406 | |
| 4407 | extern "C" ULONG FireEtXplatAuthenticodeVerificationStart( |
| 4408 | const unsigned int VerificationFlags, |
| 4409 | const unsigned int ErrorCode, |
| 4410 | PCWSTR ModulePath) |
| 4411 | { |
| 4412 | if (!EventXplatEnabledAuthenticodeVerificationStart()) |
| 4413 | return ERROR_SUCCESS; |
| 4414 | INT ModulePath_path_size = -1; |
| 4415 | PathCharString ModulePath_PS; |
| 4416 | INT ModulePath_full_name_path_size = (wcslen(ModulePath) + 1)*sizeof(WCHAR); |
| 4417 | CHAR* ModulePath_full_name = ModulePath_PS.OpenStringBuffer(ModulePath_full_name_path_size ); |
| 4418 | if (ModulePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4419 | |
| 4420 | ModulePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModulePath, -1, ModulePath_full_name, ModulePath_full_name_path_size, NULL, NULL ); |
| 4421 | _ASSERTE(ModulePath_path_size < ModulePath_full_name_path_size ); |
| 4422 | ModulePath_PS.CloseBuffer(ModulePath_path_size ); |
| 4423 | if( ModulePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4424 | do_tracepoint(DotNETRuntime, |
| 4425 | AuthenticodeVerificationStart, |
| 4426 | VerificationFlags, |
| 4427 | ErrorCode, |
| 4428 | ModulePath_full_name); |
| 4429 | |
| 4430 | return ERROR_SUCCESS; |
| 4431 | } |
| 4432 | |
| 4433 | extern "C" BOOL EventXplatEnabledAuthenticodeVerificationStart_V1(){ return tracepoint_enabled(DotNETRuntime, AuthenticodeVerificationStart_V1); } |
| 4434 | |
| 4435 | extern "C" ULONG FireEtXplatAuthenticodeVerificationStart_V1( |
| 4436 | const unsigned int VerificationFlags, |
| 4437 | const unsigned int ErrorCode, |
| 4438 | PCWSTR ModulePath, |
| 4439 | const unsigned short ClrInstanceID) |
| 4440 | { |
| 4441 | if (!EventXplatEnabledAuthenticodeVerificationStart_V1()) |
| 4442 | return ERROR_SUCCESS; |
| 4443 | INT ModulePath_path_size = -1; |
| 4444 | PathCharString ModulePath_PS; |
| 4445 | INT ModulePath_full_name_path_size = (wcslen(ModulePath) + 1)*sizeof(WCHAR); |
| 4446 | CHAR* ModulePath_full_name = ModulePath_PS.OpenStringBuffer(ModulePath_full_name_path_size ); |
| 4447 | if (ModulePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4448 | |
| 4449 | ModulePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModulePath, -1, ModulePath_full_name, ModulePath_full_name_path_size, NULL, NULL ); |
| 4450 | _ASSERTE(ModulePath_path_size < ModulePath_full_name_path_size ); |
| 4451 | ModulePath_PS.CloseBuffer(ModulePath_path_size ); |
| 4452 | if( ModulePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4453 | do_tracepoint(DotNETRuntime, |
| 4454 | AuthenticodeVerificationStart_V1, |
| 4455 | VerificationFlags, |
| 4456 | ErrorCode, |
| 4457 | ModulePath_full_name, |
| 4458 | ClrInstanceID); |
| 4459 | |
| 4460 | return ERROR_SUCCESS; |
| 4461 | } |
| 4462 | |
| 4463 | extern "C" BOOL EventXplatEnabledAuthenticodeVerificationStop(){ return tracepoint_enabled(DotNETRuntime, AuthenticodeVerificationStop); } |
| 4464 | |
| 4465 | extern "C" ULONG FireEtXplatAuthenticodeVerificationStop( |
| 4466 | const unsigned int VerificationFlags, |
| 4467 | const unsigned int ErrorCode, |
| 4468 | PCWSTR ModulePath) |
| 4469 | { |
| 4470 | if (!EventXplatEnabledAuthenticodeVerificationStop()) |
| 4471 | return ERROR_SUCCESS; |
| 4472 | INT ModulePath_path_size = -1; |
| 4473 | PathCharString ModulePath_PS; |
| 4474 | INT ModulePath_full_name_path_size = (wcslen(ModulePath) + 1)*sizeof(WCHAR); |
| 4475 | CHAR* ModulePath_full_name = ModulePath_PS.OpenStringBuffer(ModulePath_full_name_path_size ); |
| 4476 | if (ModulePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4477 | |
| 4478 | ModulePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModulePath, -1, ModulePath_full_name, ModulePath_full_name_path_size, NULL, NULL ); |
| 4479 | _ASSERTE(ModulePath_path_size < ModulePath_full_name_path_size ); |
| 4480 | ModulePath_PS.CloseBuffer(ModulePath_path_size ); |
| 4481 | if( ModulePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4482 | do_tracepoint(DotNETRuntime, |
| 4483 | AuthenticodeVerificationStop, |
| 4484 | VerificationFlags, |
| 4485 | ErrorCode, |
| 4486 | ModulePath_full_name); |
| 4487 | |
| 4488 | return ERROR_SUCCESS; |
| 4489 | } |
| 4490 | |
| 4491 | extern "C" BOOL EventXplatEnabledAuthenticodeVerificationStop_V1(){ return tracepoint_enabled(DotNETRuntime, AuthenticodeVerificationStop_V1); } |
| 4492 | |
| 4493 | extern "C" ULONG FireEtXplatAuthenticodeVerificationStop_V1( |
| 4494 | const unsigned int VerificationFlags, |
| 4495 | const unsigned int ErrorCode, |
| 4496 | PCWSTR ModulePath, |
| 4497 | const unsigned short ClrInstanceID) |
| 4498 | { |
| 4499 | if (!EventXplatEnabledAuthenticodeVerificationStop_V1()) |
| 4500 | return ERROR_SUCCESS; |
| 4501 | INT ModulePath_path_size = -1; |
| 4502 | PathCharString ModulePath_PS; |
| 4503 | INT ModulePath_full_name_path_size = (wcslen(ModulePath) + 1)*sizeof(WCHAR); |
| 4504 | CHAR* ModulePath_full_name = ModulePath_PS.OpenStringBuffer(ModulePath_full_name_path_size ); |
| 4505 | if (ModulePath_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4506 | |
| 4507 | ModulePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModulePath, -1, ModulePath_full_name, ModulePath_full_name_path_size, NULL, NULL ); |
| 4508 | _ASSERTE(ModulePath_path_size < ModulePath_full_name_path_size ); |
| 4509 | ModulePath_PS.CloseBuffer(ModulePath_path_size ); |
| 4510 | if( ModulePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4511 | do_tracepoint(DotNETRuntime, |
| 4512 | AuthenticodeVerificationStop_V1, |
| 4513 | VerificationFlags, |
| 4514 | ErrorCode, |
| 4515 | ModulePath_full_name, |
| 4516 | ClrInstanceID); |
| 4517 | |
| 4518 | return ERROR_SUCCESS; |
| 4519 | } |
| 4520 | |
| 4521 | extern "C" BOOL EventXplatEnabledRuntimeInformationStart(){ return tracepoint_enabled(DotNETRuntime, RuntimeInformationStart); } |
| 4522 | |
| 4523 | extern "C" ULONG FireEtXplatRuntimeInformationStart( |
| 4524 | const unsigned short ClrInstanceID, |
| 4525 | const unsigned short Sku, |
| 4526 | const unsigned short BclMajorVersion, |
| 4527 | const unsigned short BclMinorVersion, |
| 4528 | const unsigned short BclBuildNumber, |
| 4529 | const unsigned short BclQfeNumber, |
| 4530 | const unsigned short VMMajorVersion, |
| 4531 | const unsigned short VMMinorVersion, |
| 4532 | const unsigned short VMBuildNumber, |
| 4533 | const unsigned short VMQfeNumber, |
| 4534 | const unsigned int StartupFlags, |
| 4535 | const unsigned char StartupMode, |
| 4536 | PCWSTR CommandLine, |
| 4537 | const GUID* ComObjectGuid, |
| 4538 | PCWSTR RuntimeDllPath) |
| 4539 | { |
| 4540 | if (!EventXplatEnabledRuntimeInformationStart()) |
| 4541 | return ERROR_SUCCESS; |
| 4542 | |
| 4543 | char stackBuffer[153]; |
| 4544 | char *buffer = stackBuffer; |
| 4545 | size_t offset = 0; |
| 4546 | size_t size = 153; |
| 4547 | bool fixedBuffer = true; |
| 4548 | |
| 4549 | bool success = true; |
| 4550 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 4551 | success &= WriteToBuffer(Sku, buffer, offset, size, fixedBuffer); |
| 4552 | success &= WriteToBuffer(BclMajorVersion, buffer, offset, size, fixedBuffer); |
| 4553 | success &= WriteToBuffer(BclMinorVersion, buffer, offset, size, fixedBuffer); |
| 4554 | success &= WriteToBuffer(BclBuildNumber, buffer, offset, size, fixedBuffer); |
| 4555 | success &= WriteToBuffer(BclQfeNumber, buffer, offset, size, fixedBuffer); |
| 4556 | success &= WriteToBuffer(VMMajorVersion, buffer, offset, size, fixedBuffer); |
| 4557 | success &= WriteToBuffer(VMMinorVersion, buffer, offset, size, fixedBuffer); |
| 4558 | success &= WriteToBuffer(VMBuildNumber, buffer, offset, size, fixedBuffer); |
| 4559 | success &= WriteToBuffer(VMQfeNumber, buffer, offset, size, fixedBuffer); |
| 4560 | success &= WriteToBuffer(StartupFlags, buffer, offset, size, fixedBuffer); |
| 4561 | success &= WriteToBuffer(StartupMode, buffer, offset, size, fixedBuffer); |
| 4562 | success &= WriteToBuffer(CommandLine, buffer, offset, size, fixedBuffer); |
| 4563 | success &= WriteToBuffer(*ComObjectGuid, buffer, offset, size, fixedBuffer); |
| 4564 | success &= WriteToBuffer(RuntimeDllPath, buffer, offset, size, fixedBuffer); |
| 4565 | |
| 4566 | if (!success) |
| 4567 | { |
| 4568 | if (!fixedBuffer) |
| 4569 | delete[] buffer; |
| 4570 | return ERROR_WRITE_FAULT; |
| 4571 | } |
| 4572 | |
| 4573 | do_tracepoint(DotNETRuntime, RuntimeInformationStart, offset, buffer); |
| 4574 | |
| 4575 | if (!fixedBuffer) |
| 4576 | delete[] buffer; |
| 4577 | |
| 4578 | return ERROR_SUCCESS; |
| 4579 | } |
| 4580 | |
| 4581 | extern "C" BOOL EventXplatEnabledIncreaseMemoryPressure(){ return tracepoint_enabled(DotNETRuntime, IncreaseMemoryPressure); } |
| 4582 | |
| 4583 | extern "C" ULONG FireEtXplatIncreaseMemoryPressure( |
| 4584 | const unsigned __int64 BytesAllocated, |
| 4585 | const unsigned short ClrInstanceID) |
| 4586 | { |
| 4587 | if (!EventXplatEnabledIncreaseMemoryPressure()) |
| 4588 | return ERROR_SUCCESS; |
| 4589 | |
| 4590 | do_tracepoint(DotNETRuntime, |
| 4591 | IncreaseMemoryPressure, |
| 4592 | BytesAllocated, |
| 4593 | ClrInstanceID); |
| 4594 | |
| 4595 | return ERROR_SUCCESS; |
| 4596 | } |
| 4597 | |
| 4598 | extern "C" BOOL EventXplatEnabledDecreaseMemoryPressure(){ return tracepoint_enabled(DotNETRuntime, DecreaseMemoryPressure); } |
| 4599 | |
| 4600 | extern "C" ULONG FireEtXplatDecreaseMemoryPressure( |
| 4601 | const unsigned __int64 BytesFreed, |
| 4602 | const unsigned short ClrInstanceID) |
| 4603 | { |
| 4604 | if (!EventXplatEnabledDecreaseMemoryPressure()) |
| 4605 | return ERROR_SUCCESS; |
| 4606 | |
| 4607 | do_tracepoint(DotNETRuntime, |
| 4608 | DecreaseMemoryPressure, |
| 4609 | BytesFreed, |
| 4610 | ClrInstanceID); |
| 4611 | |
| 4612 | return ERROR_SUCCESS; |
| 4613 | } |
| 4614 | |
| 4615 | extern "C" BOOL EventXplatEnabledGCMarkWithType(){ return tracepoint_enabled(DotNETRuntime, GCMarkWithType); } |
| 4616 | |
| 4617 | extern "C" ULONG FireEtXplatGCMarkWithType( |
| 4618 | const unsigned int HeapNum, |
| 4619 | const unsigned short ClrInstanceID, |
| 4620 | const unsigned int Type, |
| 4621 | const unsigned __int64 Bytes) |
| 4622 | { |
| 4623 | if (!EventXplatEnabledGCMarkWithType()) |
| 4624 | return ERROR_SUCCESS; |
| 4625 | |
| 4626 | do_tracepoint(DotNETRuntime, |
| 4627 | GCMarkWithType, |
| 4628 | HeapNum, |
| 4629 | ClrInstanceID, |
| 4630 | Type, |
| 4631 | Bytes); |
| 4632 | |
| 4633 | return ERROR_SUCCESS; |
| 4634 | } |
| 4635 | |
| 4636 | extern "C" BOOL EventXplatEnabledGCJoin_V2(){ return tracepoint_enabled(DotNETRuntime, GCJoin_V2); } |
| 4637 | |
| 4638 | extern "C" ULONG FireEtXplatGCJoin_V2( |
| 4639 | const unsigned int Heap, |
| 4640 | const unsigned int JoinTime, |
| 4641 | const unsigned int JoinType, |
| 4642 | const unsigned short ClrInstanceID, |
| 4643 | const unsigned int JoinID) |
| 4644 | { |
| 4645 | if (!EventXplatEnabledGCJoin_V2()) |
| 4646 | return ERROR_SUCCESS; |
| 4647 | |
| 4648 | do_tracepoint(DotNETRuntime, |
| 4649 | GCJoin_V2, |
| 4650 | Heap, |
| 4651 | JoinTime, |
| 4652 | JoinType, |
| 4653 | ClrInstanceID, |
| 4654 | JoinID); |
| 4655 | |
| 4656 | return ERROR_SUCCESS; |
| 4657 | } |
| 4658 | |
| 4659 | extern "C" BOOL EventXplatEnabledGCPerHeapHistory_V3(){ return tracepoint_enabled(DotNETRuntime, GCPerHeapHistory_V3); } |
| 4660 | |
| 4661 | extern "C" ULONG FireEtXplatGCPerHeapHistory_V3( |
| 4662 | const unsigned short ClrInstanceID, |
| 4663 | const void* FreeListAllocated, |
| 4664 | const void* FreeListRejected, |
| 4665 | const void* EndOfSegAllocated, |
| 4666 | const void* CondemnedAllocated, |
| 4667 | const void* PinnedAllocated, |
| 4668 | const void* PinnedAllocatedAdvance, |
| 4669 | const unsigned int RunningFreeListEfficiency, |
| 4670 | const unsigned int CondemnReasons0, |
| 4671 | const unsigned int CondemnReasons1, |
| 4672 | const unsigned int CompactMechanisms, |
| 4673 | const unsigned int ExpandMechanisms, |
| 4674 | const unsigned int HeapIndex, |
| 4675 | const void* , |
| 4676 | const unsigned int Count, |
| 4677 | int Values_ElementSize, |
| 4678 | const void* Values) |
| 4679 | { |
| 4680 | if (!EventXplatEnabledGCPerHeapHistory_V3()) |
| 4681 | return ERROR_SUCCESS; |
| 4682 | |
| 4683 | char stackBuffer[118]; |
| 4684 | char *buffer = stackBuffer; |
| 4685 | size_t offset = 0; |
| 4686 | size_t size = 118; |
| 4687 | bool fixedBuffer = true; |
| 4688 | |
| 4689 | bool success = true; |
| 4690 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 4691 | success &= WriteToBuffer(FreeListAllocated, buffer, offset, size, fixedBuffer); |
| 4692 | success &= WriteToBuffer(FreeListRejected, buffer, offset, size, fixedBuffer); |
| 4693 | success &= WriteToBuffer(EndOfSegAllocated, buffer, offset, size, fixedBuffer); |
| 4694 | success &= WriteToBuffer(CondemnedAllocated, buffer, offset, size, fixedBuffer); |
| 4695 | success &= WriteToBuffer(PinnedAllocated, buffer, offset, size, fixedBuffer); |
| 4696 | success &= WriteToBuffer(PinnedAllocatedAdvance, buffer, offset, size, fixedBuffer); |
| 4697 | success &= WriteToBuffer(RunningFreeListEfficiency, buffer, offset, size, fixedBuffer); |
| 4698 | success &= WriteToBuffer(CondemnReasons0, buffer, offset, size, fixedBuffer); |
| 4699 | success &= WriteToBuffer(CondemnReasons1, buffer, offset, size, fixedBuffer); |
| 4700 | success &= WriteToBuffer(CompactMechanisms, buffer, offset, size, fixedBuffer); |
| 4701 | success &= WriteToBuffer(ExpandMechanisms, buffer, offset, size, fixedBuffer); |
| 4702 | success &= WriteToBuffer(HeapIndex, buffer, offset, size, fixedBuffer); |
| 4703 | success &= WriteToBuffer(ExtraGen0Commit, buffer, offset, size, fixedBuffer); |
| 4704 | success &= WriteToBuffer(Count, buffer, offset, size, fixedBuffer); |
| 4705 | success &= WriteToBuffer((const BYTE *)Values, (int)Values_ElementSize * (int)Count, buffer, offset, size, fixedBuffer); |
| 4706 | |
| 4707 | if (!success) |
| 4708 | { |
| 4709 | if (!fixedBuffer) |
| 4710 | delete[] buffer; |
| 4711 | return ERROR_WRITE_FAULT; |
| 4712 | } |
| 4713 | |
| 4714 | do_tracepoint(DotNETRuntime, GCPerHeapHistory_V3, offset, buffer); |
| 4715 | |
| 4716 | if (!fixedBuffer) |
| 4717 | delete[] buffer; |
| 4718 | |
| 4719 | return ERROR_SUCCESS; |
| 4720 | } |
| 4721 | |
| 4722 | extern "C" BOOL EventXplatEnabledGCGlobalHeapHistory_V2(){ return tracepoint_enabled(DotNETRuntime, GCGlobalHeapHistory_V2); } |
| 4723 | |
| 4724 | extern "C" ULONG FireEtXplatGCGlobalHeapHistory_V2( |
| 4725 | const unsigned __int64 FinalYoungestDesired, |
| 4726 | const signed int NumHeaps, |
| 4727 | const unsigned int CondemnedGeneration, |
| 4728 | const unsigned int Gen0ReductionCount, |
| 4729 | const unsigned int Reason, |
| 4730 | const unsigned int GlobalMechanisms, |
| 4731 | const unsigned short ClrInstanceID, |
| 4732 | const unsigned int PauseMode, |
| 4733 | const unsigned int MemoryPressure) |
| 4734 | { |
| 4735 | if (!EventXplatEnabledGCGlobalHeapHistory_V2()) |
| 4736 | return ERROR_SUCCESS; |
| 4737 | |
| 4738 | do_tracepoint(DotNETRuntime, |
| 4739 | GCGlobalHeapHistory_V2, |
| 4740 | FinalYoungestDesired, |
| 4741 | NumHeaps, |
| 4742 | CondemnedGeneration, |
| 4743 | Gen0ReductionCount, |
| 4744 | Reason, |
| 4745 | GlobalMechanisms, |
| 4746 | ClrInstanceID, |
| 4747 | PauseMode, |
| 4748 | MemoryPressure); |
| 4749 | |
| 4750 | return ERROR_SUCCESS; |
| 4751 | } |
| 4752 | |
| 4753 | extern "C" BOOL EventXplatEnabledDebugIPCEventStart(){ return tracepoint_enabled(DotNETRuntime, DebugIPCEventStart); } |
| 4754 | |
| 4755 | extern "C" ULONG FireEtXplatDebugIPCEventStart( |
| 4756 | ) |
| 4757 | { |
| 4758 | if (!EventXplatEnabledDebugIPCEventStart()) |
| 4759 | return ERROR_SUCCESS; |
| 4760 | |
| 4761 | do_tracepoint(DotNETRuntime, DebugIPCEventStart); |
| 4762 | |
| 4763 | return ERROR_SUCCESS; |
| 4764 | } |
| 4765 | |
| 4766 | extern "C" BOOL EventXplatEnabledDebugIPCEventEnd(){ return tracepoint_enabled(DotNETRuntime, DebugIPCEventEnd); } |
| 4767 | |
| 4768 | extern "C" ULONG FireEtXplatDebugIPCEventEnd( |
| 4769 | ) |
| 4770 | { |
| 4771 | if (!EventXplatEnabledDebugIPCEventEnd()) |
| 4772 | return ERROR_SUCCESS; |
| 4773 | |
| 4774 | do_tracepoint(DotNETRuntime, DebugIPCEventEnd); |
| 4775 | |
| 4776 | return ERROR_SUCCESS; |
| 4777 | } |
| 4778 | |
| 4779 | extern "C" BOOL EventXplatEnabledDebugExceptionProcessingStart(){ return tracepoint_enabled(DotNETRuntime, DebugExceptionProcessingStart); } |
| 4780 | |
| 4781 | extern "C" ULONG FireEtXplatDebugExceptionProcessingStart( |
| 4782 | ) |
| 4783 | { |
| 4784 | if (!EventXplatEnabledDebugExceptionProcessingStart()) |
| 4785 | return ERROR_SUCCESS; |
| 4786 | |
| 4787 | do_tracepoint(DotNETRuntime, DebugExceptionProcessingStart); |
| 4788 | |
| 4789 | return ERROR_SUCCESS; |
| 4790 | } |
| 4791 | |
| 4792 | extern "C" BOOL EventXplatEnabledDebugExceptionProcessingEnd(){ return tracepoint_enabled(DotNETRuntime, DebugExceptionProcessingEnd); } |
| 4793 | |
| 4794 | extern "C" ULONG FireEtXplatDebugExceptionProcessingEnd( |
| 4795 | ) |
| 4796 | { |
| 4797 | if (!EventXplatEnabledDebugExceptionProcessingEnd()) |
| 4798 | return ERROR_SUCCESS; |
| 4799 | |
| 4800 | do_tracepoint(DotNETRuntime, DebugExceptionProcessingEnd); |
| 4801 | |
| 4802 | return ERROR_SUCCESS; |
| 4803 | } |
| 4804 | |
| 4805 | extern "C" BOOL EventXplatEnabledCodeSymbols(){ return tracepoint_enabled(DotNETRuntime, CodeSymbols); } |
| 4806 | |
| 4807 | extern "C" ULONG FireEtXplatCodeSymbols( |
| 4808 | const unsigned __int64 ModuleId, |
| 4809 | const unsigned short TotalChunks, |
| 4810 | const unsigned short ChunkNumber, |
| 4811 | const unsigned int ChunkLength, |
| 4812 | const BYTE* Chunk, |
| 4813 | const unsigned short ClrInstanceID) |
| 4814 | { |
| 4815 | if (!EventXplatEnabledCodeSymbols()) |
| 4816 | return ERROR_SUCCESS; |
| 4817 | |
| 4818 | char stackBuffer[32]; |
| 4819 | char *buffer = stackBuffer; |
| 4820 | size_t offset = 0; |
| 4821 | size_t size = 32; |
| 4822 | bool fixedBuffer = true; |
| 4823 | |
| 4824 | bool success = true; |
| 4825 | success &= WriteToBuffer(ModuleId, buffer, offset, size, fixedBuffer); |
| 4826 | success &= WriteToBuffer(TotalChunks, buffer, offset, size, fixedBuffer); |
| 4827 | success &= WriteToBuffer(ChunkNumber, buffer, offset, size, fixedBuffer); |
| 4828 | success &= WriteToBuffer(ChunkLength, buffer, offset, size, fixedBuffer); |
| 4829 | success &= WriteToBuffer((const BYTE *)Chunk, sizeof(const BYTE) * (int)ChunkLength, buffer, offset, size, fixedBuffer); |
| 4830 | success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer); |
| 4831 | |
| 4832 | if (!success) |
| 4833 | { |
| 4834 | if (!fixedBuffer) |
| 4835 | delete[] buffer; |
| 4836 | return ERROR_WRITE_FAULT; |
| 4837 | } |
| 4838 | |
| 4839 | do_tracepoint(DotNETRuntime, CodeSymbols, offset, buffer); |
| 4840 | |
| 4841 | if (!fixedBuffer) |
| 4842 | delete[] buffer; |
| 4843 | |
| 4844 | return ERROR_SUCCESS; |
| 4845 | } |
| 4846 | |
| 4847 | extern "C" BOOL EventXplatEnabledEventSource(){ return tracepoint_enabled(DotNETRuntime, EventSource); } |
| 4848 | |
| 4849 | extern "C" ULONG FireEtXplatEventSource( |
| 4850 | const signed int EventID, |
| 4851 | PCWSTR EventName, |
| 4852 | PCWSTR EventSourceName, |
| 4853 | PCWSTR Payload) |
| 4854 | { |
| 4855 | if (!EventXplatEnabledEventSource()) |
| 4856 | return ERROR_SUCCESS; |
| 4857 | INT EventName_path_size = -1; |
| 4858 | PathCharString EventName_PS; |
| 4859 | INT EventName_full_name_path_size = (wcslen(EventName) + 1)*sizeof(WCHAR); |
| 4860 | CHAR* EventName_full_name = EventName_PS.OpenStringBuffer(EventName_full_name_path_size ); |
| 4861 | if (EventName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4862 | INT EventSourceName_path_size = -1; |
| 4863 | PathCharString EventSourceName_PS; |
| 4864 | INT EventSourceName_full_name_path_size = (wcslen(EventSourceName) + 1)*sizeof(WCHAR); |
| 4865 | CHAR* EventSourceName_full_name = EventSourceName_PS.OpenStringBuffer(EventSourceName_full_name_path_size ); |
| 4866 | if (EventSourceName_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4867 | INT Payload_path_size = -1; |
| 4868 | PathCharString Payload_PS; |
| 4869 | INT Payload_full_name_path_size = (wcslen(Payload) + 1)*sizeof(WCHAR); |
| 4870 | CHAR* Payload_full_name = Payload_PS.OpenStringBuffer(Payload_full_name_path_size ); |
| 4871 | if (Payload_full_name == NULL ) { return ERROR_WRITE_FAULT; } |
| 4872 | |
| 4873 | EventName_path_size = WideCharToMultiByte( CP_ACP, 0, EventName, -1, EventName_full_name, EventName_full_name_path_size, NULL, NULL ); |
| 4874 | _ASSERTE(EventName_path_size < EventName_full_name_path_size ); |
| 4875 | EventName_PS.CloseBuffer(EventName_path_size ); |
| 4876 | if( EventName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4877 | EventSourceName_path_size = WideCharToMultiByte( CP_ACP, 0, EventSourceName, -1, EventSourceName_full_name, EventSourceName_full_name_path_size, NULL, NULL ); |
| 4878 | _ASSERTE(EventSourceName_path_size < EventSourceName_full_name_path_size ); |
| 4879 | EventSourceName_PS.CloseBuffer(EventSourceName_path_size ); |
| 4880 | if( EventSourceName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4881 | Payload_path_size = WideCharToMultiByte( CP_ACP, 0, Payload, -1, Payload_full_name, Payload_full_name_path_size, NULL, NULL ); |
| 4882 | _ASSERTE(Payload_path_size < Payload_full_name_path_size ); |
| 4883 | Payload_PS.CloseBuffer(Payload_path_size ); |
| 4884 | if( Payload_path_size == 0 ){ return ERROR_INVALID_PARAMETER; } |
| 4885 | do_tracepoint(DotNETRuntime, |
| 4886 | EventSource, |
| 4887 | EventID, |
| 4888 | EventName_full_name, |
| 4889 | EventSourceName_full_name, |
| 4890 | Payload_full_name); |
| 4891 | |
| 4892 | return ERROR_SUCCESS; |
| 4893 | } |
| 4894 | |
| 4895 | |
| 4896 | |