public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Cc: roland@redhat.com, Andrew Morton OSDL <akpm@osdl.org>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] cleanup ptrace stops and remove notify_parent
Date: 31 Aug 2004 11:59:25 -0400	[thread overview]
Message-ID: <1093967964.434.7086.camel@cube> (raw)

Roland McGrath writes:

> diff -rBzpu linux-2.6.9/fs/proc/array.c linux-2.6-ptracefix/fs/proc/array.c
> --- linux-2.6.9/fs/proc/array.c 2004-08-30 20:10:50.000000000 -0700
> +++ linux-2.6-ptracefix/fs/proc/array.c 2004-08-30 18:43:29.000000000 -0700
> @@ -130,8 +130,9 @@ static const char *task_state_array[] = 
>   "S (sleeping)",  /*  1 */
>   "D (disk sleep)", /*  2 */
>   "T (stopped)",  /*  4 */
> - "Z (zombie)",  /*  8 */
> - "X (dead)"  /* 16 */
> + "T (tracing stop)", /*  8 */
> + "Z (zombie)",  /* 16 */
> + "X (dead)"  /* 32 */
>  };

For TASK_DEAD and TASK_TRACED, might you be hiding some
underlying state? I want to display stuff like:

T    stopped (not traced)
TX   stopped, and being traced
RX   running or runnable, and being traced
ZE   zombie, and trying to exit
RXE  running, trying to exit, and traced

It's troubling the way TASK_DEAD and TASK_TRACED show up as
actual states and hide any other stuff. I'd much prefer them
to be flags of some sort.

> diff -rBzpu linux-2.6.9/kernel/power/process.c linux-2.6-ptracefix/kernel/power/process.c
> --- linux-2.6.9/kernel/power/process.c 2004-08-30 20:10:51.000000000 -0700
> +++ linux-2.6-ptracefix/kernel/power/process.c 2004-08-30 18:20:05.000000000 -0700
> @@ -25,7 +25,8 @@ static inline int freezeable(struct task
>       (p->flags & PF_NOFREEZE) ||
>       (p->state == TASK_ZOMBIE) ||
>       (p->state == TASK_DEAD) ||
> -     (p->state == TASK_STOPPED))
> +     (p->state == TASK_STOPPED) ||
> +     (p->state == TASK_TRACED))

(p->state & (TASK_ZOMBIE|TASK_DEAD|TASK_STOPPED|TASK_TRACED))

> @@ -70,6 +71,7 @@ int freeze_processes(void)
>     if (!freezeable(p))
>      continue;
>     if ((p->flags & PF_FROZEN) ||
> +       (p->state == TASK_TRACED) ||
>         (p->state == TASK_STOPPED))
>      continue;

(p->state & (TASK_TRACED|TASK_STOPPED))

> @@ -3670,7 +3670,7 @@ static void show_task(task_t * p)
>   task_t *relative;
>   unsigned state;
>   unsigned long free = 0;
> - static const char *stat_nam[] = { "R", "S", "D", "T", "Z", "W" };
> + static const char *stat_nam[] = { "R", "S", "D", "T", "t", "Z", "X" };

The 't' doesn't match what you do elsewhere. Try "TX" for that.
I think "ZX" would be right for an exiting process.




             reply	other threads:[~2004-08-31 16:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-31 15:59 Albert Cahalan [this message]
2004-08-31 23:54 ` [PATCH] cleanup ptrace stops and remove notify_parent Roland McGrath
2004-09-01  0:27   ` Linus Torvalds
     [not found] <2z7vs-2F1-13@gated-at.bofh.it>
2004-08-31 10:00 ` Andi Kleen
2004-09-01  0:27   ` Roland McGrath
2004-09-01  1:56     ` Roland McGrath
2004-09-04 13:38       ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2004-08-31  3:25 Roland McGrath
2004-08-31  3:43 ` Andrew Morton
2004-08-31  4:11   ` Roland McGrath
2004-08-31  4:26     ` Andrew Morton
2004-08-31  5:43       ` Roland McGrath
2004-08-31  4:27     ` Linus Torvalds
2004-08-31  4:50       ` Roland McGrath
2004-08-31 13:19       ` OGAWA Hirofumi
2004-08-31 13:56         ` Daniel Jacobowitz
2004-09-01  0:11         ` Roland McGrath
2004-09-01  4:25           ` OGAWA Hirofumi
2004-08-31  9:29     ` Christoph Hellwig
2004-08-31  9:43       ` Anton Blanchard
2004-09-01  0:00         ` Roland McGrath
2004-08-31  3:59 ` Roland McGrath
2004-08-31  4:22 ` Daniel Jacobowitz
2004-08-31  4:55   ` Roland McGrath
2004-08-31  4:59     ` Daniel Jacobowitz

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=1093967964.434.7086.camel@cube \
    --to=albert@users.sf.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --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