[Tizen] Add dotnet-stack tool
authorj-h.choi <j-h.choi@samsung.com>
Mon, 25 Jan 2021 04:28:22 +0000 (13:28 +0900)
committerMikhail Kurinnoi <m.kurinnoi@samsung.com>
Tue, 5 Dec 2023 16:31:16 +0000 (19:31 +0300)
documentation/design-docs/dotnet-tools.md
packaging/coreclr-diagnostics.spec
src/Tools/dotnet-stack/ReportCommand.cs

index bd36698d01e4113b0dbfbbb81f9628e88dbf2e93..2fb161e13e65a8cdb65be6cbd3d5552e1756c4d0 100644 (file)
@@ -462,7 +462,6 @@ COMMANDS
 REPORT
 
     dotnet-stack report -p|--process-id <pid>
-                        -n|--name <process-name>
                         [-h|--help]
 
     Prints the managed stack from every thread in the target process
index 2e8849ad8efcbf9dd4469b912b8cd8bff1f475f7..1bb9221ae42b91a5a749efdd1b06a639f0764188 100755 (executable)
@@ -190,7 +190,7 @@ cp -f %{_artifacts}/dotnet-sos/%{_buildtype}/netcoreapp*/publish/*/sosdocsunix.t
 # Tools
 mkdir -p %{buildroot}%{toolsdir}/%{rid}
 cp %{_artifacts}/Linux.%{_barch}.%{_buildtype}/*.so %{buildroot}%{toolsdir}/%{rid}
-for name in counters dump gcdump trace; do
+for name in counters dump gcdump stack trace; do
   cp -f %{_artifacts}/dotnet-${name}/%{_buildtype}/netcoreapp*/publish/*.dll %{buildroot}%{toolsdir}
 done
 cp -f %{_artifacts}/dotnet-dump/%{_buildtype}/netcoreapp*/publish/*/sosdocsunix.txt %{buildroot}%{toolsdir}
index 76ca818eadf28dbadc65be9f07f10eecb3927d10..d003a8c2f74fbe16c4c3a2fe5f7eaaa18bdba42f 100644 (file)
@@ -22,7 +22,7 @@ namespace Microsoft.Diagnostics.Tools.Stack
 {
     internal static class ReportCommandHandler
     {
-        private delegate Task<int> ReportDelegate(CancellationToken ct, IConsole console, int processId, string name, TimeSpan duration);
+        private delegate Task<int> ReportDelegate(CancellationToken ct, IConsole console, int processId, TimeSpan duration);
 
         /// <summary>
         /// Reports a stack trace
@@ -30,31 +30,15 @@ namespace Microsoft.Diagnostics.Tools.Stack
         /// <param name="ct">The cancellation token</param>
         /// <param name="console"></param>
         /// <param name="processId">The process to report the stack from.</param>
-        /// <param name="name">The name of process to report the stack from.</param>
         /// <param name="duration">The duration of to trace the target for. </param>
         /// <returns></returns>
-        private static async Task<int> Report(CancellationToken ct, IConsole console, int processId, string name, TimeSpan duration)
+        private static async Task<int> Report(CancellationToken ct, IConsole console, int processId, TimeSpan duration)
         {
             string tempNetTraceFilename = Path.Join(Path.GetTempPath(), Path.GetRandomFileName() + ".nettrace");
             string tempEtlxFilename = "";
 
             try
             {
-                // Either processName or processId has to be specified.
-                if (!string.IsNullOrEmpty(name))
-                {
-                    if (processId != 0)
-                    {
-                        Console.WriteLine("Can only specify either --name or --process-id option.");
-                        return -1;
-                    }
-                    processId = CommandUtils.FindProcessIdWithName(name);
-                    if (processId < 0)
-                    {
-                        return -1;
-                    }
-                }
-
                 if (processId < 0)
                 {
                     console.Error.WriteLine("Process ID should not be negative.");
@@ -190,7 +174,6 @@ namespace Microsoft.Diagnostics.Tools.Stack
                 HandlerDescriptor.FromDelegate((ReportDelegate)Report).GetCommandHandler(),
                 // Options
                 ProcessIdOption(),
-                NameOption(),
                 DurationOption()
             };
 
@@ -210,13 +193,5 @@ namespace Microsoft.Diagnostics.Tools.Stack
             {
                 Argument = new Argument<int>(name: "pid")
             };
-
-        public static Option NameOption() =>
-            new(
-                aliases: new[] { "-n", "--name" },
-                description: "The name of the process to report the stack.")
-            {
-                Argument = new Argument<string>(name: "name")
-            };
     }
 }