Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   top    ( 1 )

отображать процессы Linux (display Linux processes)

FIELDS / Columns

3a. DESCRIPTIONS of Fields Listed below are top's available process fields (columns). They are shown in strict ascii alphabetical order. You may customize their position and whether or not they are displayable with the `f' (Fields Management) interactive command.

Any field is selectable as the sort field, and you control whether they are sorted high-to-low or low-to-high. For additional information on sort provisions see topic 4c. TASK AREA Commands, SORTING.

The fields related to physical memory or virtual memory reference `(KiB)' which is the unsuffixed display mode. Such fields may, however, be scaled from KiB through PiB. That scaling is influenced via the `e' interactive command or established for startup through a build option.

1. %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 a process is multi-threaded and top is not operating in Threads mode, amounts greater than 100% may be reported. You toggle Threads mode with the `H' interactive command.

Also for multi-processor environments, 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.

Note: When running in forest view mode (`V') with children collapsed (`v'), this field will also include the CPU time of those unseen children. See topic 4c. TASK AREA Commands, CONTENT for more information regarding the `V' and `v' toggles.

2. %MEM -- Memory Usage (RES) A task's currently resident share of available physical memory.

See `OVERVIEW, Linux Memory Types' for additional details.

3. CGNAME -- Control Group Name The name of the control group to which a process belongs, or `-' if not applicable for that process.

This will typically be the last entry in the full list of control groups as shown under the next heading (CGROUPS). And as is true there, this field is also variable width.

4. CGROUPS -- Control Groups The names of the control group(s) to which a process belongs, or `-' if not applicable for that process.

Control Groups provide for allocating resources (cpu, memory, network bandwidth, etc.) among installation-defined groups of processes. They enable fine-grained control over allocating, denying, prioritizing, managing and monitoring those resources.

Many different hierarchies of cgroups can exist simultaneously on a system and each hierarchy is attached to one or more subsystems. A subsystem represents a single resource.

Note: The CGROUPS field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. See topic 5c. SCROLLING a Window for additional information on accessing any truncated data.

5. CODE -- Code Size (KiB) The amount of physical memory currently devoted to executable code, also known as the Text Resident Set size or TRS.

See `OVERVIEW, Linux Memory Types' for additional details.

6. COMMAND -- Command Name or Command Line 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 brackets, as in this example: [kthreadd]

This field may also be impacted by the forest view display mode. See the `V' interactive command for additional information regarding that mode.

Note: The COMMAND field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. This is especially true for this field when command lines are being displayed (the `c' interactive command.) See topic 5c. SCROLLING a Window for additional information on accessing any truncated data.

7. DATA -- Data + Stack Size (KiB) The amount of private memory reserved by a process. It is also known as the Data Resident Set or DRS. Such memory may not yet be mapped to physical memory (RES) but will always be included in the virtual memory (VIRT) amount.

See `OVERVIEW, Linux Memory Types' for additional details.

8. ENVIRON -- Environment variables Display all of the environment variables, if any, as seen by the respective processes. These variables will be displayed in their raw native order, not the sorted order you are accustomed to seeing with an unqualified `set'.

Note: The ENVIRON field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. This is especially true for this field. See topic 5c. SCROLLING a Window for additional information on accessing any truncated data.

9. 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>.

10. GID -- Group Id The effective group ID.

11. GROUP -- Group Name The effective group name.

12. LXC -- Lxc Container Name The name of the lxc container within which a task is running. If a process is not running inside a container, a dash (`-') will be shown.

13. 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 dispatch-ability.

14. NU -- Last known NUMA node A number representing the NUMA node associated with the last used processor (`P'). When -1 is displayed it means that NUMA information is not available.

See the `'2' and `3' interactive commands for additional NUMA provisions affecting the summary area.

15. OOMa -- Out of Memory Adjustment Factor The value, ranging from -1000 to +1000, added to the current out of memory score (OOMs) which is then used to determine which task to kill when memory is exhausted.

16. OOMs -- Out of Memory Score The value, ranging from 0 to +1000, used to select task(s) to kill when memory is exhausted. Zero translates to `never kill' whereas 1000 means `always kill'.

17. 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).

