-
Notifications
You must be signed in to change notification settings - Fork 165
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
Don't drop events while requesting CPU usage from driver #18
Conversation
Every second, we request per-process CPU usage from the driver which generates a stream of sinsp meta events. Unfortunately, whenever we do this, we drop the event we have received from scap_next just before we decided to get the CPU usage data. This patch moves the logic to a separate method, where an early return does not prevent handling the received event. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
No functional changes expected Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
The code for eBPF gets CPU usage for individual threads from /proc. We can reuse it for the udig case as well. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Even though we don't currently support macOS instrumentation, not having this struct definition causes compilation warnings. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
LGTM label has been added. Git tree hash: 3eedd39a96c04a939274b22df99bbe4e19195cae
|
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.
Great work!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fntlnz, leodido The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
/kind cleanup
Any specific area of the project related to this PR?
/area driver-kmod
/area driver-ebpf
/area libscap
What this PR does / why we need it:
Every second, we request per-process CPU usage from the driver which generates a stream of sinsp meta events. Unfortunately, whenever we do this, we drop the event we have received from scap_next just before we decided to get the CPU usage data.
This patch moves the logic to a separate method, where an early return does not prevent handling the received event.
Special notes for your reviewer:
This is draios/sysdig#1685 resubmitted
The first commit is required for the fix, 2-3 are minor cleanups, 4-6 (as a whole) are nice to have, unifying CPU usage reporting across udig/eBPF backends
Does this PR introduce a user-facing change?: