From f5833c5bfb02bf151b94525eab0fb4ebe6109207 Mon Sep 17 00:00:00 2001 From: ClementTsang <34804052+ClementTsang@users.noreply.github.com> Date: Sun, 31 Aug 2025 01:25:54 -0400 Subject: [PATCH] some todos --- src/collection/amd.rs | 1 + src/collection/processes/linux/process.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/collection/amd.rs b/src/collection/amd.rs index 6b813037..cf59011e 100644 --- a/src/collection/amd.rs +++ b/src/collection/amd.rs @@ -170,6 +170,7 @@ fn get_amdgpu_pid_fds(pid: u32, device_path: &[String]) -> Option> { let valid_fds: Vec = 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" diff --git a/src/collection/processes/linux/process.rs b/src/collection/processes/linux/process.rs index 6d6f5b32..b6c745be 100644 --- a/src/collection/processes/linux/process.rs +++ b/src/collection/processes/linux/process.rs @@ -250,6 +250,7 @@ impl Process { .next_back() .and_then(|s| s.to_string_lossy().parse::().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::().ok())