diff --git a/examples/cgroup_skb/main.go b/examples/cgroup_skb/main.go index 7fcf3941a..8870f5fed 100644 --- a/examples/cgroup_skb/main.go +++ b/examples/cgroup_skb/main.go @@ -58,6 +58,7 @@ func main() { // Read loop reporting the total amount of times the kernel // function was entered, once per second. ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() for range ticker.C { var value uint64 diff --git a/examples/kprobe/main.go b/examples/kprobe/main.go index a64333a92..d775a6513 100644 --- a/examples/kprobe/main.go +++ b/examples/kprobe/main.go @@ -50,6 +50,7 @@ func main() { // Read loop reporting the total amount of times the kernel // function was entered, once per second. ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() log.Println("Waiting for events..") diff --git a/examples/kprobe_percpu/main.go b/examples/kprobe_percpu/main.go index 7c8b4c69d..7b5afa16e 100644 --- a/examples/kprobe_percpu/main.go +++ b/examples/kprobe_percpu/main.go @@ -50,6 +50,7 @@ func main() { // Read loop reporting the total amount of times the kernel // function was entered, once per second. ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() log.Println("Waiting for events..") diff --git a/examples/kprobepin/main.go b/examples/kprobepin/main.go index cfac5b972..b265871c6 100644 --- a/examples/kprobepin/main.go +++ b/examples/kprobepin/main.go @@ -68,6 +68,7 @@ func main() { // Read loop reporting the total amount of times the kernel // function was entered, once per second. ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() log.Println("Waiting for events..") diff --git a/examples/tracepoint_in_c/main.go b/examples/tracepoint_in_c/main.go index c6b1b67da..e1c6601bc 100644 --- a/examples/tracepoint_in_c/main.go +++ b/examples/tracepoint_in_c/main.go @@ -48,6 +48,8 @@ func main() { // Read loop reporting the total amount of times the kernel // function was entered, once per second. ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() + log.Println("Waiting for events..") for range ticker.C { var value uint64