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

Remove PerfTrace Support #15241

Merged
merged 1 commit into from
Jan 9, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 16 additions & 19 deletions src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,25 @@ public CommandResult Execute(Action<Process> processStarted)

Reporter.Verbose.WriteLine($"> {FormatProcessInfo(_process.StartInfo)}".White());
#endif
using (PerfTrace.Current.CaptureTiming($"{Path.GetFileNameWithoutExtension(_process.StartInfo.FileName)} {_process.StartInfo.Arguments}"))
using (var reaper = new ProcessReaper(_process))
{
using (var reaper = new ProcessReaper(_process))
_process.Start();
if (processStarted != null)
{
_process.Start();
if (processStarted != null)
{
processStarted(_process);
}
reaper.NotifyProcessStarted();

Reporter.Verbose.WriteLine(string.Format(
LocalizableStrings.ProcessId,
_process.Id));

var taskOut = _stdOut?.BeginRead(_process.StandardOutput);
var taskErr = _stdErr?.BeginRead(_process.StandardError);
_process.WaitForExit();

taskOut?.Wait();
taskErr?.Wait();
processStarted(_process);
}
reaper.NotifyProcessStarted();

Reporter.Verbose.WriteLine(string.Format(
LocalizableStrings.ProcessId,
_process.Id));

var taskOut = _stdOut?.BeginRead(_process.StandardOutput);
var taskErr = _stdErr?.BeginRead(_process.StandardError);
_process.WaitForExit();

taskOut?.Wait();
taskErr?.Wait();
}

var exitCode = _process.ExitCode;
Expand Down
34 changes: 0 additions & 34 deletions src/Cli/Microsoft.DotNet.Cli.Utils/Tracing/PerfTrace.cs

This file was deleted.

27 changes: 0 additions & 27 deletions src/Cli/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceEvent.cs

This file was deleted.

80 changes: 0 additions & 80 deletions src/Cli/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceOutput.cs

This file was deleted.

This file was deleted.

53 changes: 18 additions & 35 deletions src/Cli/dotnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,11 @@ public static int Main(string[] args)
PerformanceLogEventSource.Log.LogStartUpInformation(startupInfo);
PerformanceLogEventSource.Log.CLIStart();

if (Env.GetEnvironmentVariableAsBool("DOTNET_CLI_CAPTURE_TIMING", false))
{
PerfTrace.Enabled = true;
}

InitializeProcess();

try
{
using (PerfTrace.Current.CaptureTiming())
{
return ProcessArgs(args);
}
return ProcessArgs(args);
}
catch (HelpException e)
{
Expand Down Expand Up @@ -94,12 +86,6 @@ public static int Main(string[] args)
}
finally
{
if (PerfTrace.Enabled)
{
Reporter.Output.WriteLine("Performance Summary:");
PerfTraceOutput.Print(Reporter.Output, PerfTrace.GetEvents());
}

PerformanceLogEventSource.Log.CLIStop();
}
}
Expand Down Expand Up @@ -280,27 +266,24 @@ private static void ConfigureDotNetForFirstTimeUse(
DotnetFirstRunConfiguration dotnetFirstRunConfiguration,
IEnvironmentProvider environmentProvider)
{
using (PerfTrace.Current.CaptureTiming())
var environmentPath = EnvironmentPathFactory.CreateEnvironmentPath(isDotnetBeingInvokedFromNativeInstaller, environmentProvider);
var commandFactory = new DotNetCommandFactory(alwaysRunOutOfProc: true);
var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
firstTimeUseNoticeSentinel,
aspNetCertificateSentinel,
aspnetCertificateGenerator,
toolPathSentinel,
dotnetFirstRunConfiguration,
Reporter.Output,
CliFolderPathCalculator.CliFallbackFolderPath,
environmentPath);

dotnetConfigurer.Configure();

if (isDotnetBeingInvokedFromNativeInstaller && OperatingSystem.IsWindows())
{
var environmentPath = EnvironmentPathFactory.CreateEnvironmentPath(isDotnetBeingInvokedFromNativeInstaller, environmentProvider);
var commandFactory = new DotNetCommandFactory(alwaysRunOutOfProc: true);
var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
firstTimeUseNoticeSentinel,
aspNetCertificateSentinel,
aspnetCertificateGenerator,
toolPathSentinel,
dotnetFirstRunConfiguration,
Reporter.Output,
CliFolderPathCalculator.CliFallbackFolderPath,
environmentPath);

dotnetConfigurer.Configure();

if (isDotnetBeingInvokedFromNativeInstaller && OperatingSystem.IsWindows())
{
DotDefaultPathCorrector.Correct();
}
DotDefaultPathCorrector.Correct();
}
}

Expand Down