X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fproc%2Farray.c;h=dc4d1d0aa878ab453c835723fbf21f94b6340422;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=f54b459ab9659d6bb141642a0dec649ecd811b6c;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/fs/proc/array.c b/fs/proc/array.c index f54b459ab..dc4d1d0aa 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include @@ -138,7 +139,8 @@ static const char *task_state_array[] = { "T (tracing stop)", /* 8 */ "Z (zombie)", /* 16 */ "X (dead)", /* 32 */ - "H (on hold)" /* 64 */ + "N (noninteractive)", /* 64 */ + "H (on hold)" /* 128 */ }; static inline const char * get_task_state(struct task_struct *tsk) @@ -164,6 +166,7 @@ static inline char * task_state(struct task_struct *p, char *buffer) { struct group_info *group_info; int g; + struct fdtable *fdt = NULL; pid_t pid, ptgid, tppid, tgid; read_lock(&tasklist_lock); @@ -188,10 +191,14 @@ static inline char * task_state(struct task_struct *p, char *buffer) p->gid, p->egid, p->sgid, p->fsgid); read_unlock(&tasklist_lock); task_lock(p); + rcu_read_lock(); + if (p->files) + fdt = files_fdtable(p->files); buffer += sprintf(buffer, "FDSize:\t%d\n" "Groups:\t", - p->files ? p->files->max_fds : 0); + fdt ? fdt->max_fds : 0); + rcu_read_unlock(); group_info = p->group_info; get_group_info(group_info); @@ -357,7 +364,7 @@ int proc_pid_status(struct task_struct *task, char * buffer) put_nx_info(nxi); #endif skip: -#if defined(CONFIG_ARCH_S390) +#if defined(CONFIG_S390) buffer = task_show_regs(task, buffer); #endif return buffer - orig; @@ -379,7 +386,6 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) unsigned long min_flt = 0, maj_flt = 0; cputime_t cutime, cstime, utime, stime; unsigned long rsslim = 0; - unsigned long it_real_value = 0; struct task_struct *t; char tcomm[sizeof(task->comm)]; @@ -435,7 +441,6 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) utime = cputime_add(utime, task->signal->utime); stime = cputime_add(stime, task->signal->stime); } - it_real_value = task->signal->it_real_value; } pid = vx_info_map_pid(task->vx_info, pid_alive(task) ? task->pid : 0); ppid = (!(pid > 1)) ? 0 : vx_info_map_tgid(task->vx_info, @@ -444,8 +449,12 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) read_unlock(&tasklist_lock); - if (!whole || num_threads<2) - wchan = get_wchan(task); + if (!whole || num_threads<2) { + wchan = 0; + if (current->uid == task->uid || current->euid == task->uid || + capable(CAP_SYS_NICE)) + wchan = get_wchan(task); + } if (!whole) { min_flt = task->min_flt; maj_flt = task->maj_flt; @@ -462,7 +471,6 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) /* convert timespec -> nsec*/ start_time = (unsigned long long)task->start_time.tv_sec * NSEC_PER_SEC + task->start_time.tv_nsec; - /* convert nsec -> ticks */ start_time = nsec_to_clock_t(start_time); @@ -478,7 +486,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) } res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \ -%lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu \ +%lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \ %lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n", pid, tcomm, @@ -500,10 +508,9 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) priority, nice, num_threads, - jiffies_to_clock_t(it_real_value), start_time, vsize, - mm ? get_mm_counter(mm, rss) : 0, /* you might want to shift this left 3 */ + mm ? get_mm_rss(mm) : 0, rsslim, mm ? mm->start_code : 0, mm ? mm->end_code : 0,