Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kawai, Hidehiro and committed by
Linus Torvalds
bb90110d ee78b0a6

+38
+38
Documentation/filesystems/proc.txt
··· 42 42 2.12 /proc/<pid>/oom_adj - Adjust the oom-killer score 43 43 2.13 /proc/<pid>/oom_score - Display current oom-killer score 44 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 48 Preface ··· 2184 2183 2185 2184 More information about this can be found within the taskstats documentation in 2186 2185 Documentation/accounting. 2186 + 2187 + 2.15 /proc/<pid>/coredump_filter - Core dump filtering settings 2188 + --------------------------------------------------------------- 2189 + When a process is dumped, all anonymous memory is written to a core file as 2190 + long as the size of the core file isn't limited. But sometimes we don't want 2191 + to dump some memory segments, for example, huge shared memory. Conversely, 2192 + sometimes we want to save file-backed memory segments into a core file, not 2193 + only the individual files. 2194 + 2195 + /proc/<pid>/coredump_filter allows you to customize which memory segments 2196 + will be dumped when the <pid> process is dumped. coredump_filter is a bitmask 2197 + of memory types. If a bit of the bitmask is set, memory segments of the 2198 + corresponding memory type are dumped, otherwise they are not dumped. 2199 + 2200 + The following 4 memory types are supported: 2201 + - (bit 0) anonymous private memory 2202 + - (bit 1) anonymous shared memory 2203 + - (bit 2) file-backed private memory 2204 + - (bit 3) file-backed shared memory 2205 + 2206 + Note that MMIO pages such as frame buffer are never dumped and vDSO pages 2207 + are always dumped regardless of the bitmask status. 2208 + 2209 + Default value of coredump_filter is 0x3; this means all anonymous memory 2210 + segments are dumped. 2211 + 2212 + If you don't want to dump all shared memory segments attached to pid 1234, 2213 + write 1 to the process's proc file. 2214 + 2215 + $ echo 0x1 > /proc/1234/coredump_filter 2216 + 2217 + When a new process is created, the process inherits the bitmask status from its 2218 + parent. It is useful to set up coredump_filter before the program runs. 2219 + For example: 2220 + 2221 + $ echo 0x7 > /proc/self/coredump_filter 2222 + $ ./some_program 2187 2223 2188 2224 ------------------------------------------------------------------------------