9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Pietro Gagliardi <pietro10@mac.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] process group, processes running in the background
Date: Fri, 20 Jun 2008 15:10:25 -0400	[thread overview]
Message-ID: <F6E99964-C234-499D-B9F0-19532AAECAC0@mac.com> (raw)
In-Reply-To: <a560a5d00806200703g2cee6de1rc6b0525f704a4223@mail.gmail.com>

On Jun 20, 2008, at 10:03 AM, Rudolf Sykora wrote:

> Hello,
>
> is there any simple way how to identify processes belonging to one
> concrete process group?

They're called "note groups" and the noteid file of each process has
the number. So if you call 6 lines of rc and 5 lines of awk simple,
then yes!

{
	for(i in /proc/*)
		if(! ~ $i /proc/trace)
			echo `{cat $i/noteid}:`{basename $i}
} | sort -t: -n | awk '
# based on squash by jon bentley from programming pearls 1st edition
BEGIN { FS = ":" }
$1 != prev { prev = $1; if(NR > 1) printf "\n"; printf "%d: ", $1 }
{ printf "%d ", $2 }
END { printf "\n" }
'

> Is there anything like pstree in plan9?
Work with the code I gave you and /sys/src/cmd/ps.c.

Pietro




  parent reply	other threads:[~2008-06-20 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 14:03 Rudolf Sykora
2008-06-20 15:50 ` Rudolf Sykora
2008-06-20 19:08   ` a
2008-06-20 19:17     ` erik quanstrom
2008-06-20 19:58   ` Russ Cox
2008-06-20 19:10 ` Pietro Gagliardi [this message]
2008-06-21 12:40   ` Rudolf Sykora

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=F6E99964-C234-499D-B9F0-19532AAECAC0@mac.com \
    --to=pietro10@mac.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).