diff options
Diffstat (limited to 'Documentation')
-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 | ------------------------------------------------------------------------------ |