From: j-h.choi Date: Mon, 25 Jan 2021 04:28:22 +0000 (+0900) Subject: [Tizen] Add dotnet-stack tool X-Git-Tag: accepted/tizen/unified/riscv/20231226.055542~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=148c0aac9ca25bb3462b3f025817636f0ea1e81e;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git [Tizen] Add dotnet-stack tool --- diff --git a/documentation/design-docs/dotnet-tools.md b/documentation/design-docs/dotnet-tools.md index bd36698d0..2fb161e13 100644 --- a/documentation/design-docs/dotnet-tools.md +++ b/documentation/design-docs/dotnet-tools.md @@ -462,7 +462,6 @@ COMMANDS REPORT dotnet-stack report -p|--process-id - -n|--name [-h|--help] Prints the managed stack from every thread in the target process diff --git a/packaging/coreclr-diagnostics.spec b/packaging/coreclr-diagnostics.spec index 2e8849ad8..1bb9221ae 100755 --- a/packaging/coreclr-diagnostics.spec +++ b/packaging/coreclr-diagnostics.spec @@ -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} diff --git a/src/Tools/dotnet-stack/ReportCommand.cs b/src/Tools/dotnet-stack/ReportCommand.cs index 76ca818ea..d003a8c2f 100644 --- a/src/Tools/dotnet-stack/ReportCommand.cs +++ b/src/Tools/dotnet-stack/ReportCommand.cs @@ -22,7 +22,7 @@ namespace Microsoft.Diagnostics.Tools.Stack { internal static class ReportCommandHandler { - private delegate Task ReportDelegate(CancellationToken ct, IConsole console, int processId, string name, TimeSpan duration); + private delegate Task ReportDelegate(CancellationToken ct, IConsole console, int processId, TimeSpan duration); /// /// Reports a stack trace @@ -30,31 +30,15 @@ namespace Microsoft.Diagnostics.Tools.Stack /// The cancellation token /// /// The process to report the stack from. - /// The name of process to report the stack from. /// The duration of to trace the target for. /// - private static async Task Report(CancellationToken ct, IConsole console, int processId, string name, TimeSpan duration) + private static async Task 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(name: "pid") }; - - public static Option NameOption() => - new( - aliases: new[] { "-n", "--name" }, - description: "The name of the process to report the stack.") - { - Argument = new Argument(name: "name") - }; } }