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

Add an example for the RINGBUF map type #412

Merged
merged 5 commits into from
Sep 14, 2021

Conversation

pippolo84
Copy link
Member

Add a new example under /examples to show the usage of the newly introduced RINGBUF map type.

FIxes #396

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Copy link
Contributor

@mythi mythi left a comment

Choose a reason for hiding this comment

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

I tested it and also tried to go generate from scratch and everything seems to work OK:

$ sudo ./ringbuffer
2021/09/09 10:36:41 Waiting for events..
2021/09/09 10:36:44 pid: 338112	comm: bash
2021/09/09 10:36:48 pid: 338114	comm: bash
2021/09/09 10:37:02 pid: 338116	comm: bash
2021/09/09 10:37:07 pid: 338117	comm: bash
2021/09/09 10:37:20 pid: 338141	comm: waybar
2021/09/09 10:37:20 pid: 338142	comm: sh
^C2021/09/09 10:37:27 Received signal, exiting..

@lmb
Copy link
Collaborator

lmb commented Sep 9, 2021

LGTM also. I'm still a bit concerned that a lot of the examples are quite "verbose". Something to tackle later maybe.

@hao-lee
Copy link
Contributor

hao-lee commented Sep 10, 2021

Do we really need these intermediate files like *ebfel.go and *.o ? I still think we should provide a guide for users to generate them manually.

@mythi
Copy link
Contributor

mythi commented Sep 10, 2021

Do we really need these intermediate files like *ebfel.go and *.o ?

With this, the users don't need to worry about getting clang etc. installed and all they need is the Go compiler. This improves the user experience. More advanced users are always OK to re-generated if they like.

@hao-lee
Copy link
Contributor

hao-lee commented Sep 10, 2021

With this, the users don't need to worry about getting clang etc. installed and all they need is the Go compiler. This improves the user experience. More advanced users are always OK to re-generated if they like.

However, what we provide are just examples. They will eventually install clang-related packages if they want to develop their own tools.

@lmb
Copy link
Collaborator

lmb commented Sep 10, 2021

@hao-lee I understand that you might prefer not to commit files, however as long as it is your personal preference I'd ask you to trust our judgement and not raise this issue multiple times. Feel free to start a thread in our slack if there is a specific problem that these files cause you.

@hao-lee
Copy link
Contributor

hao-lee commented Sep 10, 2021

@lmb Got it. Thanks.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
@lmb lmb merged commit 552dbd8 into cilium:master Sep 14, 2021
@lmb
Copy link
Collaborator

lmb commented Sep 14, 2021

Thanks!

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.

Add BPF ringbuffer example to examples/
4 participants