From f8c8b33da34b03fd0113ca7e8a44c0f81412c75f Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 4 Dec 2023 15:44:10 +0100 Subject: [PATCH] Show pprof labels in thread names (#3501) * Add pprofLabelForThreadNames config The config is a string value that indicates the key of a pprof label whose value should be shown as a goroutine name in the threads view. --- Documentation/api/dap/README.md | 1 + service/dap/command.go | 11 ++- service/dap/config.go | 43 +++++++++ service/dap/config_test.go | 8 +- service/dap/server.go | 72 +++++++++++--- service/dap/server_test.go | 166 +++++++++++++++++++++++--------- service/dap/types.go | 6 ++ 7 files changed, 243 insertions(+), 64 deletions(-) diff --git a/Documentation/api/dap/README.md b/Documentation/api/dap/README.md index 74565d07..c75f2d99 100644 --- a/Documentation/api/dap/README.md +++ b/Documentation/api/dap/README.md @@ -33,6 +33,7 @@ In addition to the general [DAP spec](https://microsoft.github.io/debug-adapter- stackTraceDepth
showGlobalVariables
showRegisters
+ showPprofLabels
hideSystemGoroutines
goroutineFilters diff --git a/service/dap/command.go b/service/dap/command.go index fb81a069..0cff856c 100644 --- a/service/dap/command.go +++ b/service/dap/command.go @@ -62,7 +62,14 @@ Type "help" followed by the name of a command for more information about it.` dlv config substitutePath -clear Adds or removes a path substitution rule. If -clear is used all substitutePath rules are removed. - See also Documentation/cli/substitutepath.md.` + See also Documentation/cli/substitutepath.md. + + dlv config showPprofLabels