
Uprobes get automatically cleaned and removed when the reference to the Link object is lost. Hold a reference to any active Uprobe Link for duration of Delve execution and ensure they are cleaned up at exit. Fixes ebpf probes don't work after time.Sleep() #3227
23 lines
259 B
Go
23 lines
259 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
i := int64(0)
|
|
for i = 0; i < 5; i++ {
|
|
tracedFunction(i)
|
|
}
|
|
for i = 5; i < 10; i++ {
|
|
tracedFunction(i)
|
|
time.Sleep(time.Second)
|
|
}
|
|
}
|
|
|
|
//go:noinline
|
|
func tracedFunction(x int64) {
|
|
fmt.Println(x)
|
|
}
|