Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/crates/rqd/src/frame/running_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ Render Frame Completed
frame_name: self.request.frame_name.clone(),
layer_id: self.request.layer_id.clone(),
num_cores: self.request.num_cores,
start_time: start_time as i64,
start_time: (start_time * 1000) as i64,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you share where you're seeing a problem with this value? Looking at our environment, startime seems to be reported correctly, but I might be looking at a different view.

Copy link
Contributor Author

@aoblet aoblet Jan 27, 2026

Choose a reason for hiding this comment

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

https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java#L839-L843

frame.getStartTime() returns in seconds instead of microseconds.
Then the condition is always true as long as a timeout is set on the layer.

max_rss: (stats.max_rss / KIB) as i64,
rss: (stats.rss / KIB) as i64,
max_pss: (stats.max_pss / KIB) as i64,
Expand Down
38 changes: 38 additions & 0 deletions rust/crates/rqd/src/system/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,13 @@ impl LinuxSystem {
}
}
}

// Find session_id from stat file instead of status
// Depending on the OS, Kernel version or SELinux state, status might not contain NSSid
if session_id.is_none() {
session_id = self.read_session_id_from_stat(pid);
}

match (session_id, tgid, state) {
(Some(session_id), Some(tgid), Some(state)) => {
// Only store valid states
Expand Down Expand Up @@ -577,6 +584,37 @@ impl LinuxSystem {
Ok(())
}


// Read stats from /proc/{pid}/stat file and return session_id
// NSsid might be is missing from /proc/{pid}/status
// In this case we fallback if not found and and then use stat instead
fn read_session_id_from_stat(&self, pid: u32) -> Option<u32> {
let stat_path = format!("/proc/{}/stat", pid);
let stat = match std::fs::read_to_string(stat_path).into_diagnostic() {
Ok(s) => s,
Err(_) => return None, // Skip procs which status is not available
};

// Stats file can star with these formats:
// - 105 name ...
// - 105 (name) ...
// - 105 (name with space) ...
// - 105 (name with) (space and parenthesis) ...

let end = stat.rfind(')');

match end {
Some(end) => {
let fields: Vec<&str> = stat[end+2..].split_whitespace().collect();
return fields[3].parse::<u32>().ok()
},
None => {
let fields: Vec<&str> = stat.split_whitespace().collect();
return fields[5].parse::<u32>().ok()
}
}
}

/// Reads PSS (Proportional Set Size) from /proc/[pid]/smaps_rollup
///
/// PSS divides shared memory proportionally among processes using it,
Expand Down
Loading