-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use bpf_ktime_get_boot_ns instead #211
Conversation
bpf_ktime_get_ns does not include suspension time, but we would like ts to represent real world time. Switching the helper function achieves that. The helper was introduced in 5.8 which is earlier than our current support range, 5.10
So does that mean we have to move all userland comparisons to use CLOCK_BOOTIME on clock_gettime(3)? I'm guessing yes. |
How would you feel about adding a new member to the header instead?
|
I spent a little time trying to figure out how to check at runtime for helper functions, but couldn't get there. Our current logic is around disabling probes based on features. Wasn't sure how to avoid loading ebpf code that called unsupported helper functions. Seems doable, but I gave up once I realized that the new helper function is within our support range, and has apparently been backported. |
I don't think it belongs there, since it's a one time thing, we could stash it under stats, and userland is responsible for querying it once. |
I think the way to do is to test for
from: https://nakryiko.com/posts/bpf-core-reference-guide/ I'm happy to work on this in the future |
Add a new event header member, ts_boot, and conditionally set it with bpf_ktime_get_boot_ns() based on the helper's existence
After reading this:
this PR was changed to add a new member to the header file. This way users of |
me gusta! |
bpf_ktime_get_ns
does not include suspension time, but we would likehdr.ts
to represent real world time. Switching the helper function achieves that. The helper was introduced in 5.8 which is earlier than our current support range, 5.10Update:
Add a new member variable instead and leave
hdr.ts
alone.