-
Notifications
You must be signed in to change notification settings - Fork 851
Description
Update the launch configuration attributes (in package.json) and debug documentation to reflect the fact that showPprofLabels is a valid configuration value for debugging.
Original description
Is your feature request related to a problem? Please describe.
Pprof labels are not (directly) visible in the call stack section of the debugger.
Describe the solution you'd like
I would like the Pprof labels to be visible in the call stack section of the debugger.
Consider the following program:
package main
import (
"context"
"fmt"
"runtime/pprof"
"strconv"
"sync"
"time"
)
func worker(name string) {
time.Sleep(1 * time.Second)
fmt.Println("worker finished:", name)
}
func main() {
wg := sync.WaitGroup{}
for i := 0; i < 20; i++ {
wg.Add(1)
labels := pprof.Labels("worker", strconv.Itoa(i))
pprof.Do(context.TODO(), labels, func(ctx context.Context) {
go worker(strconv.Itoa(i))
})
}
wg.Wait()
}lauch profile:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${file}",
"hideSystemGoroutines": true,
"showPprofLabels": [
"*"
]
}
]
}When setting a breakpoint for last line im the main function, and debugging the program, I would like to see the goroutines listed in the call stack section with the configured pprof labels clearly visible. It would make debugging goroutines more straight forward.
Additional context
- the lauch profile prop
showPprofLabelsis not officially supported (maybe do so?), but I used it based on information from this issue: How to enable new pprof labels features? #3173
Thanks for all your work and time!
Happy to answer any upcoming questions!
BR
Gabriel