query: add kprobe_multi & uprobe_multi link info fields that require second info call#1380
Conversation
|
Sorry for the delay, will try and get to it tomorrow. |
|
No worries! this feature isn't urgent me. |
d-e-s-o
left a comment
There was a problem hiding this comment.
Overall seems reasonable to me. Few minor comments.
| let ret = unsafe { | ||
| libbpf_sys::bpf_obj_get_info_by_fd( | ||
| fd.as_raw_fd(), | ||
| item_ptr as *mut c_void, |
There was a problem hiding this comment.
| item_ptr as *mut c_void, | |
| item_ptr.cast(), |
There was a problem hiding this comment.
And can you please rebase on top of master?
| /// Size of the path. | ||
| pub path_size: u32, | ||
| /// The absolute file path of the binary being probed. | ||
| pub path: Option<CString>, |
There was a problem hiding this comment.
If it's a path should we make it a PathBuf?
There was a problem hiding this comment.
Yea, I think PathBuf makes sense. At least for my usecase i'm only displaying it, so it would be more convenient since PathBuf has display impl but not CString.
| LinkTypeInfo::UprobeMulti(UprobeMultiLinkInfo { | ||
| path_size: unsafe { s.__bindgen_anon_1.uprobe_multi.path_size }, | ||
| path: (path != 0) | ||
| .then_some(unsafe { CStr::from_ptr(path as *const c_char).to_owned() }), |
There was a problem hiding this comment.
I would assume that if there is a path_size field that the string doesn't have to be NUL terminated but length determined by the size, no?
There was a problem hiding this comment.
Ah oops, that was meant to be path_size != 0.
0ec8db2 to
225bd53
Compare
Added
KprobeMultiLinkInfo&UprobeMultiLinkInfofields that required a second info call.