diff --git a/src/Tools/dotnet-trace/CommandLine/Commands/CollectLinuxCommand.cs b/src/Tools/dotnet-trace/CommandLine/Commands/CollectLinuxCommand.cs index ab99addcc6..4e5f064cde 100644 --- a/src/Tools/dotnet-trace/CommandLine/Commands/CollectLinuxCommand.cs +++ b/src/Tools/dotnet-trace/CommandLine/Commands/CollectLinuxCommand.cs @@ -74,13 +74,6 @@ internal int CollectLinux(CollectLinuxArgs args) return (int)ReturnCode.PlatformNotSupportedError; } - Console.WriteLine("=========================================================================================="); - Console.WriteLine("The collect-linux verb is a new preview feature and relies on an updated version of the"); - Console.WriteLine(".nettrace file format. The latest PerfView release supports these trace files but other"); - Console.WriteLine("ways of using the trace file may not work yet. For more details, see the docs at"); - Console.WriteLine("https://learn.microsoft.com/dotnet/core/diagnostics/dotnet-trace."); - Console.WriteLine("=========================================================================================="); - int ret = (int)ReturnCode.TracingError; string scriptPath = null; try diff --git a/src/tests/dotnet-trace/CollectLinuxCommandFunctionalTests.cs b/src/tests/dotnet-trace/CollectLinuxCommandFunctionalTests.cs index 75149cc5ff..47f8a83295 100644 --- a/src/tests/dotnet-trace/CollectLinuxCommandFunctionalTests.cs +++ b/src/tests/dotnet-trace/CollectLinuxCommandFunctionalTests.cs @@ -119,7 +119,7 @@ public void CollectLinuxCommand_Probe_ListsProcesses_WhenNoArgs() int exitCode = Run(args, console); Assert.Equal((int)ReturnCode.Ok, exitCode); - string[] expected = ExpectPreviewWithMessages( + string[] expected = ExpectMessages( new[] { "Probing .NET processes for support of the EventPipe UserEvents IPC command used by collect-linux. Requires runtime '10.0.0' or later.", ".NET processes that support the command:", @@ -139,7 +139,7 @@ public void CollectLinuxCommand_Probe_CsvToConsole() int exitCode = Run(args, console); Assert.Equal((int)ReturnCode.Ok, exitCode); - string[] expected = ExpectPreviewWithMessages( + string[] expected = ExpectMessages( new[] { "pid,processName,supportsCollectLinux", "" @@ -157,7 +157,7 @@ public void CollectLinuxCommand_Probe_Csv() int exitCode = Run(args, console); Assert.Equal((int)ReturnCode.Ok, exitCode); - string[] expected = ExpectPreviewWithMessages( + string[] expected = ExpectMessages( new[] { "Successfully wrote EventPipe UserEvents IPC command support results to '" + tempFilePath + "'.", } @@ -235,7 +235,7 @@ public void CollectLinuxCommand_Probe_ReportsConnectionFailed_NonDotNetProcess() int exitCode = Run(args, console); Assert.Equal((int)ReturnCode.Ok, exitCode); - string[] expected = ExpectPreviewWithMessages( + string[] expected = ExpectMessages( new[] { $"Could not probe process '{pid1Name} (1)'. The process may have exited, or it doesn't have an accessible .NET diagnostic port.", } @@ -582,10 +582,7 @@ private static string FormatProvider(string name, string keywordsHex, string lev } private static string[] FormatException(string message) { - List result = new(); - result.AddRange(PreviewMessages); - result.Add($"[ERROR] {message}"); - return result.ToArray(); + return [$"[ERROR] {message}"]; } private static string DefaultOutputFile => $"Output File : {Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar}trace.nettrace"; private static readonly string[] CommonTail = [ @@ -594,19 +591,9 @@ private static string[] FormatException(string message) "[dd:hh:mm:ss]\tRecording trace.", "Press or to exit...", ]; - private static string[] PreviewMessages = [ - "==========================================================================================", - "The collect-linux verb is a new preview feature and relies on an updated version of the", - ".nettrace file format. The latest PerfView release supports these trace files but other", - "ways of using the trace file may not work yet. For more details, see the docs at", - "https://learn.microsoft.com/dotnet/core/diagnostics/dotnet-trace.", - "==========================================================================================" - ]; - - private static string[] ExpectPreviewWithMessages(string[] messages) + private static string[] ExpectMessages(string[] messages) { List result = new(); - result.AddRange(PreviewMessages); if (messages.Length > 0) { result.AddRange(messages); @@ -621,8 +608,6 @@ private static string[] ExpectProvidersAndPerfEventsWithMessages(string[] messag { List result = new(); - result.AddRange(PreviewMessages); - if (messages.Length > 0) { result.AddRange(messages);