File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2212,10 +2212,12 @@ impl<'a> App<'a> {
22122212 fn create_process_columns ( ) -> Vec < Column > {
22132213 vec ! [
22142214 Column {
2215- header: "TGID" ,
2215+ header: "TGID/UID " ,
22162216 constraint: Constraint :: Length ( 8 ) ,
22172217 visible: true ,
2218- value_fn: Box :: new( |tgid, _| tgid. to_string( ) ) ,
2218+ value_fn: Box :: new( |tgid, data| {
2219+ format!( "{}/{}" , tgid. to_string( ) , data. uid. to_string( ) )
2220+ } ) ,
22192221 } ,
22202222 Column {
22212223 header: "Name" ,
@@ -2325,6 +2327,7 @@ impl<'a> App<'a> {
23252327 . partial_cmp ( & a. 1 . cpu_util_perc )
23262328 . unwrap_or ( std:: cmp:: Ordering :: Equal )
23272329 . then_with ( || b. 1 . threads . len ( ) . cmp ( & a. 1 . threads . len ( ) ) )
2330+ . then_with ( || b. 1 . uid . cmp ( & a. 1 . uid ) )
23282331 } ) ;
23292332
23302333 let rows = sorted_view. into_iter ( ) . map ( |( i, data) | {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use std::collections::BTreeMap;
1414#[ derive( Clone , Debug ) ]
1515pub struct ProcData {
1616 pub tgid : i32 ,
17+ pub uid : u32 ,
1718 pub process_name : String ,
1819 pub cpu : i32 ,
1920 pub llc : Option < u32 > ,
@@ -48,6 +49,7 @@ impl ProcData {
4849
4950 let proc_data = Self {
5051 tgid : process. pid ,
52+ uid : process. uid ( ) . unwrap ( ) ,
5153 process_name : std:: mem:: take ( & mut proc_stats. comm ) ,
5254 cpu,
5355 llc : None ,
You can’t perform that action at this time.
0 commit comments