Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log RAR "size" in ETW #6410

Merged
merged 6 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Framework/MSBuildEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ public void GenerateResourceOverallStop()
}

[Event(27, Keywords = Keywords.All | Keywords.PerformanceLog)]
public void RarOverallStart()
public void RarOverallStart(int assembliesCount, int assemblyFilesCount, bool findDependencies)
{
WriteEvent(27);
WriteEvent(27, assembliesCount, assemblyFilesCount, findDependencies);
}

[Event(28, Keywords = Keywords.All | Keywords.PerformanceLog)]
public void RarOverallStop()
public void RarOverallStop(int assembliesCount, int assemblyFilesCount, int resolvedFilesCount, int resolvedDependencyFilesCount, int copyLocalFilesCount)
{
WriteEvent(28);
WriteEvent(28, assembliesCount, assemblyFilesCount, resolvedFilesCount, resolvedDependencyFilesCount, copyLocalFilesCount);
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions src/Tasks/AssemblyDependency/ResolveAssemblyReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@ ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader
)
{
bool success = true;
MSBuildEventSource.Log.RarOverallStart();
MSBuildEventSource.Log.RarOverallStart(_assemblyNames.Length, _assemblyFiles.Length, _findDependencies);
{
try
{
Expand Down Expand Up @@ -2579,7 +2579,7 @@ out _copyLocalFiles
}
}
}
MSBuildEventSource.Log.RarOverallStop();
MSBuildEventSource.Log.RarOverallStop(_assemblyNames.Length, _assemblyFiles.Length, _resolvedFiles.Length, _resolvedDependencyFiles.Length, _copyLocalFiles.Length);
return success && !Log.HasLoggedErrors;
}
catch (ArgumentException e)
Expand All @@ -2596,7 +2596,7 @@ out _copyLocalFiles
}
}

MSBuildEventSource.Log.RarOverallStop();
MSBuildEventSource.Log.RarOverallStop(_resolvedFiles.Length, _resolvedDependencyFiles.Length, _copyLocalFiles.Length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider to use null check/propagation, for example _copyLocalFiles?.Length at both Stop events callings. It is not guaranteed to be not null - especially in catch scenarios.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great idea! That has bitten us before . . .


return success && !Log.HasLoggedErrors;
}
Expand Down