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

tidy up examples #521

Merged
merged 3 commits into from
Dec 8, 2021
Merged

tidy up examples #521

merged 3 commits into from
Dec 8, 2021

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Dec 7, 2021

Clean up a couple of small things which have been bugging me for a bit.

It's not necessary to keep the .c file in a subfolder if you add a

    // +build ignore

to the top of the file. Move the .c next to the .go and rename the
files to be consistent with the example name.
Get rid of the init() function since there is no need for it. Also
fix a missing File.Close() in detectCgroupPath.
SIGTERM handlers are useful for examples which use ringbuffers, since
they demonstrate how to exit from the blocking Read() call. They're
not useful in examples which just read from a map.

Drop the signal handlers from such examples.
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all makes sense 👍 kprobepin .o's were not regenerated for some reason, pushed a fixup. Will merge when CI is green.

@lmb lmb merged commit 9325af1 into master Dec 8, 2021
@lmb lmb deleted the lmb/simplify-examples branch December 8, 2021 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants