LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] show_task: real_parent
@ 2008-01-09  8:03 Roland McGrath
  2008-01-09  9:16 ` Ingo Molnar
  2008-01-09 16:03 ` Linus Torvalds
  0 siblings, 2 replies; 4+ messages in thread
From: Roland McGrath @ 2008-01-09  8:03 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: linux-kernel


The show_task function invoked by sysrq-t et al displays the
pid and parent's pid of each task.  It seems more useful to
show the actual process hierarchy here than who is using
ptrace on each process.

Signed-off-by: Roland McGrath <roland@redhat.com>
---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 3df84ea..37cf07a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4918,7 +4918,7 @@ static void show_task(struct task_struct *p)
 	}
 #endif
 	printk(KERN_CONT "%5lu %5d %6d\n", free,
-		task_pid_nr(p), task_pid_nr(p->parent));
+		task_pid_nr(p), task_pid_nr(p->real_parent));
 
 	if (state != TASK_RUNNING)
 		show_stack(p, NULL);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] show_task: real_parent
  2008-01-09  8:03 [PATCH] show_task: real_parent Roland McGrath
@ 2008-01-09  9:16 ` Ingo Molnar
  2008-01-09 16:03 ` Linus Torvalds
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-01-09  9:16 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Andrew Morton, Linus Torvalds, linux-kernel


* Roland McGrath <roland@redhat.com> wrote:

> The show_task function invoked by sysrq-t et al displays the pid and 
> parent's pid of each task.  It seems more useful to show the actual 
> process hierarchy here than who is using ptrace on each process.

>  	printk(KERN_CONT "%5lu %5d %6d\n", free,
> -		task_pid_nr(p), task_pid_nr(p->parent));
> +		task_pid_nr(p), task_pid_nr(p->real_parent));

thanks, applied.

you must be hacking ptrace/gdb/strace code right now ;-)

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] show_task: real_parent
  2008-01-09  8:03 [PATCH] show_task: real_parent Roland McGrath
  2008-01-09  9:16 ` Ingo Molnar
@ 2008-01-09 16:03 ` Linus Torvalds
  2008-01-09 20:15   ` Roland McGrath
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2008-01-09 16:03 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Andrew Morton, linux-kernel



On Wed, 9 Jan 2008, Roland McGrath wrote:
> 
> The show_task function invoked by sysrq-t et al displays the
> pid and parent's pid of each task.  It seems more useful to
> show the actual process hierarchy here than who is using
> ptrace on each process.

Hmm. It could go both ways. If the problem is some ptrace()/wait4() 
interaction issue (which is certainly not unheard of!) the parent that 
matters for the kernel may be the right thing to print out.

I wonder if we should just print out both (or perhaps print out the 
ptrace parent only if it differs from the normal parent?)

I'll apply this, because I agree that it's sensible in general, I just 
wonder how often anybody really even cares about the parent information 
when it's not about some wait-related issue..

		Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] show_task: real_parent
  2008-01-09 16:03 ` Linus Torvalds
@ 2008-01-09 20:15   ` Roland McGrath
  0 siblings, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2008-01-09 20:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, linux-kernel

I agree with your points.  I thought about making it display both.
But I didn't want to worry about breaking scripts that parse console
logs or whatever.  Personally I don't think I've ever found the ppid
in that display useful in debugging a ptrace issue.  I don't have any
special opinions about this display.  I just went on a little crusade
to get rid of task_struct.parent uses that aren't specifically for
its ptrace/wait purpose.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-09 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-09  8:03 [PATCH] show_task: real_parent Roland McGrath
2008-01-09  9:16 ` Ingo Molnar
2008-01-09 16:03 ` Linus Torvalds
2008-01-09 20:15   ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).