[PATCH] Show thread_info->flags in /proc/PID/status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It comes up as useful in debugging to be able to see task->thread_info->flags
along with signal information and such.  There is no way currently to
elicit these bits from the kernel via sysrq or /proc (AFAIK).
This patch adds the field to /proc/PID/status.


Thanks,
Roland

Signed-off-by: Roland McGrath <[email protected]>


--- linux-2.6/fs/proc/array.c
+++ linux-2.6/fs/proc/array.c
@@ -287,6 +287,12 @@ static inline char *task_cap(struct task
 			    cap_t(p->cap_effective));
 }
 
+static inline char *task_tif(struct task_struct *p, char *buffer)
+{
+	return buffer + sprintf(buffer, "ThreadInfoFlags:\t%lu\n",
+				(unsigned long) p->thread_info->flags);
+}
+
 int proc_pid_status(struct task_struct *task, char * buffer)
 {
 	char * orig = buffer;
@@ -294,6 +300,7 @@ int proc_pid_status(struct task_struct *
 
 	buffer = task_name(task, buffer);
 	buffer = task_state(task, buffer);
+	buffer = task_tif(task, buffer);
  
 	if (mm) {
 		buffer = task_mem(mm, buffer);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux