linux wchan support

This commit is contained in:
Zane C. B-H 2019-08-15 17:15:19 -05:00
parent 7876f16850
commit 0048e1528a
1 changed files with 7 additions and 1 deletions

View File

@ -774,7 +774,13 @@ sub colorize{
}
if ( $^O =~ 'linux' ){
$item=color($self->nextColor).$left.' '.color($self->nextColor);
my $wchan='';
if ( -e '/proc/'.$proc->{pid}.'/wchan'){
open( my $wchan_fh, '<', '/proc/'.$proc->{pid}.'/wchan' );
$wchan=readline( $wchan_fh );
close( $wchan_fh );
}
$item=color($self->nextColor).$left.' '.color($self->nextColor).wchan;
}else{
$item=color($self->nextColor).$left.' '.color($self->nextColor).$proc->{wchan};
}