diff options
author | Kawai, Hidehiro <hidehiro.kawai.ez@hitachi.com> | 2007-07-19 04:48:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:47 -0400 |
commit | bb90110dcb9e93bf79e3c988abc6cbcabd46d57f (patch) | |
tree | 0c082570bea12431636bd44fe470ebc0c9a6d8ab /Documentation/filesystems | |
parent | ee78b0a61f0514ffc3d59257fbe6863b43477829 (diff) |
coredump masking: documentation for /proc/pid/coredump_filter
This patch adds the documentation for /proc/<pid>/coredump_filter.
Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
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 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 72e247ef6fa2..4a37e25e694c 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -42,6 +42,7 @@ Table of Contents | |||
42 | 2.12 /proc/<pid>/oom_adj - Adjust the oom-killer score | 42 | 2.12 /proc/<pid>/oom_adj - Adjust the oom-killer score |
43 | 2.13 /proc/<pid>/oom_score - Display current oom-killer score | 43 | 2.13 /proc/<pid>/oom_score - Display current oom-killer score |
44 | 2.14 /proc/<pid>/io - Display the IO accounting fields | 44 | 2.14 /proc/<pid>/io - Display the IO accounting fields |
45 | 2.15 /proc/<pid>/coredump_filter - Core dump filtering settings | ||
45 | 46 | ||
46 | ------------------------------------------------------------------------------ | 47 | ------------------------------------------------------------------------------ |
47 | Preface | 48 | Preface |
@@ -2184,4 +2185,41 @@ those 64-bit counters, process A could see an intermediate result. | |||
2184 | More information about this can be found within the taskstats documentation in | 2185 | More information about this can be found within the taskstats documentation in |
2185 | Documentation/accounting. | 2186 | Documentation/accounting. |
2186 | 2187 | ||
2188 | 2.15 /proc/<pid>/coredump_filter - Core dump filtering settings | ||
2189 | --------------------------------------------------------------- | ||
2190 | When a process is dumped, all anonymous memory is written to a core file as | ||
2191 | long as the size of the core file isn't limited. But sometimes we don't want | ||
2192 | to dump some memory segments, for example, huge shared memory. Conversely, | ||
2193 | sometimes we want to save file-backed memory segments into a core file, not | ||
2194 | only the individual files. | ||
2195 | |||
2196 | /proc/<pid>/coredump_filter allows you to customize which memory segments | ||
2197 | will be dumped when the <pid> process is dumped. coredump_filter is a bitmask | ||
2198 | of memory types. If a bit of the bitmask is set, memory segments of the | ||
2199 | corresponding memory type are dumped, otherwise they are not dumped. | ||
2200 | |||
2201 | The following 4 memory types are supported: | ||
2202 | - (bit 0) anonymous private memory | ||
2203 | - (bit 1) anonymous shared memory | ||
2204 | - (bit 2) file-backed private memory | ||
2205 | - (bit 3) file-backed shared memory | ||
2206 | |||
2207 | Note that MMIO pages such as frame buffer are never dumped and vDSO pages | ||
2208 | are always dumped regardless of the bitmask status. | ||
2209 | |||
2210 | Default value of coredump_filter is 0x3; this means all anonymous memory | ||
2211 | segments are dumped. | ||
2212 | |||
2213 | If you don't want to dump all shared memory segments attached to pid 1234, | ||
2214 | write 1 to the process's proc file. | ||
2215 | |||
2216 | $ echo 0x1 > /proc/1234/coredump_filter | ||
2217 | |||
2218 | When a new process is created, the process inherits the bitmask status from its | ||
2219 | parent. It is useful to set up coredump_filter before the program runs. | ||
2220 | For example: | ||
2221 | |||
2222 | $ echo 0x7 > /proc/self/coredump_filter | ||
2223 | $ ./some_program | ||
2224 | |||
2187 | ------------------------------------------------------------------------------ | 2225 | ------------------------------------------------------------------------------ |