File: goroutineLabels.go

package info (click to toggle)
delve 1.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 15,084 kB
  • sloc: ansic: 111,947; sh: 194; asm: 147; makefile: 43; python: 23
file content (23 lines) | stat: -rw-r--r-- 307 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"context"
	"runtime"
	"runtime/pprof"
)

func main() {
	ctx := context.Background()
	labels := pprof.Labels("k1", "v1", "k2", "v2")
	runtime.Breakpoint()
	pprof.Do(ctx, labels, f)
}

var dummy int

func f(ctx context.Context) {
	a := dummy
	runtime.Breakpoint()
	dummy++
	dummy = a
}