Repository navigation
Added cgid capture to stirling with testing - #1681
Conversation
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
|
@AdityaAtulTewari and I discussed this already but for those here, I'm planning to review this but it won't be until tomorrow or Monday. |
|
@pixie-io/maintainers in the meantime would we be able to let the CI jobs run? @AdityaAtulTewari is interested in seeing if there are any failures to address. |
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
ddelnano
left a comment
There was a problem hiding this comment.
@AdityaAtulTewari really appreciate the contribution and excited to address this short lived process issue! I have a few minor comments and some thoughts about the timeline for this fix's development.
We had previously discussed writing a trace bpf test that would exhibit this short lived process behavior. I think it's important to develop that before we make the change to store the cgroup ids (this PR). Essentially my thoughts are that we would take your containerized application from this branch, create a new trace bpf test with it and then follow it up with this change to verify it results in the records we expect.
I believe it's important to have confidence that a problematic application fails our existing pid based assertions but works with the cgroup id ones.
| r.Append<r.ColIndex("time_")>(entry.resp.timestamp_ns); | ||
| r.Append<r.ColIndex("upid")>(upid.value()); | ||
| r.Append<r.ColIndex("cgid")>(conn_id.cgid); | ||
| r.Append<r.ColIndex("remote_addr")>(conn_tracker.remote_endpoint().AddrStr()); | ||
| r.Append<r.ColIndex("remote_port")>(conn_tracker.remote_endpoint().port()); | ||
| r.Append<r.ColIndex("trace_role")>(conn_tracker.role()); |
There was a problem hiding this comment.
There are many shared fields amongst each data table definition and record builder. This seems like a good opportunity to provide a mechanism for adding new columns in the future. We could define a macro like so:
#define APPEND_SKT_TRACER_COLS(timestamp, upid, conn_tracker) \
r.Append<r.ColIndex("time_")>(entry.resp.timestamp_ns); \
r.Append<r.ColIndex("upid")>(upid.value()); \
r.Append<r.ColIndex("remote_addr")>(conn_tracker.remote_endpoint().AddrStr()); \
r.Append<r.ColIndex("remote_port")>(conn_tracker.remote_endpoint().port()); \
r.Append<r.ColIndex("trace_role")>(conn_tracker.role());
Another approach would be to create a similar method on the RecordBuilder class. I think I prefer the macro one better because it's not a socket specific construct and these shared fields aren't universally applicable to all data tables.
I don't feel strongly about incorporating this into your change, however, it would be great to have a mechanism to ensure new tables include all the relevant "socket tracer" columns.
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
fddf086 to
f5a3ef0
Compare
This change does not fix the race condition, it just exposes the cgroup id so that a future pr can. The changes are broken up this way as it allows me to break apart the solution to this problem into easier to design pieces. I'm happy to add that test to the change in progress that fixes the issue. However I don't think it is appropriate here because it will still fail. |
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
52ae15c to
21f8804
Compare
ddelnano
left a comment
There was a problem hiding this comment.
The test suite still needs to pass, but the changes look good to me pending that 👍
We will need to regenerate the data table docs with the following
tool: //src/carnot/docstring/tables:datatables. Happy to help with that after this is merged.
|
cc @etep since I believe you are interested in reviewing this as well. |
163061d to
6a92f37
Compare
Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
This reverts commit 2a2349f.
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Summary: Revert cgid capture This change reverts capturing Cgroup ids from 2a2349f. Many of the 4.14 kernel tests have [BPF compilation errors](https://app.buildbuddy.io/invocation/075de8d0-d161-4ff6-8b74-123c6da66778#): `HINT: bpf_get_current_cgroup_id missing (added in Linux 4.18)`. Perplexingly, GitHub seems to show these tests as [passing despite the failures](https://github.com/pixie-io/pixie/actions/runs/6366478258/job/17320729511). Relevant Issues: #1638 #1739 Type of change: /kind bug Test Plan: Running CI Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Summary: Added Capturing of Cgroup ids to the ebpf probes in the socket tracer. This includes modifications to data structures for communicating that information to userspace and other data tables. It also includes some minimal testing for ensuring that cgroup ids are captured correctly. The reason for this change is given in the design document for the solution to this [issue](pixie-io#1638): in short it is the first step in using cgids rather than pids to associate a particular piece of communication data with the correct pod. Test Plan: Added Cgroup id capture checks to existing `socket_tracer` tests. Type of change: /kind Feature expansion Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
…ixie-io#1738) Summary: Revert cgid capture This change reverts capturing Cgroup ids from pixie-io@2a2349f. Many of the 4.14 kernel tests have [BPF compilation errors](https://app.buildbuddy.io/invocation/075de8d0-d161-4ff6-8b74-123c6da66778#): `HINT: bpf_get_current_cgroup_id missing (added in Linux 4.18)`. Perplexingly, GitHub seems to show these tests as [passing despite the failures](https://github.com/pixie-io/pixie/actions/runs/6366478258/job/17320729511). Relevant Issues: pixie-io#1638 pixie-io#1739 Type of change: /kind bug Test Plan: Running CI Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Summary: Added Capturing of Cgroup ids to the ebpf probes in the socket tracer. This includes modifications to data structures for communicating that information to userspace and other data tables. It also includes some minimal testing for ensuring that cgroup ids are captured correctly. The reason for this change is given in the design document for the solution to this [issue](pixie-io#1638): in short it is the first step in using cgids rather than pids to associate a particular piece of communication data with the correct pod. Test Plan: Added Cgroup id capture checks to existing `socket_tracer` tests. Type of change: /kind Feature expansion Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
…ixie-io#1738) Summary: Revert cgid capture This change reverts capturing Cgroup ids from pixie-io@2a2349f. Many of the 4.14 kernel tests have [BPF compilation errors](https://app.buildbuddy.io/invocation/075de8d0-d161-4ff6-8b74-123c6da66778#): `HINT: bpf_get_current_cgroup_id missing (added in Linux 4.18)`. Perplexingly, GitHub seems to show these tests as [passing despite the failures](https://github.com/pixie-io/pixie/actions/runs/6366478258/job/17320729511). Relevant Issues: pixie-io#1638 pixie-io#1739 Type of change: /kind bug Test Plan: Running CI Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Summary: Added Capturing of Cgroup ids to the ebpf probes in the socket tracer. This includes modifications to data structures for communicating that information to userspace and other data tables. It also includes some minimal testing for ensuring that cgroup ids are captured correctly. The reason for this change is given in the design document for the solution to this [issue](pixie-io#1638): in short it is the first step in using cgids rather than pids to associate a particular piece of communication data with the correct pod. Test Plan: Added Cgroup id capture checks to existing `socket_tracer` tests. Type of change: /kind Feature expansion Signed-off-by: AdityaAtulTewari <adityaatewari@gmail.com>
…ixie-io#1738) Summary: Revert cgid capture This change reverts capturing Cgroup ids from pixie-io@2e7a758. Many of the 4.14 kernel tests have [BPF compilation errors](https://app.buildbuddy.io/invocation/075de8d0-d161-4ff6-8b74-123c6da66778#): `HINT: bpf_get_current_cgroup_id missing (added in Linux 4.18)`. Perplexingly, GitHub seems to show these tests as [passing despite the failures](https://github.com/pixie-io/pixie/actions/runs/6366478258/job/17320729511). Relevant Issues: pixie-io#1638 pixie-io#1739 Type of change: /kind bug Test Plan: Running CI Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Summary: Added Capturing of Cgroup ids to the ebpf probes in the socket tracer. This includes modifications to data structures for communicating that information to userspace and other data tables. It also includes some minimal testing for ensuring that cgroup ids are captured correctly. The reason for this change is given in the design document for the solution to this issue: in short it is the first step in using cgids rather than pids to associate a particular piece of communication data with the correct pod.
Test Plan: Added Cgroup id capture checks to existing
socket_tracertests.Type of change: /kind Feature expansion
Signed-off-as: AdityaAtulTewari adityaatewari@gmail.com