-
Notifications
You must be signed in to change notification settings - Fork 286
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
fix load time #769
fix load time #769
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Broken:
Fixed:
Bpftool output as verification:
|
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.
Needs a test.
afe8393
to
cc97658
Compare
|
||
let loaded_at = prog.info().unwrap().loaded_at(); | ||
|
||
// make sure loaded_at() api is correct with a millisecond tolerance. |
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.
Wouldn't it be more robust to:
- get current time t1
- load
- get current time t2
- assert load is been t1 and t2
?
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.
Yep good call, done
cc97658
to
5f3d33f
Compare
|
||
let loaded_at = prog.info().unwrap().loaded_at(); | ||
|
||
assert!(t1 < loaded_at && t2 > loaded_at); |
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.
this assertion doesn't emit information on failure, which seems bad. how about
let range = t1..t2;
assert!(range.contains(loaded_at), "{range}.contains({loaded_at})");
or something like 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.
Done
Time since boot is defined as the UNIX_EPOCH plus the duration since boot. which is realtime - boottime NOT boottime - realtime. Add a integration test to ensure this doesn't happen again. Signed-off-by: astoycos <astoycos@redhat.com>
5f3d33f
to
dffff1c
Compare
time since boot is defined as the UNIX_EPOCH plus the duration since boot. which is realtime - boottime NOT boottime - realtime.