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

tetra: fix --policy-names to apply all event types #3044

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justin0u0
Copy link

Description

In #1867, the --policy-names flag was added to filter events based on the tracing policy. However, the filter was only appled to kprobe events.

This patch extends the filter to support all events types: kprobe, tracepoint, uprobe and lsm.

@justin0u0 justin0u0 requested a review from a team as a code owner October 25, 2024 07:44
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

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

Thanks!

Other than a minor comment, this LGTM!


switch ev := (response.Event).(type) {
case *tetragon.GetEventsResponse_ProcessKprobe:
return ev.ProcessKprobe.PolicyName
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for not using GetPolicyName() here? It's a bit safer if the pointer is nil which shouldn't happen normally but better to avoid crashing

Copy link
Author

Choose a reason for hiding this comment

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

I think using GetPolicyName() is better, thanks!

In cilium#1867, the `--policy-names` flag was added to filter events
based on the tracing policy. However, the filter was only appled
to `kprobe` events.

This patch extends the filter to support all events types:
`kprobe`, `tracepoint`, `uprobe` and `lsm`.

Signed-off-by: Justin Chen <[email protected]>
@justin0u0 justin0u0 force-pushed the fix/tetra-filter-policy-names branch from e84d039 to 547ccdd Compare October 25, 2024 09:05
@mtardy mtardy added the release-note/minor This PR introduces a minor user-visible change label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants