Skip to content

Commit 40f7ae5

Browse files
committed
Clean up tracing
1 parent 3412acf commit 40f7ae5

25 files changed

+469
-3357
lines changed

src/libraries/System.Transactions.Local/src/System.Transactions.Local.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,6 @@
9898
<Compile Include="System\Transactions\Oletx\OletxTransaction.cs" />
9999
<Compile Include="System\Transactions\Oletx\OletxTransactionManager.cs" />
100100
<Compile Include="System\Transactions\Oletx\OletxVolatileEnlistment.cs" />
101-
<Compile Include="System\Transactions\Trace\Activity.cs" />
102-
<Compile Include="System\Transactions\Trace\DiagnosticStrings.cs" />
103-
<Compile Include="System\Transactions\Trace\DiagnosticTraceCode.cs" />
104-
<Compile Include="System\Transactions\Trace\DiagnosticTrace.cs" />
105-
<Compile Include="System\Transactions\Trace\PlainXmlWriter.cs" />
106-
<Compile Include="System\Transactions\Trace\TraceCode.cs" />
107-
<Compile Include="System\Transactions\Trace\TraceRecord.cs" />
108-
<Compile Include="System\Transactions\Trace\TraceRecords.cs" />
109-
<Compile Include="System\Transactions\Trace\TraceXPathNavigator.cs" />
110101
<Compile Include="System\Transactions\TransactionInterop.cs" />
111102
</ItemGroup>
112103
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'windows'">

src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal CommittableTransaction(IsolationLevel isoLevel, TimeSpan timeout) : bas
3939
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
4040
if (etwLog.IsEnabled())
4141
{
42-
etwLog.TransactionCreated(this, "CommittableTransaction");
42+
etwLog.TransactionCreated(TraceSourceType.TraceSourceLtm, TransactionTraceId, "CommittableTransaction");
4343
}
4444
}
4545

src/libraries/System.Transactions.Local/src/System/Transactions/DependentTransaction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void Complete()
6161

6262
if (etwLog.IsEnabled())
6363
{
64-
etwLog.TransactionDependentCloneComplete(this, "DependentTransaction");
64+
etwLog.TransactionDependentCloneComplete(TraceSourceType.TraceSourceLtm, TransactionTraceId, "DependentTransaction");
6565
etwLog.MethodExit(TraceSourceType.TraceSourceLtm, this);
6666
}
6767
}

src/libraries/System.Transactions.Local/src/System/Transactions/DurableEnlistmentState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ internal override void EnterState(InternalEnlistment enlistment)
9696
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
9797
if (etwLog.IsEnabled())
9898
{
99-
etwLog.EnlistmentStatus(enlistment, NotificationCall.Rollback);
99+
etwLog.EnlistmentStatus(TraceSourceType.TraceSourceLtm, enlistment.EnlistmentTraceId, NotificationCall.Rollback);
100100
}
101101

102102
// Send the Rollback notification to the enlistment
@@ -147,7 +147,7 @@ internal override void EnterState(InternalEnlistment enlistment)
147147
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
148148
if (etwLog.IsEnabled())
149149
{
150-
etwLog.EnlistmentStatus(enlistment, NotificationCall.SinglePhaseCommit);
150+
etwLog.EnlistmentStatus(TraceSourceType.TraceSourceLtm, enlistment.EnlistmentTraceId, NotificationCall.SinglePhaseCommit);
151151
}
152152

153153
// Send the Commit notification to the enlistment

src/libraries/System.Transactions.Local/src/System/Transactions/Oletx/DTCTransactionManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Diagnostics.CodeAnalysis;
55
using System.Runtime.InteropServices;
66
using System.Globalization;
7-
using System.Transactions.Diagnostics;
87
using System.Transactions.DtcProxyShim;
98

109
namespace System.Transactions.Oletx;
@@ -120,9 +119,10 @@ internal static uint AdjustTimeout(TimeSpan timeout)
120119
catch (OverflowException caughtEx)
121120
{
122121
// timeout.TotalMilliseconds might be negative, so let's catch overflow exceptions, just in case.
123-
if (DiagnosticTrace.Verbose)
122+
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
123+
if (etwLog.IsEnabled())
124124
{
125-
ExceptionConsumedTraceRecord.Trace(SR.TraceSourceOletx, caughtEx);
125+
etwLog.ExceptionConsumed(TraceSourceType.TraceSourceOleTx, caughtEx);
126126
}
127127

128128
returnTimeout = uint.MaxValue;

src/libraries/System.Transactions.Local/src/System/Transactions/Oletx/OletxDependentTransaction.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System;
55
using System.Diagnostics;
66
using System.Threading;
7-
using System.Transactions.Diagnostics;
87

98
namespace System.Transactions.Oletx;
109

@@ -25,14 +24,12 @@ internal OletxDependentTransaction(RealOletxTransaction realTransaction, bool de
2524

2625
_volatileEnlistmentContainer = RealOletxTransaction.AddDependentClone(delayCommit);
2726

28-
if (DiagnosticTrace.Information)
27+
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
28+
if (etwLog.IsEnabled())
2929
{
30-
DependentCloneCreatedTraceRecord.Trace(
31-
SR.TraceSourceOletx,
32-
TransactionTraceId,
33-
delayCommit
34-
? DependentCloneOption.BlockCommitUntilComplete
35-
: DependentCloneOption.RollbackIfNotComplete);
30+
etwLog.TransactionDependentCloneCreate(TraceSourceType.TraceSourceOleTx, TransactionTraceId, delayCommit
31+
? DependentCloneOption.BlockCommitUntilComplete
32+
: DependentCloneOption.RollbackIfNotComplete);
3633
}
3734
}
3835

@@ -52,9 +49,9 @@ public void Complete()
5249
throw TransactionException.CreateTransactionCompletedException(DistributedTxId);
5350
}
5451

55-
if (DiagnosticTrace.Information)
52+
if (etwLog.IsEnabled())
5653
{
57-
DependentCloneCompleteTraceRecord.Trace(SR.TraceSourceOletx, TransactionTraceId);
54+
etwLog.TransactionDependentCloneComplete(TraceSourceType.TraceSourceOleTx, TransactionTraceId, "DependentTransaction");
5855
}
5956

6057
_volatileEnlistmentContainer.DependentCloneCompleted();

0 commit comments

Comments
 (0)