Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Include Pprof label in Goroutine name/header in the _call stack_ section of the debugger #3247

Open
gm0stache opened this issue Mar 12, 2024 · 0 comments

Comments

@gm0stache
Copy link

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

Thanks for all your work and time!
Happy to answer any upcoming questions!

BR
Gabriel

@gopherbot gopherbot added this to the Untriaged milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants