Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransactionsEtwProvider.cs
Go to the documentation of this file.
4
5namespace System.Transactions;
6
7[EventSource(Name = "System.Transactions.TransactionsEventSource", Guid = "8ac2d80a-1f1a-431b-ace4-bff8824aef0b", LocalizationResources = "FxResources.System.Transactions.Local.SR")]
8internal sealed class TransactionsEtwProvider : EventSource
9{
10 public static class Opcodes
11 {
12 public const EventOpcode Aborted = (EventOpcode)100;
13
14 public const EventOpcode Activity = (EventOpcode)101;
15
16 public const EventOpcode Adjusted = (EventOpcode)102;
17
18 public const EventOpcode CloneCreate = (EventOpcode)103;
19
20 public const EventOpcode Commit = (EventOpcode)104;
21
22 public const EventOpcode Committed = (EventOpcode)105;
23
24 public const EventOpcode Create = (EventOpcode)106;
25
26 public const EventOpcode Created = (EventOpcode)107;
27
29
31
32 public const EventOpcode Disposed = (EventOpcode)110;
33
34 public const EventOpcode Done = (EventOpcode)111;
35
36 public const EventOpcode Enlist = (EventOpcode)112;
37
38 public const EventOpcode Enter = (EventOpcode)113;
39
41
42 public const EventOpcode Exit = (EventOpcode)115;
43
45
46 public const EventOpcode Incomplete = (EventOpcode)117;
47
48 public const EventOpcode InDoubt = (EventOpcode)118;
49
51
53
55
56 public const EventOpcode Prepared = (EventOpcode)122;
57
58 public const EventOpcode Promoted = (EventOpcode)123;
59
61
62 public const EventOpcode Reenlist = (EventOpcode)125;
63
64 public const EventOpcode Rollback = (EventOpcode)126;
65
66 public const EventOpcode Serialized = (EventOpcode)127;
67
68 public const EventOpcode Timeout = (EventOpcode)128;
69 }
70
71 public static class Tasks
72 {
74
75 public const EventTask Enlistment = (EventTask)2;
76
78
79 public const EventTask Method = (EventTask)4;
80
81 public const EventTask Transaction = (EventTask)5;
82
84
86
88
90 }
91
92 public static class Keywords
93 {
95
97
99 }
100
101 internal static readonly TransactionsEtwProvider Log = new TransactionsEtwProvider();
102
104 {
105 }
106
107 [NonEvent]
108 public static string IdOf(object value)
109 {
110 if (value == null)
111 {
112 return "(null)";
113 }
114 return value.GetType().Name + "#" + GetHashCode(value);
115 }
116
117 [NonEvent]
118 public static int GetHashCode(object value)
119 {
120 return value?.GetHashCode() ?? 0;
121 }
122
123 [NonEvent]
124 internal void TransactionCreated(Transaction transaction, string type)
125 {
126 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
127 {
128 if (transaction != null && transaction.TransactionTraceId.TransactionIdentifier != null)
129 {
131 }
132 else
133 {
135 }
136 }
137 }
138
139 [Event(21, Keywords = (EventKeywords)2L, Level = EventLevel.Informational, Task = (EventTask)5, Opcode = (EventOpcode)106, Message = "Transaction Created. ID is {0}, type is {1}")]
140 private void TransactionCreated(string transactionIdentifier, string type)
141 {
142 SetActivityId(transactionIdentifier);
143 WriteEvent(21, transactionIdentifier, type);
144 }
145
146 [NonEvent]
147 internal void TransactionCloneCreate(Transaction transaction, string type)
148 {
149 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
150 {
151 if (transaction != null && transaction.TransactionTraceId.TransactionIdentifier != null)
152 {
154 }
155 else
156 {
158 }
159 }
160 }
161
162 [Event(18, Keywords = (EventKeywords)2L, Level = EventLevel.Informational, Task = (EventTask)5, Opcode = (EventOpcode)103, Message = "Transaction Clone Created. ID is {0}, type is {1}")]
163 private void TransactionCloneCreate(string transactionIdentifier, string type)
164 {
165 SetActivityId(transactionIdentifier);
166 WriteEvent(18, transactionIdentifier, type);
167 }
168
169 [NonEvent]
170 internal void TransactionExceptionTrace(TraceSourceType traceSource, TransactionExceptionType type, string message, string innerExceptionStr)
171 {
172 if (IsEnabled(EventLevel.Error, EventKeywords.All))
173 {
174 if (traceSource == TraceSourceType.TraceSourceBase)
175 {
176 TransactionExceptionBase(type.ToString(), message, innerExceptionStr);
177 }
178 else
179 {
180 TransactionExceptionLtm(type.ToString(), message, innerExceptionStr);
181 }
182 }
183 }
184
185 [NonEvent]
186 internal void TransactionExceptionTrace(TransactionExceptionType type, string message, string innerExceptionStr)
187 {
188 if (IsEnabled(EventLevel.Error, EventKeywords.All))
189 {
190 TransactionExceptionLtm(type.ToString(), message, innerExceptionStr);
191 }
192 }
193
194 [Event(24, Keywords = (EventKeywords)1L, Level = EventLevel.Error, Task = (EventTask)6, Message = "Transaction Exception. Type is {0}, message is {1}, InnerException is {2}")]
195 private void TransactionExceptionBase(string type, string message, string innerExceptionStr)
196 {
197 SetActivityId(string.Empty);
198 WriteEvent(24, type, message, innerExceptionStr);
199 }
200
201 [Event(23, Keywords = (EventKeywords)2L, Level = EventLevel.Error, Task = (EventTask)6, Message = "Transaction Exception. Type is {0}, message is {1}, InnerException is {2}")]
202 private void TransactionExceptionLtm(string type, string message, string innerExceptionStr)
203 {
204 SetActivityId(string.Empty);
205 WriteEvent(23, type, message, innerExceptionStr);
206 }
207
208 [NonEvent]
209 internal void InvalidOperation(string type, string operation)
210 {
211 if (IsEnabled(EventLevel.Error, EventKeywords.All))
212 {
213 TransactionInvalidOperation(string.Empty, type, operation);
214 }
215 }
216
217 [Event(26, Keywords = (EventKeywords)1L, Level = EventLevel.Error, Task = (EventTask)5, Opcode = (EventOpcode)120, Message = "Transaction Invalid Operation. ID is {0}, type is {1} and operation is {2}")]
218 private void TransactionInvalidOperation(string transactionIdentifier, string type, string operation)
219 {
220 SetActivityId(string.Empty);
221 WriteEvent(26, transactionIdentifier, type, operation);
222 }
223
224 [NonEvent]
225 internal void TransactionRollback(Transaction transaction, string type)
226 {
227 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
228 {
229 if (transaction != null && transaction.TransactionTraceId.TransactionIdentifier != null)
230 {
232 }
233 else
234 {
236 }
237 }
238 }
239
240 [Event(28, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)5, Opcode = (EventOpcode)126, Message = "Transaction Rollback. ID is {0}, type is {1}")]
241 private void TransactionRollback(string transactionIdentifier, string type)
242 {
243 SetActivityId(transactionIdentifier);
244 WriteEvent(28, transactionIdentifier, type);
245 }
246
247 [NonEvent]
248 internal void TransactionDependentCloneComplete(Transaction transaction, string type)
249 {
250 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
251 {
252 if (transaction != null && transaction.TransactionTraceId.TransactionIdentifier != null)
253 {
255 }
256 else
257 {
259 }
260 }
261 }
262
263 [Event(22, Keywords = (EventKeywords)2L, Level = EventLevel.Informational, Task = (EventTask)5, Opcode = (EventOpcode)109, Message = "Transaction Dependent Clone Completed. ID is {0}, type is {1}")]
264 private void TransactionDependentCloneComplete(string transactionIdentifier, string type)
265 {
266 SetActivityId(transactionIdentifier);
267 WriteEvent(22, transactionIdentifier, type);
268 }
269
270 [NonEvent]
271 internal void TransactionCommit(Transaction transaction, string type)
272 {
273 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
274 {
275 if (transaction != null && transaction.TransactionTraceId.TransactionIdentifier != null)
276 {
278 }
279 else
280 {
282 }
283 }
284 }
285
286 [Event(19, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)5, Opcode = (EventOpcode)104, Message = "Transaction Commit: ID is {0}, type is {1}")]
287 private void TransactionCommit(string transactionIdentifier, string type)
288 {
289 SetActivityId(transactionIdentifier);
290 WriteEvent(19, transactionIdentifier, type);
291 }
292
293 [NonEvent]
294 internal void EnlistmentStatus(InternalEnlistment enlistment, NotificationCall notificationCall)
295 {
296 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
297 {
298 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
299 {
300 EnlistmentStatus(enlistment.EnlistmentTraceId.EnlistmentIdentifier, notificationCall.ToString());
301 }
302 else
303 {
304 EnlistmentStatus(0, notificationCall.ToString());
305 }
306 }
307 }
308
309 [Event(5, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)2, Message = "Enlistment status: ID is {0}, notificationcall is {1}")]
310 private void EnlistmentStatus(int enlistmentIdentifier, string notificationCall)
311 {
312 SetActivityId(string.Empty);
313 WriteEvent(5, enlistmentIdentifier, notificationCall);
314 }
315
316 [NonEvent]
317 internal void EnlistmentDone(InternalEnlistment enlistment)
318 {
319 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
320 {
321 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
322 {
324 }
325 else
326 {
328 }
329 }
330 }
331
332 [Event(4, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)2, Opcode = (EventOpcode)111, Message = "Enlistment.Done: ID is {0}")]
333 private void EnlistmentDone(int enlistmentIdentifier)
334 {
335 SetActivityId(string.Empty);
336 WriteEvent(4, enlistmentIdentifier);
337 }
338
339 [NonEvent]
340 internal void EnlistmentPrepared(InternalEnlistment enlistment)
341 {
342 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
343 {
344 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
345 {
347 }
348 else
349 {
351 }
352 }
353 }
354
355 [Event(8, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)2, Opcode = (EventOpcode)122, Message = "PreparingEnlistment.Prepared: ID is {0}")]
356 private void EnlistmentPrepared(int enlistmentIdentifier)
357 {
358 SetActivityId(string.Empty);
359 WriteEvent(8, enlistmentIdentifier);
360 }
361
362 [NonEvent]
364 {
365 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
366 {
367 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
368 {
370 }
371 else
372 {
374 }
375 }
376 }
377
378 [Event(6, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)2, Opcode = (EventOpcode)116, Message = "Enlistment forceRollback: ID is {0}")]
379 private void EnlistmentForceRollback(int enlistmentIdentifier)
380 {
381 SetActivityId(string.Empty);
382 WriteEvent(6, enlistmentIdentifier);
383 }
384
385 [NonEvent]
386 internal void EnlistmentAborted(InternalEnlistment enlistment)
387 {
388 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
389 {
390 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
391 {
393 }
394 else
395 {
397 }
398 }
399 }
400
401 [Event(2, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)2, Opcode = (EventOpcode)100, Message = "Enlistment SinglePhase Aborted: ID is {0}")]
402 private void EnlistmentAborted(int enlistmentIdentifier)
403 {
404 SetActivityId(string.Empty);
405 WriteEvent(2, enlistmentIdentifier);
406 }
407
408 [NonEvent]
409 internal void EnlistmentCommitted(InternalEnlistment enlistment)
410 {
411 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
412 {
413 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
414 {
416 }
417 else
418 {
420 }
421 }
422 }
423
424 [Event(3, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)2, Opcode = (EventOpcode)105, Message = "Enlistment Committed: ID is {0}")]
425 private void EnlistmentCommitted(int enlistmentIdentifier)
426 {
427 SetActivityId(string.Empty);
428 WriteEvent(3, enlistmentIdentifier);
429 }
430
431 [NonEvent]
432 internal void EnlistmentInDoubt(InternalEnlistment enlistment)
433 {
434 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
435 {
436 if (enlistment != null && enlistment.EnlistmentTraceId.EnlistmentIdentifier != 0)
437 {
439 }
440 else
441 {
443 }
444 }
445 }
446
447 [Event(7, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)2, Opcode = (EventOpcode)118, Message = "Enlistment SinglePhase InDoubt: ID is {0}")]
448 private void EnlistmentInDoubt(int enlistmentIdentifier)
449 {
450 SetActivityId(string.Empty);
451 WriteEvent(7, enlistmentIdentifier);
452 }
453
454 [NonEvent]
455 internal void MethodEnter(TraceSourceType traceSource, object thisOrContextObject, [CallerMemberName] string methodname = null)
456 {
457 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
458 {
459 switch (traceSource)
460 {
461 case TraceSourceType.TraceSourceLtm:
462 MethodEnterTraceLtm(IdOf(thisOrContextObject), methodname);
463 break;
464 case TraceSourceType.TraceSourceBase:
465 MethodEnterTraceBase(IdOf(thisOrContextObject), methodname);
466 break;
467 case TraceSourceType.TraceSourceDistributed:
468 MethodEnterTraceDistributed(IdOf(thisOrContextObject), methodname);
469 break;
470 }
471 }
472 }
473
474 [NonEvent]
475 internal void MethodEnter(TraceSourceType traceSource, [CallerMemberName] string methodname = null)
476 {
477 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
478 {
479 switch (traceSource)
480 {
481 case TraceSourceType.TraceSourceLtm:
482 MethodEnterTraceLtm(string.Empty, methodname);
483 break;
484 case TraceSourceType.TraceSourceBase:
485 MethodEnterTraceBase(string.Empty, methodname);
486 break;
487 case TraceSourceType.TraceSourceDistributed:
488 MethodEnterTraceDistributed(string.Empty, methodname);
489 break;
490 }
491 }
492 }
493
494 [Event(11, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)4, Opcode = (EventOpcode)113, Message = "Enter method : {0}.{1}")]
495 private void MethodEnterTraceLtm(string thisOrContextObject, string methodname)
496 {
497 SetActivityId(string.Empty);
498 WriteEvent(11, thisOrContextObject, methodname);
499 }
500
501 [Event(13, Keywords = (EventKeywords)1L, Level = EventLevel.Verbose, Task = (EventTask)4, Opcode = (EventOpcode)113, Message = "Enter method : {0}.{1}")]
502 private void MethodEnterTraceBase(string thisOrContextObject, string methodname)
503 {
504 SetActivityId(string.Empty);
505 WriteEvent(13, thisOrContextObject, methodname);
506 }
507
508 [Event(15, Keywords = (EventKeywords)4L, Level = EventLevel.Verbose, Task = (EventTask)4, Opcode = (EventOpcode)113, Message = "Enter method : {0}.{1}")]
509 private void MethodEnterTraceDistributed(string thisOrContextObject, string methodname)
510 {
511 SetActivityId(string.Empty);
512 WriteEvent(15, thisOrContextObject, methodname);
513 }
514
515 [NonEvent]
516 internal void MethodExit(TraceSourceType traceSource, object thisOrContextObject, [CallerMemberName] string methodname = null)
517 {
518 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
519 {
520 switch (traceSource)
521 {
522 case TraceSourceType.TraceSourceLtm:
523 MethodExitTraceLtm(IdOf(thisOrContextObject), methodname);
524 break;
525 case TraceSourceType.TraceSourceBase:
526 MethodExitTraceBase(IdOf(thisOrContextObject), methodname);
527 break;
528 case TraceSourceType.TraceSourceDistributed:
529 MethodExitTraceDistributed(IdOf(thisOrContextObject), methodname);
530 break;
531 }
532 }
533 }
534
535 [NonEvent]
536 internal void MethodExit(TraceSourceType traceSource, [CallerMemberName] string methodname = null)
537 {
538 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
539 {
540 switch (traceSource)
541 {
542 case TraceSourceType.TraceSourceLtm:
543 MethodExitTraceLtm(string.Empty, methodname);
544 break;
545 case TraceSourceType.TraceSourceBase:
546 MethodExitTraceBase(string.Empty, methodname);
547 break;
548 case TraceSourceType.TraceSourceDistributed:
549 MethodExitTraceDistributed(string.Empty, methodname);
550 break;
551 }
552 }
553 }
554
555 [Event(12, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)4, Opcode = (EventOpcode)115, Message = "Exit method: {0}.{1}")]
556 private void MethodExitTraceLtm(string thisOrContextObject, string methodname)
557 {
558 SetActivityId(string.Empty);
559 WriteEvent(12, thisOrContextObject, methodname);
560 }
561
562 [Event(14, Keywords = (EventKeywords)1L, Level = EventLevel.Verbose, Task = (EventTask)4, Opcode = (EventOpcode)115, Message = "Exit method: {0}.{1}")]
563 private void MethodExitTraceBase(string thisOrContextObject, string methodname)
564 {
565 SetActivityId(string.Empty);
566 WriteEvent(14, thisOrContextObject, methodname);
567 }
568
569 [Event(16, Keywords = (EventKeywords)4L, Level = EventLevel.Verbose, Task = (EventTask)4, Opcode = (EventOpcode)115, Message = "Exit method: {0}.{1}")]
570 private void MethodExitTraceDistributed(string thisOrContextObject, string methodname)
571 {
572 SetActivityId(string.Empty);
573 WriteEvent(16, thisOrContextObject, methodname);
574 }
575
576 [NonEvent]
578 {
579 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
580 {
581 if (traceSource == TraceSourceType.TraceSourceBase)
582 {
584 }
585 else
586 {
588 }
589 }
590 }
591
592 [NonEvent]
594 {
595 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
596 {
598 }
599 }
600
601 [Event(9, Keywords = (EventKeywords)1L, Level = EventLevel.Verbose, Opcode = (EventOpcode)114, Message = "Exception consumed: {0}")]
602 private void ExceptionConsumedBase(string exceptionStr)
603 {
604 SetActivityId(string.Empty);
605 WriteEvent(9, exceptionStr);
606 }
607
608 [Event(10, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Opcode = (EventOpcode)114, Message = "Exception consumed: {0}")]
609 private void ExceptionConsumedLtm(string exceptionStr)
610 {
611 SetActivityId(string.Empty);
612 WriteEvent(10, exceptionStr);
613 }
614
615 [NonEvent]
616 internal void TransactionManagerReenlist(Guid resourceManagerID)
617 {
618 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
619 {
620 TransactionManagerReenlistTrace(resourceManagerID.ToString());
621 }
622 }
623
624 [Event(32, Keywords = (EventKeywords)1L, Level = EventLevel.Informational, Task = (EventTask)7, Opcode = (EventOpcode)125, Message = "Reenlist in: {0}")]
625 private void TransactionManagerReenlistTrace(string rmID)
626 {
627 SetActivityId(string.Empty);
628 WriteEvent(32, rmID);
629 }
630
631 [NonEvent]
632 internal void TransactionManagerRecoveryComplete(Guid resourceManagerID)
633 {
634 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
635 {
636 TransactionManagerRecoveryComplete(resourceManagerID.ToString());
637 }
638 }
639
640 [Event(31, Keywords = (EventKeywords)1L, Level = EventLevel.Informational, Task = (EventTask)7, Opcode = (EventOpcode)124, Message = "Recovery complete: {0}")]
641 private void TransactionManagerRecoveryComplete(string rmID)
642 {
643 SetActivityId(string.Empty);
644 WriteEvent(31, rmID);
645 }
646
647 [NonEvent]
649 {
650 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
651 {
653 }
654 }
655
656 [Event(1, Keywords = (EventKeywords)1L, Level = EventLevel.Warning, Task = (EventTask)1, Opcode = (EventOpcode)102, Message = "Configured Default Timeout Adjusted")]
658 {
659 SetActivityId(string.Empty);
660 WriteEvent(1);
661 }
662
663 [NonEvent]
664 internal void TransactionScopeCreated(TransactionTraceIdentifier transactionID, TransactionScopeResult transactionScopeResult)
665 {
666 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
667 {
668 TransactionScopeCreated(transactionID.TransactionIdentifier ?? string.Empty, transactionScopeResult);
669 }
670 }
671
672 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "TransactionScopeResult parameter is an enum and is trimmer safe")]
673 [Event(33, Keywords = (EventKeywords)1L, Level = EventLevel.Informational, Task = (EventTask)8, Opcode = (EventOpcode)107, Message = "Transactionscope was created: Transaction ID is {0}, TransactionScope Result is {1}")]
674 private void TransactionScopeCreated(string transactionID, TransactionScopeResult transactionScopeResult)
675 {
676 SetActivityId(transactionID);
677 WriteEvent(33, transactionID, transactionScopeResult);
678 }
679
680 [NonEvent]
682 {
683 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
684 {
685 string currenttransactionID2 = string.Empty;
686 string newtransactionID2 = string.Empty;
687 if (currenttransactionID.TransactionIdentifier != null)
688 {
689 currenttransactionID2 = currenttransactionID.TransactionIdentifier.ToString();
690 }
691 if (newtransactionID.TransactionIdentifier != null)
692 {
693 newtransactionID2 = newtransactionID.TransactionIdentifier.ToString();
694 }
695 TransactionScopeCurrentChanged(currenttransactionID2, newtransactionID2);
696 }
697 }
698
699 [Event(34, Keywords = (EventKeywords)1L, Level = EventLevel.Warning, Task = (EventTask)8, Opcode = (EventOpcode)108, Message = "Transactionscope current transaction ID changed from {0} to {1}")]
700 private void TransactionScopeCurrentChanged(string currenttransactionID, string newtransactionID)
701 {
702 SetActivityId(newtransactionID);
703 WriteEvent(34, currenttransactionID, newtransactionID);
704 }
705
706 [NonEvent]
708 {
709 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
710 {
711 TransactionScopeNestedIncorrectly(transactionID.TransactionIdentifier ?? string.Empty);
712 }
713 }
714
715 [Event(38, Keywords = (EventKeywords)1L, Level = EventLevel.Warning, Task = (EventTask)8, Opcode = (EventOpcode)121, Message = "Transactionscope nested incorrectly: transaction ID is {0}")]
716 private void TransactionScopeNestedIncorrectly(string transactionID)
717 {
718 SetActivityId(transactionID);
719 WriteEvent(38, transactionID);
720 }
721
722 [NonEvent]
724 {
725 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
726 {
727 TransactionScopeDisposed(transactionID.TransactionIdentifier ?? string.Empty);
728 }
729 }
730
731 [Event(35, Keywords = (EventKeywords)1L, Level = EventLevel.Informational, Task = (EventTask)8, Opcode = (EventOpcode)110, Message = "Transactionscope disposed: transaction ID is {0}")]
732 private void TransactionScopeDisposed(string transactionID)
733 {
734 SetActivityId(transactionID);
735 WriteEvent(35, transactionID);
736 }
737
738 [NonEvent]
740 {
741 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
742 {
743 TransactionScopeIncomplete(transactionID.TransactionIdentifier ?? string.Empty);
744 }
745 }
746
747 [Event(36, Keywords = (EventKeywords)1L, Level = EventLevel.Warning, Task = (EventTask)8, Opcode = (EventOpcode)117, Message = "Transactionscope incomplete: transaction ID is {0}")]
748 private void TransactionScopeIncomplete(string transactionID)
749 {
750 SetActivityId(transactionID);
751 WriteEvent(36, transactionID);
752 }
753
754 [NonEvent]
755 internal void TransactionScopeInternalError(string error)
756 {
757 if (IsEnabled(EventLevel.Critical, EventKeywords.All))
758 {
760 }
761 }
762
763 [Event(37, Keywords = (EventKeywords)1L, Level = EventLevel.Critical, Task = (EventTask)8, Opcode = (EventOpcode)119, Message = "Transactionscope internal error: {0}")]
764 private void TransactionScopeInternalErrorTrace(string error)
765 {
766 SetActivityId(string.Empty);
767 WriteEvent(37, error);
768 }
769
770 [NonEvent]
772 {
773 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
774 {
775 TransactionScopeTimeout(transactionID.TransactionIdentifier ?? string.Empty);
776 }
777 }
778
779 [Event(39, Keywords = (EventKeywords)1L, Level = EventLevel.Warning, Task = (EventTask)8, Opcode = (EventOpcode)128, Message = "Transactionscope timeout: transaction ID is {0}")]
780 private void TransactionScopeTimeout(string transactionID)
781 {
782 SetActivityId(transactionID);
783 WriteEvent(39, transactionID);
784 }
785
786 [NonEvent]
788 {
789 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
790 {
791 TransactionTimeout(transactionID.TransactionIdentifier ?? string.Empty);
792 }
793 }
794
795 [Event(30, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)5, Opcode = (EventOpcode)128, Message = "Transaction timeout: transaction ID is {0}")]
796 private void TransactionTimeout(string transactionID)
797 {
798 SetActivityId(transactionID);
799 WriteEvent(30, transactionID);
800 }
801
802 [NonEvent]
803 internal void TransactionstateEnlist(EnlistmentTraceIdentifier enlistmentID, EnlistmentType enlistmentType, EnlistmentOptions enlistmentOption)
804 {
805 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
806 {
807 if (enlistmentID.EnlistmentIdentifier != 0)
808 {
809 TransactionstateEnlist(enlistmentID.EnlistmentIdentifier.ToString(), enlistmentType.ToString(), enlistmentOption.ToString());
810 }
811 else
812 {
813 TransactionstateEnlist(string.Empty, enlistmentType.ToString(), enlistmentOption.ToString());
814 }
815 }
816 }
817
818 [Event(40, Keywords = (EventKeywords)2L, Level = EventLevel.Informational, Task = (EventTask)9, Opcode = (EventOpcode)112, Message = "Transactionstate enlist: Enlistment ID is {0}, type is {1} and options is {2}")]
819 private void TransactionstateEnlist(string enlistmentID, string type, string option)
820 {
821 SetActivityId(string.Empty);
822 WriteEvent(40, enlistmentID, type, option);
823 }
824
825 [NonEvent]
827 {
828 if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
829 {
830 TransactionCommitted(transactionID.TransactionIdentifier ?? string.Empty);
831 }
832 }
833
834 [Event(20, Keywords = (EventKeywords)2L, Level = EventLevel.Verbose, Task = (EventTask)5, Opcode = (EventOpcode)105, Message = "Transaction committed: transaction ID is {0}")]
835 private void TransactionCommitted(string transactionID)
836 {
837 SetActivityId(transactionID);
838 WriteEvent(20, transactionID);
839 }
840
841 [NonEvent]
843 {
844 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
845 {
846 TransactionInDoubt(transactionID.TransactionIdentifier ?? string.Empty);
847 }
848 }
849
850 [Event(25, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)5, Opcode = (EventOpcode)118, Message = "Transaction indoubt: transaction ID is {0}")]
851 private void TransactionInDoubt(string transactionID)
852 {
853 SetActivityId(transactionID);
854 WriteEvent(25, transactionID);
855 }
856
857 [NonEvent]
859 {
860 if (IsEnabled(EventLevel.Informational, EventKeywords.All))
861 {
862 TransactionPromoted(transactionID.TransactionIdentifier ?? string.Empty, distributedTxID.TransactionIdentifier ?? string.Empty);
863 }
864 }
865
866 [Event(27, Keywords = (EventKeywords)2L, Level = EventLevel.Informational, Task = (EventTask)5, Opcode = (EventOpcode)123, Message = "Transaction promoted: transaction ID is {0} and distributed transaction ID is {1}")]
867 private void TransactionPromoted(string transactionID, string distributedTxID)
868 {
869 SetActivityId(transactionID);
870 WriteEvent(27, transactionID, distributedTxID);
871 }
872
873 [NonEvent]
875 {
876 if (IsEnabled(EventLevel.Warning, EventKeywords.All))
877 {
878 TransactionAborted(transactionID.TransactionIdentifier ?? string.Empty);
879 }
880 }
881
882 [Event(17, Keywords = (EventKeywords)2L, Level = EventLevel.Warning, Task = (EventTask)5, Opcode = (EventOpcode)100, Message = "Transaction aborted: transaction ID is {0}")]
883 private void TransactionAborted(string transactionID)
884 {
885 SetActivityId(transactionID);
886 WriteEvent(17, transactionID);
887 }
888
889 private void SetActivityId(string str)
890 {
891 Guid result = Guid.Empty;
892 if (str.Contains('-'))
893 {
894 if (str.Length >= 36)
895 {
896 Guid.TryParse(str.AsSpan(0, 36), out result);
897 }
898 }
899 else if (str.Length >= 32)
900 {
901 Guid.TryParse(str.AsSpan(0, 32), out result);
902 }
904 }
905}
static void SetCurrentThreadActivityId(Guid activityId)
unsafe void WriteEvent(int eventId)
override string ToString()
Definition Empty.cs:11
EnlistmentTraceIdentifier EnlistmentTraceId
TransactionTraceIdentifier TransactionTraceId
void EnlistmentStatus(InternalEnlistment enlistment, NotificationCall notificationCall)
void EnlistmentPrepared(InternalEnlistment enlistment)
void TransactionScopeTimeout(TransactionTraceIdentifier transactionID)
void TransactionInDoubt(TransactionTraceIdentifier transactionID)
void TransactionDependentCloneComplete(Transaction transaction, string type)
void TransactionScopeCurrentChanged(TransactionTraceIdentifier currenttransactionID, TransactionTraceIdentifier newtransactionID)
void MethodEnterTraceLtm(string thisOrContextObject, string methodname)
void TransactionExceptionBase(string type, string message, string innerExceptionStr)
void TransactionScopeCreated(string transactionID, TransactionScopeResult transactionScopeResult)
void TransactionScopeDisposed(TransactionTraceIdentifier transactionID)
void TransactionCommit(string transactionIdentifier, string type)
void TransactionExceptionTrace(TraceSourceType traceSource, TransactionExceptionType type, string message, string innerExceptionStr)
void TransactionCommitted(TransactionTraceIdentifier transactionID)
void TransactionstateEnlist(string enlistmentID, string type, string option)
void TransactionExceptionTrace(TransactionExceptionType type, string message, string innerExceptionStr)
void MethodEnter(TraceSourceType traceSource, [CallerMemberName] string methodname=null)
void TransactionCloneCreate(string transactionIdentifier, string type)
void InvalidOperation(string type, string operation)
void EnlistmentCommitted(InternalEnlistment enlistment)
void MethodExitTraceLtm(string thisOrContextObject, string methodname)
void MethodExitTraceBase(string thisOrContextObject, string methodname)
void TransactionScopeCreated(TransactionTraceIdentifier transactionID, TransactionScopeResult transactionScopeResult)
void EnlistmentAborted(InternalEnlistment enlistment)
void TransactionManagerRecoveryComplete(Guid resourceManagerID)
void EnlistmentDone(InternalEnlistment enlistment)
void ExceptionConsumed(TraceSourceType traceSource, Exception exception)
void MethodExitTraceDistributed(string thisOrContextObject, string methodname)
void TransactionCreated(string transactionIdentifier, string type)
void TransactionTimeout(TransactionTraceIdentifier transactionID)
void MethodExit(TraceSourceType traceSource, object thisOrContextObject, [CallerMemberName] string methodname=null)
void TransactionCloneCreate(Transaction transaction, string type)
void TransactionPromoted(TransactionTraceIdentifier transactionID, TransactionTraceIdentifier distributedTxID)
void TransactionDependentCloneComplete(string transactionIdentifier, string type)
void TransactionAborted(TransactionTraceIdentifier transactionID)
void TransactionInvalidOperation(string transactionIdentifier, string type, string operation)
void TransactionRollback(string transactionIdentifier, string type)
void TransactionPromoted(string transactionID, string distributedTxID)
void EnlistmentForceRollback(InternalEnlistment enlistment)
void TransactionScopeCurrentChanged(string currenttransactionID, string newtransactionID)
void TransactionExceptionLtm(string type, string message, string innerExceptionStr)
void MethodEnterTraceDistributed(string thisOrContextObject, string methodname)
void TransactionstateEnlist(EnlistmentTraceIdentifier enlistmentID, EnlistmentType enlistmentType, EnlistmentOptions enlistmentOption)
void EnlistmentStatus(int enlistmentIdentifier, string notificationCall)
static readonly TransactionsEtwProvider Log
void MethodEnter(TraceSourceType traceSource, object thisOrContextObject, [CallerMemberName] string methodname=null)
void TransactionScopeNestedIncorrectly(TransactionTraceIdentifier transactionID)
void TransactionRollback(Transaction transaction, string type)
void TransactionCommit(Transaction transaction, string type)
void EnlistmentForceRollback(int enlistmentIdentifier)
void MethodEnterTraceBase(string thisOrContextObject, string methodname)
void TransactionScopeIncomplete(TransactionTraceIdentifier transactionID)
void TransactionCreated(Transaction transaction, string type)
void MethodExit(TraceSourceType traceSource, [CallerMemberName] string methodname=null)
void EnlistmentInDoubt(InternalEnlistment enlistment)
static bool TryParse([NotNullWhen(true)] string? input, out Guid result)
Definition Guid.cs:206
override string ToString()
Definition Guid.cs:695
static readonly Guid Empty
Definition Guid.cs:86