proc/array.c: Use TASK_REPORT
[pandora-kernel.git] / fs / proc / array.c
index 63c95af..5be663e 100644 (file)
@@ -141,12 +141,7 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-       unsigned int state = (tsk->state & (TASK_RUNNING |
-                                           TASK_INTERRUPTIBLE |
-                                           TASK_UNINTERRUPTIBLE |
-                                           TASK_STOPPED |
-                                           TASK_TRACED)) |
-                                          tsk->exit_state;
+       unsigned int state = (tsk->state & TASK_REPORT) | tsk->exit_state;
        const char **p = &task_state_array[0];
 
        while (state) {
@@ -358,7 +353,8 @@ static cputime_t task_utime(struct task_struct *p)
        }
        utime = (clock_t)temp;
 
-       return clock_t_to_cputime(utime);
+       p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime));
+       return p->prev_utime;
 }
 
 static cputime_t task_stime(struct task_struct *p)
@@ -373,7 +369,10 @@ static cputime_t task_stime(struct task_struct *p)
        stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
                        cputime_to_clock_t(task_utime(p));
 
-       return clock_t_to_cputime(stime);
+       if (stime >= 0)
+               p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
+
+       return p->prev_stime;
 }
 #endif