X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fproc%2Farray.c;h=190ba24f30b518c6d271cc4e9195426351fa25d1;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=c210ba30708da1f2979e1d2ed152b3001040c26f;hpb=d46bc780027c5439db9f72d42c0732775b53925a;p=linux-2.6.git diff --git a/fs/proc/array.c b/fs/proc/array.c index c210ba307..190ba24f3 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -73,7 +73,10 @@ #include #include #include -#include +#include +#include +#include +#include #include #include @@ -139,6 +142,7 @@ static inline const char * get_task_state(struct task_struct *tsk) TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE | TASK_ZOMBIE | + TASK_DEAD | TASK_STOPPED | TASK_ONHOLD); const char **p = &task_state_array[0]; @@ -152,10 +156,13 @@ static inline const char * get_task_state(struct task_struct *tsk) static inline char * task_state(struct task_struct *p, char *buffer) { + struct group_info *group_info; int g; - pid_t ppid; + pid_t pid, ppid, tgid; read_lock(&tasklist_lock); + tgid = vx_map_tgid(current->vx_info, p->tgid); + pid = vx_map_tgid(current->vx_info, p->pid); ppid = vx_map_tgid(current->vx_info, p->real_parent->pid); buffer += sprintf(buffer, "State:\t%s\n" @@ -168,8 +175,7 @@ static inline char * task_state(struct task_struct *p, char *buffer) "Gid:\t%d\t%d\t%d\t%d\n", get_task_state(p), (p->sleep_avg/1024)*100/(1020000000/1024), - p->tgid, - p->pid, p->pid ? ppid : 0, + tgid, pid, p->pid ? ppid : 0, p->pid && p->ptrace ? p->parent->pid : 0, p->uid, p->euid, p->suid, p->fsuid, p->gid, p->egid, p->sgid, p->fsgid); @@ -179,12 +185,14 @@ static inline char * task_state(struct task_struct *p, char *buffer) "FDSize:\t%d\n" "Groups:\t", p->files ? p->files->max_fds : 0); + + group_info = p->group_info; + get_group_info(group_info); task_unlock(p); - get_group_info(p->group_info); - for (g = 0; g < min(p->group_info->ngroups,NGROUPS_SMALL); g++) - buffer += sprintf(buffer, "%d ", GROUP_AT(p->group_info,g)); - put_group_info(p->group_info); + for (g = 0; g < min(group_info->ngroups,NGROUPS_SMALL); g++) + buffer += sprintf(buffer, "%d ", GROUP_AT(group_info,g)); + put_group_info(group_info); buffer += sprintf(buffer, "\n"); return buffer; @@ -344,7 +352,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer) sigset_t sigign, sigcatch; char state; int res; - pid_t ppid, pgid = -1, sid = -1; + pid_t pid, ppid, pgid = -1, sid = -1; int num_threads = 0; struct mm_struct *mm; unsigned long long start_time; @@ -360,6 +368,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer) if (bias_jiffies > task->start_time) bias_jiffies = task->start_time; } + pid = vx_map_tgid(task->vx_info, task->pid); mm = task->mm; if(mm) @@ -409,7 +418,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer) 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 %lu %lu %lu %d %d %lu %lu\n", - task->pid, + pid, task->comm, state, ppid,