-
Notifications
You must be signed in to change notification settings - Fork 185
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 trace_tcpdrop image based gadget #2477
Conversation
2c030e3
to
e6ac2bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! A few initial comments.
ad4d511
to
4c08fe7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from code inspection. I haven't been able to test it because I don't have a recent enough kernel available right now to test it.
gadgets/trace_tcpdrop/gadget.yaml
Outdated
attributes: | ||
template: pid | ||
- name: tid | ||
description: 'TODO: Fill field description' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fill (or remove) this descriptions.
gadget_mntns_id mount_ns_id; | ||
__u32 pid; | ||
__u32 tid; | ||
__u32 uid; | ||
__u32 gid; | ||
__u8 task[TASK_COMM_LEN]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original gadget has two instances of this fields:
inspektor-gadget/pkg/gadgets/trace/tcpdrop/tracer/bpf/tcpdrop.h
Lines 37 to 38 in 616a94c
struct proc_ctx proc_current; | |
struct proc_ctx proc_socket; |
I think it's fine to use only one of this for now given that we don't support sub-structures in the event. Would you mind adding a small comment indicating it should be converted to a structure once we support that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Also added an entry to #2316 (comment)
5c4061e
to
55d01a4
Compare
Signed-off-by: Claudia Marcu <claudiamarcu@microsoft.com>
55d01a4
to
42a5187
Compare
Many thanks for the feedback! Will merge once the CI checks have passed.
|
Add trace_tcpdrop image based gadget
Adding the conversion of tcpdrop gadget to the image based version.
We have currently no integration tests for tcpdrop, so created this issue for working on that: #2476
Testing done