mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-11-29 10:04:18 +01:00
why was this collecting
This commit is contained in:
parent
8343fb778e
commit
2900ed03c0
@ -237,26 +237,24 @@ fn get_amd_fdinfo(device_path: &Path) -> Option<HashMap<u32, AmdGpuProc>> {
|
|||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
||||||
let pids: Vec<u32> = proc_dir
|
let pids = proc_dir.filter_map(|dir_entry| {
|
||||||
.filter_map(|dir_entry| {
|
// check if pid is valid
|
||||||
// check if pid is valid
|
let dir_entry = dir_entry.ok()?;
|
||||||
let dir_entry = dir_entry.ok()?;
|
let metadata = dir_entry.metadata().ok()?;
|
||||||
let metadata = dir_entry.metadata().ok()?;
|
|
||||||
|
|
||||||
if !metadata.is_dir() {
|
if !metadata.is_dir() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pid = dir_entry.file_name().to_str()?.parse::<u32>().ok()?;
|
let pid = dir_entry.file_name().to_str()?.parse::<u32>().ok()?;
|
||||||
|
|
||||||
// skip init process
|
// skip init process/systemd
|
||||||
if pid == 1 {
|
if pid == 1 {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(pid)
|
Some(pid)
|
||||||
})
|
});
|
||||||
.collect();
|
|
||||||
|
|
||||||
for pid in pids {
|
for pid in pids {
|
||||||
// collect file descriptors that point to our device renderers
|
// collect file descriptors that point to our device renderers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user