18. PGRP -- Process Group Id Every process is member of a unique process group which is used for distribution of signals and by terminals to arbitrate requests for their input and output. When a process is created (forked), it becomes a member of the process group of its parent. By convention, this value equals the process ID (see PID) of the first member of a process group, called the process group leader.

19. PID -- Process Id The task's unique process ID, which periodically wraps, though never restarting at zero. In kernel terms, it is a dispatchable entity defined by a task_struct.

This value may also be used as: a process group ID (see PGRP); a session ID for the session leader (see SID); a thread group ID for the thread group leader (see TGID); and a TTY process group ID for the process group leader (see TPGID).

20. PPID -- Parent Process Id The process ID (pid) of a task's parent.

21. PR -- Priority The scheduling priority of the task. If you see `rt' in this field, it means the task is running under real time scheduling priority.

Under linux, real time priority is somewhat misleading since traditionally the operating itself was not preemptible. And while the 2.6 kernel can be made mostly preemptible, it is not always so.

22. RES -- Resident Memory Size (KiB) A subset of the virtual address space (VIRT) representing the non-swapped physical memory a task is currently using. It is also the sum of the RSan, RSfd and RSsh fields.

It can include private anonymous pages, private pages mapped to files (including program images and shared libraries) plus shared anonymous pages. All such memory is backed by the swap file represented separately under SWAP.

Lastly, this field may also include shared file-backed pages which, when modified, act as a dedicated swap file and thus will never impact SWAP.

See `OVERVIEW, Linux Memory Types' for additional details.

23. RSan -- Resident Anonymous Memory Size (KiB) A subset of resident memory (RES) representing private pages not mapped to a file.

24. RSfd -- Resident File-Backed Memory Size (KiB) A subset of resident memory (RES) representing the implicitly shared pages supporting program images and shared libraries. It also includes explicit file mappings, both private and shared.

25. RSlk -- Resident Locked Memory Size (KiB) A subset of resident memory (RES) which cannot be swapped out.

26. RSsh -- Resident Shared Memory Size (KiB) A subset of resident memory (RES) representing the explicitly shared anonymous shm*/mmap pages.

27. RUID -- Real User Id The real user ID.

28. RUSER -- Real User Name The real user name.

29. S -- Process Status The status of the task which can be one of: D = uninterruptible sleep I = idle R = running S = sleeping T = stopped by job control signal t = stopped by debugger during trace 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. Even without a true SMP machine, you may see numerous tasks in this state depending on top's delay interval and nice value.

30. SHR -- Shared Memory Size (KiB) A subset of resident memory (RES) that may be used by other processes. It will include shared anonymous pages and shared file-backed pages. It also includes private pages mapped to files representing program images and shared libraries.

See `OVERVIEW, Linux Memory Types' for additional details.

31. SID -- Session Id A session is a collection of process groups (see PGRP), usually established by the login shell. A newly forked process joins the session of its creator. By convention, this value equals the process ID (see PID) of the first member of the session, called the session leader, which is usually the login shell.

32. SUID -- Saved User Id The saved user ID.

33. SUPGIDS -- Supplementary Group IDs The IDs of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list.

Note: The SUPGIDS field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. See topic 5c. SCROLLING a Window for additional information on accessing any truncated data.

34. SUPGRPS -- Supplementary Group Names The names of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list.

Note: The SUPGRPS field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. See topic 5c. SCROLLING a Window for additional information on accessing any truncated data.

35. SUSER -- Saved User Name The saved user name.

36. SWAP -- Swapped Size (KiB) The formerly resident portion of a task's address space written to the swap file when physical memory becomes over committed.

See `OVERVIEW, Linux Memory Types' for additional details.

37. TGID -- Thread Group Id The ID of the thread group to which a task belongs. It is the PID of the thread group leader. In kernel terms, it represents those tasks that share an mm_struct.

38. 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 have used. You toggle Cumulative mode with `S', which is both a command-line option and an interactive command. See the `S' interactive command for additional information regarding this mode.

39. TIME+ -- CPU Time, hundredths The same as TIME, but reflecting more granularity through hundredths of a second.

