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

examples: add ticker Stop function #620

Merged
merged 1 commit into from Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/cgroup_skb/main.go
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/kprobe/main.go
Expand Up @@ -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..")

Expand Down
1 change: 1 addition & 0 deletions examples/kprobe_percpu/main.go
Expand Up @@ -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..")

Expand Down
1 change: 1 addition & 0 deletions examples/kprobepin/main.go
Expand Up @@ -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..")

Expand Down
2 changes: 2 additions & 0 deletions examples/tracepoint_in_c/main.go
Expand Up @@ -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
Expand Down