From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Show thread_info->flags in /proc/PID/status
Date: Fri, 1 Apr 2005 14:39:07 -0800 [thread overview]
Message-ID: <200504012239.j31Md7H3032185@magilla.sf.frob.com> (raw)
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 <roland@redhat.com>
--- 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);
next reply other threads:[~2005-04-01 22:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-01 22:39 Roland McGrath [this message]
2005-04-01 22:48 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200504012239.j31Md7H3032185@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®