Re: core files (was Re: 2.1.131: some quality thoughts)

Alex Butche (simius@algonet.se)
Mon, 21 Dec 1998 13:13:58 +0100 (CET)


On Sat, 19 Dec 1998, Albert D. Cahalan wrote:

> CaT writes:
> > Albert D. Cahalan wrote the following:
>
> >> If anyone cares enough, support this:
> >>
> >> echo "core.%c" > /proc/sys/kernel/corename

I cared enough :)

> >> For admin compatibility with the new /bin/ps, you should use these codes:
> >>
> >> CODE NORMAL HEADER
> >> %C pcpu %CPU
> >> %G group GROUP
> >> %P ppid PPID
> >> %U user USER
> >> %a args COMMAND
> >> %c comm COMMAND
> >> %g rgroup RGROUP
> >> %n nice NI
> >> %p pid PID
> >> %r pgid PGID
> >> %t etime ELAPSED
> >> %u ruser RUSER
> >> %x time TIME
> >> %y tty TTY
> >> %z vsz VSZ
> >
> > I'd like the adition to this list of %d to stand for the cwd the
> > command was started in. ie this would be the directory the corefile
> > would normally go to.
>
> Trying to avoid future conflict here... if anyone has AIX,
> please try "ps -o '%p %c %d'" and report the results.
> Also look for other possibly undocumented format options.
>
> Perhaps %D would be a safe choice.
> Also %S for a single-digit serial number. (or %H for "hash")
>
> > I could then do something like:
> >
> > echo "/tmp/cores/%d/%c.core" > /proc/sys/kernel/corename
> >
> > or
> >
> > echo "/tmp/cores/%u/%d/%c.core" > /proc/sys/kernel/corename
> >
> > (to keep the files behind a nicely permissioned dir)

Ok.. I've implemented most of this, ie. i now have the file
/proc/sys/kernel/corename that you can write to in the above fashion.
Not all the expanding %<whatever> codes are implemented yet, but i'll
get around to that soon.
/proc/sys/kernel/corename defaults to core so that this "feature" won't
bother anyone that doesn't want it.
The %<whatever> codes can be inserted anywhere in the string for maximum
flexability.

This is in fact the first time i've made any real change to the kernel
code, but i think (hope) i've done everything right.

If anyone is interested in this feature (maybe it could even go into the
official kernel?) i'll post a patch.

Thanks for your time..

-Simon Ekstrand

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/