Skip to content

Commit

Permalink
Fix fbcode TARGETS for compiling with procfs 0.15.1
Browse files Browse the repository at this point in the history
Summary:
- Fix top level dirs:
  - frl_ee_infra
  - fbcode_devx
  - hermetic_infra
  - hphp/hack
  - remote_execution
  - service_capacity/projection_framework

Going to need to lean on people to help test here once CI passes ...

Reviewed By: aijayadams

Differential Revision: D49899458

fbshipit-source-id: 4eaa7c3b07bfcf5d23c4ed71a9050ffa2b9ac777
  • Loading branch information
cooperlees authored and facebook-github-bot committed Oct 4, 2023
1 parent 4eee23c commit 8dbd96b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions detcore/src/procmaps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ fn display_pathname(p: &MMapPath) -> String {
MMapPath::Other(s) => format!("[other: {}]", s),
MMapPath::Anonymous => String::from("[annonymous]"),
MMapPath::Path(s) => s.display().to_string(),
MMapPath::Rollup => String::from("[rollup]"),
MMapPath::Vsys(vsys) => vsys.to_string(),
}
}

pub fn display(map: &MemoryMap) -> String {
format!(
"{:#x}-{:#x} {} {:x} {:x}:{:x} {} {}",
"{:#x}-{:#x} {:?} {:x} {:x}:{:x} {} {}",
map.address.0,
map.address.1,
map.perms,
Expand All @@ -57,8 +59,8 @@ where
match procfs::process::Process::new(pid.as_raw()) {
Ok(process) => match process.maps() {
Ok(mut maps) => {
maps.retain(filter);
Ok(maps)
maps.memory_maps.retain(filter);
Ok(maps.memory_maps)
}
Err(err) => Err(map_error(err)),
},
Expand Down
2 changes: 1 addition & 1 deletion detcore/src/syscalls/sysinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl<T: RecordOrReplay> Detcore<T> {

fn free_ram<G: Guest<Self>>(&self, guest: &mut G, total_ram: u64) -> anyhow::Result<u64> {
let process = Process::new(guest.pid().as_raw())?;
let page_size = procfs::page_size()? as u64;
let page_size = procfs::page_size();
let statm = process.statm()?;
let used_memory = statm.resident * page_size;
if used_memory > total_ram {
Expand Down

0 comments on commit 8dbd96b

Please sign in to comment.