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
5 changes: 3 additions & 2 deletions tools/scxtop/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2212,10 +2212,10 @@ impl<'a> App<'a> {
fn create_process_columns() -> Vec<Column> {
vec![
Column {
header: "TGID",
header: "TGID/UID",
constraint: Constraint::Length(8),
visible: true,
value_fn: Box::new(|tgid, _| tgid.to_string()),
value_fn: Box::new(|tgid, data| format!("{tgid}/{}", data.uid)),
},
Column {
header: "Name",
Expand Down Expand Up @@ -2325,6 +2325,7 @@ impl<'a> App<'a> {
.partial_cmp(&a.1.cpu_util_perc)
.unwrap_or(std::cmp::Ordering::Equal)
.then_with(|| b.1.threads.len().cmp(&a.1.threads.len()))
.then_with(|| b.1.uid.cmp(&a.1.uid))
});

let rows = sorted_view.into_iter().map(|(i, data)| {
Expand Down
2 changes: 2 additions & 0 deletions tools/scxtop/src/proc_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::collections::BTreeMap;
#[derive(Clone, Debug)]
pub struct ProcData {
pub tgid: i32,
pub uid: u32,
pub process_name: String,
pub cpu: i32,
pub llc: Option<u32>,
Expand Down Expand Up @@ -48,6 +49,7 @@ impl ProcData {

let proc_data = Self {
tgid: process.pid,
uid: process.uid().unwrap(),
process_name: std::mem::take(&mut proc_stats.comm),
cpu,
llc: None,
Expand Down