Skip to content

Document "showPprofLabels" debug configuration attribute #3247

@gm0stache

Description

@gm0stache

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

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

BR
Gabriel

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestHelpWantedIssues that are not prioritized by the maintainers. Help is requested from community contributors.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions