From d4821d29a8d5a9493314ed1b59c5a11fe994802c Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Tue, 16 Apr 2019 14:04:57 +0900 Subject: [PATCH] fix output --- README.md | 1 + nohang | 12 +++++++----- nohang.conf | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9e86aef..84aed47 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ The tools listed above may work at the same time on one computer. - names, - cgroups, - realpathes, + - environs, - cmdlines and - euids with specified regular expressions diff --git a/nohang b/nohang index c53a073..d46bc3b 100755 --- a/nohang +++ b/nohang @@ -1034,10 +1034,12 @@ def find_victim(_print_proc_table): else: extra_table_title = '' - log('====================================================================================================================') - log(' PID PPID badness oom_score oom_score_adj eUID S VmSize VmRSS VmSwap Name {}'.format( + hr = '#' * 115 + + log(hr) + log('# PID PPID badness oom_score oom_score_adj eUID S VmSize VmRSS VmSwap Name {}'.format( extra_table_title)) - log('------- ------- ------- --------- ------------- ---------- - ------ ----- ------ --------------- --------') + log('#------- ------- ------- --------- ------------- ---------- - ------ ----- ------ --------------- --------') for pid in pid_list: @@ -1084,7 +1086,7 @@ def find_victim(_print_proc_table): else: extra_table_line = '' - log('{} {} {} {} {} {} {} {} {} {} {} {}'.format( + log('#{} {} {} {} {} {} {} {} {} {} {} {}'.format( pid.rjust(7), ppid.rjust(7), str(badness).rjust(7), @@ -1117,7 +1119,7 @@ def find_victim(_print_proc_table): victim_name = pid_to_name(pid) if _print_proc_table: - log('====================================================================================================================') + log(hr) log( 'Process with highest badness (found in {} ms):\n PID: {}, Na' diff --git a/nohang.conf b/nohang.conf index bca4073..26442a8 100644 --- a/nohang.conf +++ b/nohang.conf @@ -362,7 +362,7 @@ print_proc_table = True realpath All -extra_table_info = None +extra_table_info = cgroup print_victim_info = True