Skip to content

Changing bpf prog load, map create event names to be more descriptive #667

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

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

sharlns
Copy link
Contributor

@sharlns sharlns commented Jan 27, 2023

Signed-off-by: Natalia Reka Ivanko [email protected]

@sharlns sharlns requested a review from a team as a code owner January 27, 2023 13:42
@sharlns sharlns requested a review from tixxdz January 27, 2023 13:42
Copy link
Member

@tixxdz tixxdz left a comment

Choose a reason for hiding this comment

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

It could be ok , however if we have users relying on bpf check results that this can be confusing, the prog type is also available after the bpf_check so I guess we can be more specific. @olsajiri

@@ -268,7 +268,7 @@ func (p *CompactEncoder) EventToString(response *tetragon.GetEventsResponse) (st
}
return CapTrailorPrinter(fmt.Sprintf("%s %s %s bytes %d", event, processInfo, args, bytes), caps), nil
case "bpf_check":
event := p.Colorer.Blue.Sprintf("🐝 %-7s", "bpf_check")
event := p.Colorer.Blue.Sprintf("🐝 %-7s", "bpf_load")
Copy link
Member

Choose a reason for hiding this comment

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

bpf_check is related to the bpf verifier so the description is correct, it could be even changed to bpf_verifier_check for users.

And that one could fail at the verifier so strictly speaking the load may not happen, I suggest to have another call hook after the bpf_check to sure that the load did happen.

How this is triggered do we have a CRD for it?

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue here is the use case is to have a hook when bpf programs are loaded not so much about the verifier. So for users bpf_load makes sense IMO and is more intuitive.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, so let's improve it with another patch something like at bpf_audit_prog(prog, audit_load || unload); that could better assert things really happened, would this be ok?

Copy link
Member

Choose a reason for hiding this comment

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

nah seems it can be inlined, will see later.

@@ -268,7 +268,7 @@ func (p *CompactEncoder) EventToString(response *tetragon.GetEventsResponse) (st
}
return CapTrailorPrinter(fmt.Sprintf("%s %s %s bytes %d", event, processInfo, args, bytes), caps), nil
case "bpf_check":
event := p.Colorer.Blue.Sprintf("🐝 %-7s", "bpf_check")
event := p.Colorer.Blue.Sprintf("🐝 %-7s", "bpf_load")
Copy link
Member

Choose a reason for hiding this comment

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

Alright, so let's improve it with another patch something like at bpf_audit_prog(prog, audit_load || unload); that could better assert things really happened, would this be ok?

@tixxdz tixxdz merged commit a818202 into main Feb 9, 2023
@tixxdz tixxdz deleted the pr/natalia/bpf-prog-cli-change branch February 9, 2023 08:46
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.

3 participants