mirror of
https://github.com/ClementTsang/bottom.git
synced 2026-05-04 05:50:42 +00:00
some todos
This commit is contained in:
@@ -170,6 +170,7 @@ fn get_amdgpu_pid_fds(pid: u32, device_path: &[String]) -> Option<Vec<u32>> {
|
||||
let valid_fds: Vec<u32> = fd_list
|
||||
.filter_map(|fd_link| {
|
||||
let dir_entry = fd_link.map(|fd_link| fd_link.path()).ok()?;
|
||||
// TODO: Could we reuse the buffer in some way?
|
||||
let link = rustix::fs::readlink(&dir_entry, vec![]).ok()?;
|
||||
|
||||
// e.g. "/dev/dri/renderD128" or "/dev/dri/card0"
|
||||
|
||||
@@ -250,6 +250,7 @@ impl Process {
|
||||
.next_back()
|
||||
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())
|
||||
.or_else(|| {
|
||||
// TODO: Could we reuse the buffer in some way?
|
||||
rustix::fs::readlinkat(rustix::fs::CWD, pid_path.as_path(), vec![])
|
||||
.ok()
|
||||
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())
|
||||
|
||||
Reference in New Issue
Block a user