mirror of
https://github.com/sheumann/hush.git
synced 2024-10-12 01:24:10 +00:00
top: document a debugging script
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
975c714183
commit
444ff284c4
13
procps/top.c
13
procps/top.c
@ -30,6 +30,15 @@
|
|||||||
*
|
*
|
||||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||||
*/
|
*/
|
||||||
|
/* Howto snapshot /proc for debugging top problems:
|
||||||
|
* for f in /proc/[0-9]*""/stat; do
|
||||||
|
* n=${f#/proc/}
|
||||||
|
* n=${n%/stat}_stat
|
||||||
|
* cp $f $n
|
||||||
|
* done
|
||||||
|
* cp /proc/stat /proc/meminfo .
|
||||||
|
* top -bn1 >top.out
|
||||||
|
*/
|
||||||
|
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
@ -546,7 +555,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
|
|||||||
pmem_scale /= 4;
|
pmem_scale /= 4;
|
||||||
pmem_shift -= 2;
|
pmem_shift -= 2;
|
||||||
}
|
}
|
||||||
pmem_half = (1U << pmem_shift) / (ENABLE_FEATURE_TOP_DECIMALS? 20 : 2);
|
pmem_half = (1U << pmem_shift) / (ENABLE_FEATURE_TOP_DECIMALS ? 20 : 2);
|
||||||
#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
|
#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
|
||||||
busy_jifs = cur_jif.busy - prev_jif.busy;
|
busy_jifs = cur_jif.busy - prev_jif.busy;
|
||||||
/* This happens if there were lots of short-lived processes
|
/* This happens if there were lots of short-lived processes
|
||||||
@ -577,7 +586,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
|
|||||||
pcpu_scale /= 4;
|
pcpu_scale /= 4;
|
||||||
pcpu_shift -= 2;
|
pcpu_shift -= 2;
|
||||||
}
|
}
|
||||||
pcpu_half = (1U << pcpu_shift) / (ENABLE_FEATURE_TOP_DECIMALS? 20 : 2);
|
pcpu_half = (1U << pcpu_shift) / (ENABLE_FEATURE_TOP_DECIMALS ? 20 : 2);
|
||||||
/* printf(" pmem_scale=%u pcpu_scale=%u ", pmem_scale, pcpu_scale); */
|
/* printf(" pmem_scale=%u pcpu_scale=%u ", pmem_scale, pcpu_scale); */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user