Skip to content

Read /proc through the mock-root path - #74

Open
lforchini wants to merge 1 commit into
test/add-depsfrom
test/read-fake-proc
Open

lforchini wants to merge 1 commit into
test/add-depsfrom
test/read-fake-proc

Conversation

@lforchini

Copy link
Copy Markdown
Collaborator

Host CPU and per-task samples were opening the real /proc, so
IO_THREAD_CONTROLLER_ROOT_PATH could not redirect them at a test
filesystem.

Signed-off-by: Leonardo Forchini leonardo.forchini@nutanix.com


Stack created with GitHub Stacks CLI • Give Feedback 💬

@lforchini
lforchini added this pull request to stack #83 October 1, 2026 14:37
@lforchini
lforchini force-pushed the test/read-fake-proc branch from b211288 to 96c5727 Compare October 1, 2026 14:48
@lforchini
lforchini removed this pull request from stack #83 October 1, 2026 14:50
@lforchini
lforchini added this pull request to stack #84 October 1, 2026 14:50
@lforchini
lforchini force-pushed the test/read-fake-proc branch from 96c5727 to 275ec7f Compare October 5, 2026 08:10
@lforchini
lforchini removed this pull request from stack #84 October 5, 2026 08:12
@lforchini
lforchini added this pull request to stack #87 October 5, 2026 08:16
@lforchini
lforchini marked this pull request as ready for review October 5, 2026 08:23
@lforchini
lforchini force-pushed the test/read-fake-proc branch from 275ec7f to 7088f29 Compare October 5, 2026 08:49
@lforchini
lforchini force-pushed the test/read-fake-proc branch from 7088f29 to d5c3914 Compare October 8, 2026 07:30
@lforchini
lforchini removed this pull request from stack #87 October 8, 2026 15:22
@lforchini
lforchini force-pushed the test/read-fake-proc branch 2 times, most recently from d5c3914 to a0dc5c3 Compare October 8, 2026 15:23
@lforchini
lforchini added this pull request to stack #88 October 8, 2026 15:23
@lforchini
lforchini removed this pull request from stack #88 October 13, 2026 12:32
@lforchini
lforchini force-pushed the test/read-fake-proc branch from a0dc5c3 to d453199 Compare October 13, 2026 12:43
@lforchini
lforchini added this pull request to stack #95 October 13, 2026 12:44
@lforchini
lforchini force-pushed the test/read-fake-proc branch from d453199 to 4356bb5 Compare October 13, 2026 13:17
Comment thread src/util.rs
/// `procfs::process::Process::new` always opens the real `/proc`. Callers
/// that should honor the mock root pass this path to
/// `Process::new_with_root`.
pub fn proc_pid(pid: i32) -> std::path::PathBuf {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this function belongs here, I don't feel too strongly though.

Comment thread src/controller.rs

use futures_util::future::join_all;
use procfs::{CpuPressure, Current, CurrentSI, IoPressure, MemoryPressure, ProcError};
use procfs::{CpuPressure, Current, FromReadSI, IoPressure, MemoryPressure, ProcError};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this change about?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to build KernelStats from a file and current_system_info and that needed different traits.

@lforchini
lforchini removed this pull request from stack #95 October 21, 2026 08:27
Host CPU and per-task samples were opening the real /proc, so
IO_THREAD_CONTROLLER_ROOT_PATH could not redirect them at a test
filesystem.

Signed-off-by: Leonardo Forchini <leonardo.forchini@nutanix.com>
@lforchini
lforchini added this pull request to stack #152 October 23, 2026 08:22
@lforchini
lforchini force-pushed the test/read-fake-proc branch from 4356bb5 to 31db8c0 Compare October 23, 2026 08:24
@lforchini
lforchini removed this pull request from stack #152 October 23, 2026 08:44
@lforchini
lforchini added this pull request to stack #157 October 23, 2026 08:45
@lforchini
lforchini removed this pull request from stack #157 October 23, 2026 08:49
@lforchini
lforchini added this pull request to stack #159 October 23, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants