Per-process core-file patterns

From: R, Ashwin (Ashwin)
Date: Tue Mar 22 2005 - 11:17:07 EST


So, I want to add the "coreadm" support for manipulating the core
file-names like on Solaris, for the latest
2.6 kernel. Solaris supports the concept of per-process corefile patterns.
Hence, each process
can effectively have its own core-file pattern in the event that it
crashes. The pattern is similar to the pattern
used in fs/exec.c ( function: format_corename).
Now, I have 2 ways of implementing this on Linux:
1. Create an entry in /proc/<pid> for the process when it is forked (
default value is filled up by getting this entry
from the parent's directory;hence children inherit the parent's core
pattern),
which holds the core pattern and query it when creating the corefile
from the kernel. The "coreadm" command
in this case, just modifies this entry in /proc.
2. Add a new field in task_struct and write a new system-call (similar to
"corectl" on solaris) which can manipulate this field.
The "coreadm" command needs to do the corectl system call and modify
the parameters accordingly.

I see by "trussing" on the coreadm command on Solaris that it uses a system
call "corectl".

Which is the best approach to take?

-Thanks.

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