Re: /proc/sys/kernel/corename

James H. Cloos Jr. (cloos@jhcloos.com)
22 Dec 1998 11:43:02 -0600


>>>>> "Simon" == <simius@algonet.se> writes:

Simon> Problem values:

Simon> coredumping processes: args,elapsed time
Simon> user owning the coredumping processes: username,groupname,tty

task_struct's mm member, of type mm_struct has the members arg_start
and arg_end, from which you can get the arguments.

task_struct's start_time should help for elaped time, unless you want
the user time and/or system time; for those use the per_cpu_utime[]
and per_cpu_stime[] arrays.

for the username and groupname, you'll have to settle for uid and gid
(uid, euid, suid, fsuid, gid, egid, sgid and fsgid are all in
task_struct).

for the tty, use the struct tty_struct tty member of task_struct. It
looks like tty_name(current->tty,buf) will put the tty's name into the
buffer buf.

Also cf <linux/elfcore.h> and linux/fs/binfmt_elf.c.

>From the latter, CT_TO_SECS(current->times.tms_utime) and
CT_TO_USECS(current->times.tms_utime) give the seconds and useconds of
the user time; the same works for stime, cutime and cstime (c for
cumulative, I presume).

Also from there, use copy_from_user to copy (current->mm->arg_end -
current->mm->arg_start) octets from (const char *)
current->mm->arg_start to get at the arguments.

-JimC

-- 
James H. Cloos, Jr.       <http://www.jhcloos.com/cloos/pgp_public_key.txt>
<cloos@jhcloos.com>      E9E9 F828 61A4 6EA9 0F2B  63E7 997A 9F17 ED7D AEA6

- 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/