| 141 | |
| 142 | |
| 143 | def parse_smaps_rollup(pid: int) -> dict[str, float] | None: |
| 144 | path = Path(f"/proc/{pid}/smaps_rollup") |
| 145 | txt = read_text(path) |
| 146 | if not txt: |
| 147 | return None |
| 148 | out = {value: 0.0 for value in SMAPS_KEYS.values()} |
| 149 | for line in txt.splitlines(): |
| 150 | for key, out_key in SMAPS_KEYS.items(): |
| 151 | if line.startswith(f"{key}:"): |
| 152 | parts = line.split() |
| 153 | if len(parts) >= 2: |
| 154 | out[out_key] = round(int(parts[1]) / 1024.0, 1) |
| 155 | return out |
| 156 | |
| 157 | |
| 158 | def iter_jcode_processes(main_socket: str, include_aux: bool) -> Iterable[ProcMem]: |