40. TPGID -- Tty Process Group Id The process group ID of the foreground process for the connected tty, or -1 if a process is not connected to a terminal. By convention, this value equals the process ID (see PID) of the process group leader (see PGRP).

41. 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.

42. UID -- User Id The effective user ID of the task's owner.

43. USED -- Memory in Use (KiB) This field represents the non-swapped physical memory a task is using (RES) plus the swapped out portion of its address space (SWAP).

See `OVERVIEW, Linux Memory Types' for additional details.

44. USER -- User Name The effective user name of the task's owner.

45. VIRT -- Virtual Memory Size (KiB) 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 and pages that have been mapped but not used.

See `OVERVIEW, Linux Memory Types' for additional details.

46. WCHAN -- Sleeping in Function This field will show the name of the kernel function in which the task is currently sleeping. Running tasks will display a dash (`-') in this column.

47. nDRT -- Dirty Pages Count The number of pages that have been modified since they were last written to auxiliary storage. Dirty pages must be written to auxiliary storage before the corresponding physical memory location can be used for some other virtual page.

This field was deprecated with linux 2.6 and is always zero.

48. nMaj -- Major 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 auxiliary storage access is involved in making that page available.

49. nMin -- Minor Page Fault count The number of minor 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 minor page fault does not involve auxiliary storage access in making that page available.

50. nTH -- Number of Threads The number of threads associated with a process.

51. nsIPC -- IPC namespace The Inode of the namespace used to isolate interprocess communication (IPC) resources such as System V IPC objects and POSIX message queues.

52. nsMNT -- MNT namespace The Inode of the namespace used to isolate filesystem mount points thus offering different views of the filesystem hierarchy.

53. nsNET -- NET namespace The Inode of the namespace used to isolate resources such as network devices, IP addresses, IP routing, port numbers, etc.

54. nsPID -- PID namespace The Inode of the namespace used to isolate process ID numbers meaning they need not remain unique. Thus, each such namespace could have its own `init/systemd' (PID #1) to manage various initialization tasks and reap orphaned child processes.

55. nsUSER -- USER namespace The Inode of the namespace used to isolate the user and group ID numbers. Thus, a process could have a normal unprivileged user ID outside a user namespace while having a user ID of 0, with full root privileges, inside that namespace.

56. nsUTS -- UTS namespace The Inode of the namespace used to isolate hostname and NIS domain name. UTS simply means "UNIX Time-sharing System".

57. vMj -- Major Page Fault Count Delta The number of major page faults that have occurred since the last update (see nMaj).

58. vMn -- Minor Page Fault Count Delta The number of minor page faults that have occurred since the last update (see nMin).

3b. MANAGING Fields After pressing the interactive command `f' (Fields Management) you will be presented with a screen showing: 1) the `current' window name; 2) the designated sort field; 3) all fields in their current order along with descriptions. Entries marked with an asterisk are the currently displayed fields, screen width permitting.

• As the on screen instructions indicate, you navigate among the fields with the Up and Down arrow keys. The PgUp, PgDn, Home and End keys can also be used to quickly reach the first or last available field.

• The Right arrow key selects a field for repositioning and the Left arrow key or the <Enter> key commits that field's placement.

• The `d' key or the <Space> bar toggles a field's display status, and thus the presence or absence of the asterisk.

• The `s' key designates a field as the sort field. See topic 4c. TASK AREA Commands, SORTING for additional information regarding your selection of a sort field.

• The `a' and `w' keys can be used to cycle through all available windows and the `q' or <Esc> keys exit Fields Management.

The Fields Management screen can also be used to change the `current' window/field group in either full-screen mode or alternate-display mode. Whatever was targeted when `q' or <Esc> was pressed will be made current as you return to the top display. See topic 5. ALTERNATE-DISPLAY Provisions and the `g' interactive command for insight into `current' windows and field groups.

Note: Any window that has been scrolled horizontally will be reset if any field changes are made via the Fields Management screen. Any vertical scrolled position, however, will not be affected. See topic 5c. SCROLLING a Window for additional information regarding vertical and horizontal scrolling.