* : base.c too.
*/
-#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/highmem.h>
#include <linux/file.h>
#include <linux/times.h>
-#include <linux/vs_context.h>
-#include <linux/vs_network.h>
-#include <linux/vs_cvirt.h>
+#include <linux/cpuset.h>
+#include <linux/rcupdate.h>
+#include <linux/delayacct.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/io.h>
#include <asm/processor.h>
+#include "internal.h"
/* Gcc optimizes away "strlen(x)" for constant x */
#define ADDBUF(buffer, string) \
"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)
{
struct group_info *group_info;
int g;
+ struct fdtable *fdt = NULL;
pid_t pid, ptgid, tppid, tgid;
read_lock(&tasklist_lock);
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);
{
sigset_t pending, shpending, blocked, ignored, caught;
int num_threads = 0;
+ unsigned long qsize = 0;
+ unsigned long qlim = 0;
sigemptyset(&pending);
sigemptyset(&shpending);
blocked = p->blocked;
collect_sigign_sigcatch(p, &ignored, &caught);
num_threads = atomic_read(&p->signal->count);
+ qsize = atomic_read(&p->user->sigpending);
+ qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
spin_unlock_irq(&p->sighand->siglock);
}
read_unlock(&tasklist_lock);
buffer += sprintf(buffer, "Threads:\t%d\n", num_threads);
+ buffer += sprintf(buffer, "SigQ:\t%lu/%lu\n", qsize, qlim);
/* render them all */
buffer = render_sigset_t("SigPnd:\t", &pending, buffer);
char * orig = buffer;
#ifdef CONFIG_VSERVER_LEGACY
struct vx_info *vxi;
+#endif
+#ifdef CONFIG_VSERVER_LEGACYNET
struct nx_info *nxi;
#endif
struct mm_struct *mm = get_task_mm(task);
}
buffer = task_sig(task, buffer);
buffer = task_cap(task, buffer);
+ buffer = cpuset_task_status_allowed(task, buffer);
+ if (task_vx_flags(task, VXF_INFO_HIDE, 0))
+ goto skip;
#ifdef CONFIG_VSERVER_LEGACY
buffer += sprintf (buffer,"s_context: %d\n", vx_task_xid(task));
vxi = task_get_vx_info(task);
buffer += sprintf (buffer,"initpid: none\n");
}
put_vx_info(vxi);
+#else
+ buffer += sprintf (buffer,"VxID: %d\n", vx_task_xid(task));
+#endif
+#ifdef CONFIG_VSERVER_LEGACYNET
nxi = task_get_nx_info(task);
if (nxi) {
int i;
}
put_nx_info(nxi);
#endif
-#if defined(CONFIG_ARCH_S390)
+skip:
+#if defined(CONFIG_S390)
buffer = task_show_regs(task, buffer);
#endif
return buffer - orig;
{
unsigned long vsize, eip, esp, wchan = ~0UL;
long priority, nice;
- unsigned long long bias_uptime = 0;
int tty_pgrp = -1, tty_nr = 0;
sigset_t sigign, sigcatch;
char state;
int num_threads = 0;
struct mm_struct *mm;
unsigned long long start_time;
- unsigned long cmin_flt = 0, cmaj_flt = 0, cutime = 0, cstime = 0;
- unsigned long min_flt = 0, maj_flt = 0, utime = 0, stime = 0;
+ unsigned long cmin_flt = 0, cmaj_flt = 0;
+ unsigned long min_flt = 0, maj_flt = 0;
+ cputime_t cutime, cstime, utime, stime;
unsigned long rsslim = 0;
struct task_struct *t;
char tcomm[sizeof(task->comm)];
sigemptyset(&sigign);
sigemptyset(&sigcatch);
+ cutime = cstime = utime = stime = cputime_zero;
+
+ mutex_lock(&tty_mutex);
read_lock(&tasklist_lock);
if (task->sighand) {
spin_lock_irq(&task->sighand->siglock);
do {
min_flt += t->min_flt;
maj_flt += t->maj_flt;
- utime += t->utime;
- stime += t->stime;
+ utime = cputime_add(utime, t->utime);
+ stime = cputime_add(stime, t->stime);
t = next_thread(t);
} while (t != task);
}
if (whole) {
min_flt += task->signal->min_flt;
maj_flt += task->signal->maj_flt;
- utime += task->signal->utime;
- stime += task->signal->stime;
+ utime = cputime_add(utime, task->signal->utime);
+ stime = cputime_add(stime, task->signal->stime);
}
}
pid = vx_info_map_pid(task->vx_info, pid_alive(task) ? task->pid : 0);
pgid = vx_info_map_pid(task->vx_info, pgid);
read_unlock(&tasklist_lock);
+ mutex_unlock(&tty_mutex);
if (!whole || num_threads<2) {
wchan = 0;
if (current->uid == task->uid || current->euid == task->uid ||
- capable(CAP_SYS_NICE))
+ capable(CAP_SYS_NICE))
wchan = get_wchan(task);
}
if (!whole) {
priority = task_prio(task);
nice = task_nice(task);
- read_lock(&tasklist_lock);
- pid = vx_info_map_pid(task->vx_info, task->pid);
- ppid = (!(pid > 1)) ? 0 :
- vx_info_map_pid(task->vx_info, task->real_parent->pid);
- pgid = vx_info_map_pid(task->vx_info, pgid);
- read_unlock(&tasklist_lock);
-
/* Temporary variable needed for gcc-2.96 */
/* 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 - bias_uptime);
+ start_time = nsec_to_clock_t(start_time);
/* fixup start time for virt uptime */
if (vx_flags(VXF_VIRT_UPTIME, 0)) {
}
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",
+%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 %llu\n",
pid,
tcomm,
state,
cmin_flt,
maj_flt,
cmaj_flt,
- jiffies_to_clock_t(utime),
- jiffies_to_clock_t(stime),
- jiffies_to_clock_t(cutime),
- jiffies_to_clock_t(cstime),
+ cputime_to_clock_t(utime),
+ cputime_to_clock_t(stime),
+ cputime_to_clock_t(cutime),
+ cputime_to_clock_t(cstime),
priority,
nice,
num_threads,
- jiffies_to_clock_t(task->it_real_value),
start_time,
vsize,
- mm ? 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,
task->exit_signal,
task_cpu(task),
task->rt_priority,
- task->policy);
+ task->policy,
+ (unsigned long long)delayacct_blkio_ticks(task));
if(mm)
mmput(mm);
return res;
return sprintf(buffer,"%d %d %d %d %d %d %d\n",
size, resident, shared, text, lib, data, 0);
}
-
-
-int proc_pid_delay(struct task_struct *task, char * buffer)
-{
- int res;
-
- res = sprintf(buffer,"%u %llu %llu %u %llu %u %llu\n",
- get_delay(task,runs),
- (unsigned long long)get_delay(task,runcpu_total),
- (unsigned long long)get_delay(task,waitcpu_total),
- get_delay(task,num_iowaits),
- (unsigned long long)get_delay(task,iowait_total),
- get_delay(task,num_memwaits),
- (unsigned long long)get_delay(task,mem_iowait_total)
- );
- return res;
-}
-