User Tools

Site Tools


top

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
top [2012/03/21 10:55]
k2patel [Columns]
top [2020/08/10 02:35] (current)
Line 12: Line 12:
 id = idle id = idle
 hi = hardware interrupts hi = hardware interrupts
-si = software interrupts ​+si = software interrupts 
 +st = steal time (time in involuntary wait by virtual cpu while hypervisor is servicing another processor)
 </​code>​ </​code>​
  
Line 38: Line 39:
     The effective group name of the task's owner. ​     The effective group name of the task's owner. ​
 g: TTY -- Controlling Tty g: TTY -- Controlling Tty
-    The name of the controlling terminal. This is usually the device (serial port, pty, etc.) from which the process was started, and which it uses for input or output. However, a task need not be associated with a terminal, in which case you'll see '?'​ displayed. ​+    The name of the controlling terminal. This is usually the device (serial port, pty, etc.)  
 +    ​from which the process was started, and which it uses for input or output. ​ 
 +    ​However, a task need not be associated with a terminal, in which case you'll see '?'​ displayed. ​
 h: PR -- Priority h: PR -- Priority
     The priority of the task.      The priority of the task. 
 i: NI -- Nice value i: NI -- Nice value
-    The nice value of the task. A negative nice value means higher priority, whereas a positive nice value means lower priority. Zero in this field simply means priority will not be adjusted in determining a task's dispatchability. ​+    The nice value of the task. A negative nice value means higher priority, ​ 
 +    ​whereas a positive nice value means lower priority. ​ 
 +    ​Zero in this field simply means priority will not be adjusted in determining a task's dispatchability. ​
 j: P -- Last used CPU (SMP) j: P -- Last used CPU (SMP)
-    A number representing the last used processor. In a true SMP environment this will likely change frequently since the kernel intentionally uses weak affinity. Also, the very act of running top may break this weak affinity and cause more processes to change CPUs more often (because of the extra demand for cpu time). ​+    A number representing the last used processor. ​ 
 +    ​In a true SMP environment this will likely change frequently since the kernel intentionally uses weak affinity. ​ 
 +    ​Also, the very act of running top may break this weak affinity and cause more processes to change ​ 
 +    ​CPUs more often (because of the extra demand for cpu time). ​
 k: %CPU -- CPU usage k: %CPU -- CPU usage
-    The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment,​ if 'Irix mode' is Off, top will operate in '​Solaris mode' where a task's cpu usage will be divided by the total number of CPUs. You toggle '​Irix/​Solaris'​ modes with the '​I'​ interactive command. ​+    The task's share of the elapsed CPU time since the last screen update, ​ 
 +    ​expressed as a percentage of total CPU time. In a true SMP environment, ​ 
 +    ​if 'Irix mode' is Off, top will operate in '​Solaris mode' where a task's cpu usage will be divided by the total number of CPUs.  
 +    ​You toggle '​Irix/​Solaris'​ modes with the '​I'​ interactive command. ​
 l: TIME -- CPU Time l: TIME -- CPU Time
-    Total CPU time the task has used since it started. When '​Cumulative mode' is On, each process is listed with the cpu time that it and its dead children has used. You toggle '​Cumulative mode' with '​S',​ which is a command-line option and an interactive command. See the '​S'​ interactive command for additional information regarding this mode. +    Total CPU time the task has used since it started. When '​Cumulative mode' is On,  
 +    ​each process is listed with the cpu time that it and its dead children has used.  
 +    ​You toggle '​Cumulative mode' with '​S',​ which is a command-line option and an interactive command. ​ 
 +    ​See the '​S'​ interactive command for additional information regarding this mode. 
 m: TIME+ -- CPU Time, hundredths m: TIME+ -- CPU Time, hundredths
     The same as '​TIME',​ but reflecting more granularity through hundredths of a second. ​     The same as '​TIME',​ but reflecting more granularity through hundredths of a second. ​
