Adding per-process core-file patterns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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.


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux