Re: [Feature Request?] Inline compression of process core dumps

Bill Rugolsky Jr.
2007-04-12T16:41:05Z

On Thu, Apr 12, 2007 at 11:52:38AM -0400, Christopher S. Aker wrote:
> I've been trying to find a method for compressing process core dumps
> before they hit disk.
>
> I ask because we've got some fairly large UML processes (1GB for some),
> and we're trying to capture dumps to help Jeff debug an evasive bug.
> Our systems use a small root partition and most of the other disk
> resources on the host are allocated towards the UMLs.
>
> There are userspace solutions to this problem: allowing the
> uncompressed core dump to spin out to disk and then coming in afterwards
> and doing the compression, or maybe even a compressed filesystem where
> the core dumps land, but I just thought I'd throw this out there since
> it seems it would be a useful feature :)

See Documentation/kernel.txt for kernels >= 2.6.19:

core_pattern:

core_pattern is used to specify a core dumpfile pattern name.
. max length 128 characters; default value is "core"
. core_pattern is used as a pattern template for the output filename;
certain string patterns (beginning with '%') are substituted with
their actual values.
. backward compatibility with core_uses_pid:
If core_pattern does not include "%p" (default does not)
and core_uses_pid is set, then .PID will be appended to
the filename.
. corename format specifiers:
%<NUL> '%' is dropped
%% output one '%'
%p pid
%u uid
%g gid
%s signal number
%t UNIX time of dump
%h hostname
%e executable filename
%<OTHER> both are dropped
. If the first character of the pattern is a '|', the kernel will treat
the rest of the pattern as a command to run. The core dump will be
written to the standard input of that program instead of to a file.

Regards,

Bill Rugolsky