diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2012-12-17 19:05:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:28 -0500 |
commit | f1d8c16298d317dbdeb166a135e85dadd1782858 (patch) | |
tree | b7b5fd4fc10dfa153e796a7bd69d4edcd8a695b1 /Documentation/filesystems | |
parent | be77196b809cdce8603a5aadd5e3cfabd3cbef96 (diff) |
docs: add documentation about /proc/<pid>/fdinfo/<fd> output
[akpm@linux-foundation.org: tweak documentation]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: James Bottomley <jbottomley@parallels.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matthew Helsley <matt.helsley@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/proc.txt | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 12665ee7094a..bcc27c97efbb 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -41,6 +41,7 @@ Table of Contents | |||
41 | 3.5 /proc/<pid>/mountinfo - Information about mounts | 41 | 3.5 /proc/<pid>/mountinfo - Information about mounts |
42 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | 42 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm |
43 | 3.7 /proc/<pid>/task/<tid>/children - Information about task children | 43 | 3.7 /proc/<pid>/task/<tid>/children - Information about task children |
44 | 3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file | ||
44 | 45 | ||
45 | 4 Configuring procfs | 46 | 4 Configuring procfs |
46 | 4.1 Mount options | 47 | 4.1 Mount options |
@@ -1633,6 +1634,87 @@ pids, so one need to either stop or freeze processes being inspected | |||
1633 | if precise results are needed. | 1634 | if precise results are needed. |
1634 | 1635 | ||
1635 | 1636 | ||
1637 | 3.7 /proc/<pid>/fdinfo/<fd> - Information about opened file | ||
1638 | --------------------------------------------------------------- | ||
1639 | This file provides information associated with an opened file. The regular | ||
1640 | files have at least two fields -- 'pos' and 'flags'. The 'pos' represents | ||
1641 | the current offset of the opened file in decimal form [see lseek(2) for | ||
1642 | details] and 'flags' denotes the octal O_xxx mask the file has been | ||
1643 | created with [see open(2) for details]. | ||
1644 | |||
1645 | A typical output is | ||
1646 | |||
1647 | pos: 0 | ||
1648 | flags: 0100002 | ||
1649 | |||
1650 | The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags | ||
1651 | pair provide additional information particular to the objects they represent. | ||
1652 | |||
1653 | Eventfd files | ||
1654 | ~~~~~~~~~~~~~ | ||
1655 | pos: 0 | ||
1656 | flags: 04002 | ||
1657 | eventfd-count: 5a | ||
1658 | |||
1659 | where 'eventfd-count' is hex value of a counter. | ||
1660 | |||
1661 | Signalfd files | ||
1662 | ~~~~~~~~~~~~~~ | ||
1663 | pos: 0 | ||
1664 | flags: 04002 | ||
1665 | sigmask: 0000000000000200 | ||
1666 | |||
1667 | where 'sigmask' is hex value of the signal mask associated | ||
1668 | with a file. | ||
1669 | |||
1670 | Epoll files | ||
1671 | ~~~~~~~~~~~ | ||
1672 | pos: 0 | ||
1673 | flags: 02 | ||
1674 | tfd: 5 events: 1d data: ffffffffffffffff | ||
1675 | |||
1676 | where 'tfd' is a target file descriptor number in decimal form, | ||
1677 | 'events' is events mask being watched and the 'data' is data | ||
1678 | associated with a target [see epoll(7) for more details]. | ||
1679 | |||
1680 | Fsnotify files | ||
1681 | ~~~~~~~~~~~~~~ | ||
1682 | For inotify files the format is the following | ||
1683 | |||
1684 | pos: 0 | ||
1685 | flags: 02000000 | ||
1686 | inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d | ||
1687 | |||
1688 | where 'wd' is a watch descriptor in decimal form, ie a target file | ||
1689 | descriptor number, 'ino' and 'sdev' are inode and device where the | ||
1690 | target file resides and the 'mask' is the mask of events, all in hex | ||
1691 | form [see inotify(7) for more details]. | ||
1692 | |||
1693 | If the kernel was built with exportfs support, the path to the target | ||
1694 | file is encoded as a file handle. The file handle is provided by three | ||
1695 | fields 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex | ||
1696 | format. | ||
1697 | |||
1698 | If the kernel is built without exportfs support the file handle won't be | ||
1699 | printed out. | ||
1700 | |||
1701 | For fanotify files the format is | ||
1702 | |||
1703 | pos: 0 | ||
1704 | flags: 02 | ||
1705 | fanotify ino:2 sdev:800013 mask:1 ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:0200000000000000 | ||
1706 | |||
1707 | or | ||
1708 | |||
1709 | pos: 0 | ||
1710 | flags: 02 | ||
1711 | fanotify mnt_id:13 mask:1 ignored_mask:40000000 | ||
1712 | |||
1713 | where 'ino', 'sdev' are target inode and device, 'mnt_id' is the mount | ||
1714 | point identifier, 'mask' is the events mask used and 'ignored_mask' is | ||
1715 | the mask of events which are to be ignored. All in hex format. | ||
1716 | |||
1717 | |||
1636 | ------------------------------------------------------------------------------ | 1718 | ------------------------------------------------------------------------------ |
1637 | Configuring procfs | 1719 | Configuring procfs |
1638 | ------------------------------------------------------------------------------ | 1720 | ------------------------------------------------------------------------------ |