aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 13b5d0708175..768d3e2d1087 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -129,21 +129,23 @@ static inline void task_name(struct seq_file *m, struct task_struct *p)
129 129
130/* 130/*
131 * The task state array is a strange "bitmap" of 131 * The task state array is a strange "bitmap" of
132 * reasons to sleep. Thus "running" is zero, and 132 * reasons to sleep. Thus, the first element is zero,
133 * you can test for combinations of others with 133 * and you can test for combinations of others with
134 * simple bit tests. 134 * simple bit tests.
135 */ 135 */
136#define TASK_STATE_X(num) TASK_STATE_##num " (" DESCR_TASK_STATE_##num ")"
136static const char *task_state_array[] = { 137static const char *task_state_array[] = {
137 "R (running)", /* 0 */ 138 TASK_STATE_X(0),
138 "S (sleeping)", /* 1 */ 139 TASK_STATE_X(1),
139 "D (disk sleep)", /* 2 */ 140 TASK_STATE_X(2),
140 "T (stopped)", /* 4 */ 141 TASK_STATE_X(4),
141 "t (tracing stop)", /* 8 */ 142 TASK_STATE_X(8),
142 "Z (zombie)", /* 16 */ 143 TASK_STATE_X(16),
143 "X (dead)", /* 32 */ 144 TASK_STATE_X(32),
144 "x (dead)", /* 64 */ 145 TASK_STATE_X(64),
145 "K (wakekill)", /* 128 */ 146 TASK_STATE_X(128),
146 "W (waking)", /* 256 */ 147 TASK_STATE_X(256),
148 TASK_STATE_X(512)
147}; 149};
148 150
149static inline const char *get_task_state(struct task_struct *tsk) 151static inline const char *get_task_state(struct task_struct *tsk)
@@ -270,7 +272,9 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
270 blocked = p->blocked; 272 blocked = p->blocked;
271 collect_sigign_sigcatch(p, &ignored, &caught); 273 collect_sigign_sigcatch(p, &ignored, &caught);
272 num_threads = atomic_read(&p->signal->count); 274 num_threads = atomic_read(&p->signal->count);
275 rcu_read_lock();
273 qsize = atomic_read(&__task_cred(p)->user->sigpending); 276 qsize = atomic_read(&__task_cred(p)->user->sigpending);
277 rcu_read_unlock();
274 qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur; 278 qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
275 unlock_task_sighand(p, &flags); 279 unlock_task_sighand(p, &flags);
276 } 280 }
@@ -337,6 +341,18 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
337 seq_printf(m, "\n"); 341 seq_printf(m, "\n");
338} 342}
339 343
344#define get_blocked_on(t) (-1)
345
346static inline void show_blocked_on(struct seq_file *m, struct task_struct *p)
347{
348 pid_t pid = get_blocked_on(p);
349
350 if (pid < 0)
351 return;
352
353 seq_printf(m, "BlckOn: %d\n", pid);
354}
355
340int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, 356int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
341 struct pid *pid, struct task_struct *task) 357 struct pid *pid, struct task_struct *task)
342{ 358{
@@ -357,6 +373,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
357 task_show_regs(m, task); 373 task_show_regs(m, task);
358#endif 374#endif
359 task_context_switch_counts(m, task); 375 task_context_switch_counts(m, task);
376 show_blocked_on(m, task);
360 return 0; 377 return 0;
361} 378}
362 379