Line 54: Line 68:
     A task's currently used share of available physical memory. ​     A task's currently used share of available physical memory. ​
 o: VIRT -- Virtual Image (kb) o: VIRT -- Virtual Image (kb)
-    The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out. (Note: you can define the STATSIZE=1 environment variable and the VIRT will be calculated from the /​proc/#/​state VmSize field.)+    The total amount of virtual memory used by the task.  
 +    ​It includes all code, data and shared libraries plus pages that have been swapped out.  
 +    ​(Note: you can define the STATSIZE=1 environment variable and the VIRT will be calculated from the /​proc/#/​state VmSize field.)
  
     VIRT = SWAP + RES.      VIRT = SWAP + RES. 
Line 70: Line 86:
     The amount of shared memory used by a task. It simply reflects memory that could be potentially shared with other processes. ​     The amount of shared memory used by a task. It simply reflects memory that could be potentially shared with other processes. ​
 u: nFLT -- Page Fault count u: nFLT -- Page Fault count
-    The number of major page faults that have occurred for a task. A page fault occurs when a process attempts to read from or write to a virtual page that is not currently present in its address space. A major page fault is when disk access is involved in making that page available. ​+    The number of major page faults that have occurred for a task.  
 +    ​A page fault occurs when a process attempts to read from or write to a virtual page that is not currently present in its address space. ​ 
 +    ​A major page fault is when disk access is involved in making that page available. ​
 v: nDRT -- Dirty Pages count v: nDRT -- Dirty Pages count
-    The number of pages that have been modified since they were last written to disk. Dirty pages must be written to disk before the corresponding physical memory location can be used for some other virtual page. +    The number of pages that have been modified since they were last written to disk.  
 +    ​Dirty pages must be written to disk before the corresponding physical memory location can be used for some other virtual page. 
 w: S -- Process Status w: S -- Process Status
     The status of the task which can be one of: '​D'​ = uninterruptible sleep '​R'​ = running '​S'​ = sleeping '​T'​ = traced or stopped '​Z'​ = zombie     The status of the task which can be one of: '​D'​ = uninterruptible sleep '​R'​ = running '​S'​ = sleeping '​T'​ = traced or stopped '​Z'​ = zombie
- +    ​Tasks shown as running should be more properly thought of as 'ready to run' -- their task_struct is simply represented on the Linux run-queue. ​ 
-    ​Tasks shown as running should be more properly thought of as 'ready to run' -- their task_struct is simply represented on the Linux run-queue. Even without a true SMP machine, you may see numerous tasks in this state depending on top's delay interval and nice value. ​+    ​Even without a true SMP machine, you may see numerous tasks in this state depending on top's delay interval and nice value. ​
 x: Command -- Command line or Program name x: Command -- Command line or Program name
-    Display the command line used to start a task or the name of the associated program. You toggle between command line and name with '​c',​ which is both a command-line option and an interactive command.+    Display the command line used to start a task or the name of the associated program. ​ 
 +    ​You toggle between command line and name with '​c',​ which is both a command-line option and an interactive command.
  
-    When you've chosen to display command lines, processes without a command line (like kernel threads) will be shown with only the program name in parentheses,​ as in this example: ( mdrecoveryd )+    When you've chosen to display command lines, ​ 
 +    ​processes without a command line (like kernel threads) will be shown with only the program name in parentheses, ​ 
 +    ​as in this example: ( mdrecoveryd )
  
-    Either form of display is subject to potential truncation if it's too long to fit in this field'​s current width. That width depends upon other fields selected, their order and the current screen width.+    Either form of display is subject to potential truncation if it's too long to fit in this field'​s current width. ​ 
 +    ​That width depends upon other fields selected, their order and the current screen width.
  
-    Note: The '​Command'​ field/​column is unique, in that it is not fixed-width. When displayed, this column will be allocated all remaining screen width (up to the maximum 512 characters) to provide for the potential growth of program names into command lines. ​+    Note: The '​Command'​ field/​column is unique, in that it is not fixed-width. ​ 
 +    ​When displayed, this column will be allocated all remaining screen width  
 +    ​(up to the maximum 512 characters) to provide for the potential growth of program names into command lines. ​
 y: WCHAN -- Sleeping in Function y: WCHAN -- Sleeping in Function
-    Depending on the availability of the kernel link map ('​System.map'​),​ this field will show the name or the address of the kernel function in which the task is currently sleeping. Running tasks will display a dash ('​-'​) in this column.+    Depending on the availability of the kernel link map ('​System.map'​), ​ 
 +    ​this field will show the name or the address of the kernel function in which the task is currently sleeping. ​ 
 +    ​Running tasks will display a dash ('​-'​) in this column.
  
-    Note: By displaying this field, top's own working set will be increased by over 700Kb. Your only means of reducing that overhead will be to stop and restart top. +    Note: By displaying this field, top's own working set will be increased by over 700Kb. ​ 
 +    ​Your only means of reducing that overhead will be to stop and restart top. 
 z: Flags -- Task Flags z: Flags -- Task Flags
-    This column represents the task's current scheduling flags which are expressed in hexadecimal notation and with zeros suppressed. These flags are officially documented in <​linux/​sched.h>​. Less formal documentation can also be found on the '​Fields select'​ and 'Order fields'​ screens. ​+    This column represents the task's current scheduling flags which are expressed in hexadecimal notation and with zeros suppressed. ​ 
 +    ​These flags are officially documented in <​linux/​sched.h>​. ​ 
 +    ​Less formal documentation can also be found on the '​Fields select'​ and 'Order fields'​ screens. ​
 </​code>​ </​code>​
 +
 +
 +==== .toprc ====
 +.toprc is the file you do not need to play with it all the time.\\
 +Here is my .toprc file.\\
 +
 +
 +<code bash | ~/​.toprc>​
 +
 +RCfile for "top with windows" ​          # shameless braggin'​
 +Id:a, Mode_altscr=0,​ Mode_irixps=1,​ Delay_time=3.000,​ Curwin=0
 +Def     ​fieldscur=OQNTKPMehaiWbcdfgJlrsuvyzX
 +        winflags=130489,​ sortindx=13,​ maxtasks=0
 +        summclr=6, msgsclr=1, headclr=3, taskclr=2
 +Job     ​fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX
 +        winflags=64825,​ sortindx=0, maxtasks=0
 +        summclr=6, msgsclr=6, headclr=7, taskclr=6
 +Mem     ​fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX
 +        winflags=64825,​ sortindx=13,​ maxtasks=0
 +        summclr=5, msgsclr=5, headclr=4, taskclr=5
 +Usr     ​fieldscur=ABDECGfhijlopqrstuvyzMKNWX
 +        winflags=64825,​ sortindx=4, maxtasks=0
 +        summclr=3, msgsclr=3, headclr=2, taskclr=3
 +
 +</​code>​
 +
 +
 +Playing with color is not advised from interface as it was hard for me :) still you can try using "​Z"​\\
 +Here is how i played.
 +
 +<code text>
 +
 +Select target as upper case letter:
 +   S = Summary Data,  M = Messages/​Prompts,​
 +   H = Column Heads, ​ T = Task Information
 +Select color as number:
 +   0 = black, ​ 1 = red,      2 = green, ​ 3 = yellow,
 +   4 = blue,   5 = magenta, ​ 6 = cyan,   7 = white
 +   
 +</​code>​
 +
 +**Curwin=0** Which define which block you are using start the first one as "​0"​.
 +
 +**summclr=6,​ msgsclr=1, headclr=3, taskclr=2** this is the value you can play with with above list of colors.
top.1332327304.txt.gz · Last modified: 2020/08/10 02:29 (external edit)