-
Notifications
You must be signed in to change notification settings - Fork 142
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
libbpf-rs: Update docs in query.rs #1116
base: master
Are you sure you want to change the base?
Conversation
libbpf-rs/src/query.rs
Outdated
pub xlated_prog_insns: Vec<u8>, | ||
/// Duration since system boot | ||
/// Duration since system boot when the program was loaded. |
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 should NOT be interpreted as duration. It should be an Instant instead.
This comment is completely misleading.
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.
"Time (since system boot) at which the program was loaded". Is this correct?
Also, should we change the Duration::from_nanos(item.load_time)
logic to calculate the correct time? I think we should keep the value as it is.
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.
All "documentation" I found says: "ns since boottime", which strikes me as very similar to what we had. Personally, I'd leave it the way it was, including keeping it as Duration
. If it's misleading then it is misleading in the kernel as well, no?
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.
You can use bpftool as a reference.
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.
Definitely a good improvement; thanks again! Left a few comments, please take another look.
libbpf-rs/src/query.rs
Outdated
/// Length (in bytes) of the raw tracepoint name | ||
pub name_len: u32, |
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.
Why is this member needed? We do have the name and it has a length, no? This seems like useless duplication of information to me.
libbpf-rs/src/query.rs
Outdated
pub xlated_prog_insns: Vec<u8>, | ||
/// Duration since system boot | ||
/// Duration since system boot when the program was loaded. |
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.
All "documentation" I found says: "ns since boottime", which strikes me as very similar to what we had. Personally, I'd leave it the way it was, including keeping it as Duration
. If it's misleading then it is misleading in the kernel as well, no?
pub prog_tags: Vec<Tag>, | ||
/// Total accumulated run time (in nanoseconds) for the program’s execution. | ||
pub run_time_ns: u64, |
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.
Well, looking at it this should probably be a Duration
. But of course you didn't change the type so it's fine to keep for now. Just pointing it out in case you want to fix it up subsequently.
Signed-off-by: yogaraj.s <[email protected]>
No description provided.