* [PATCH] Show thread_info->flags in /proc/PID/status
@ 2005-04-01 22:39 Roland McGrath
2005-04-01 22:48 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Roland McGrath @ 2005-04-01 22:39 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Show thread_info->flags in /proc/PID/status
2005-04-01 22:39 [PATCH] Show thread_info->flags in /proc/PID/status Roland McGrath
@ 2005-04-01 22:48 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2005-04-01 22:48 UTC (permalink / raw)
To: Roland McGrath; +Cc: torvalds, linux-kernel
Roland McGrath <roland@redhat.com> wrote:
>
> 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.
>
> ...
>
> --- 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);
> +}
Alas, thread_info.flags is an arch-specific thing and m68k doesn't
implement it. All other architectures do, though.
Maybe we should show thread_info->flags in the sysrq-t output instead?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-04-01 22:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-01 22:39 [PATCH] Show thread_info->flags in /proc/PID/status Roland McGrath
2005-04-01 22:48 ` Andrew Morton
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®