Archive for the ‘Process’ Category

Meaning of /proc/stat

What are the meanings of each field in /proc/stat file? Some documents said that each field represented in jiffies, but actually it isn’t. It was true on kernel 2.4, but no more in kernel 2.6. We can easily see the meaning of each field at the kernel source. http://lxr.linux.no/linux+v2.6.27.10/fs/proc/proc_misc.c static int show_stat(struct seq_file *p, void [...]

How to set the pattern of core file

Sometimes, when application’s going wrong, core files are created. This is useful for the debugging purpose. If you want to make core file with the ‘core.%pid’ format, you should set the following parameters in the sysctl configuration. kernel.core_pattern = core kernel.core_uses_pid = 1 You also need to change the limit of the core file size [...]

do_coredump()

In linux v2.4.31, creation of coredump looks something like this. 1127int do_coredump(long signr, struct pt_regs * regs) 1128{ 1129 struct linux_binfmt * binfmt; 1130 char corename[CORENAME_MAX_SIZE + 1]; 1131 struct file * file; 1132 struct inode * inode; 1133 int retval = 0; 1134 int fsuid = current->fsuid; 1135 1136 lock_kernel(); 1137 binfmt = current->binfmt; [...]