9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@gmx.de
To: 9fans@9fans.net
Subject: Re: [9fans] some pcc questions
Date: Fri, 20 Apr 2012 18:29:54 +0200	[thread overview]
Message-ID: <83a74d7736328ba9958f705deb447d5c@rei2.9hal> (raw)
In-Reply-To: <432d773181a969cc40ac1f0552204f64@rei2.9hal>

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

that attachment didnt quite work, lets try it this way :)

--
cinap

[-- Attachment #2: tap --]
[-- Type: text/plain, Size: 691 bytes --]

#!/bin/rc

v=()

fn otherqid {
	x=`{echo $1 | sed 's/[12]$//'}
	switch($1){
	case $x^1
		echo $x^2
	case $x^2
		echo $x^1
	}
}

fn traceqid {
	while(! ~ $#* 0){
		echo '['$2']' $3 $1
		tracepid `{grep -n `{otherqid $1} /proc/*/fd | sed 's!^/proc/([^/]+)/.*!\1!g'} \
			| sed 's/^/	/g'
		shift
		shift
		shift
	}
}

fn tracepid {
	while(! ~ $#* 0){
		echo $1 `{cat /proc/$1/args >[2]/dev/null}
		switch($1){
		case $v
			echo '	...'
		case *
			v=($1 $v)
			traceqid `{awk '/\|/{q=substr($5,2);print q" "$1" "$10}' /proc/$1/fd} \
				| sed 's/^/	/g'
		}
		shift
	}
}

if(~ $#* 0){
	echo 'Usage: ' $0 '[ pid ... ]' >[1=2]
	exit usage
}

tracepid $*

  reply	other threads:[~2012-04-20 16:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 16:01 Jens Staal
2012-04-20 16:24 ` cinap_lenrek
2012-04-20 16:29   ` cinap_lenrek [this message]
2012-04-20 17:31   ` Charles Forsyth
2012-04-23  6:30 ` Jens Staal
2012-04-23 13:23   ` Comeau At9Fans
2012-04-23 13:19 ` Comeau At9Fans
     [not found] ` <CAE9W7-gU72RNgbs6Pcuxp5KEtXBUsApZNGzNiEpvTgLtbL7wjw@mail.gmail.c>
2012-04-23 13:42   ` erik quanstrom
2012-04-23 14:37     ` Bakul Shah

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=83a74d7736328ba9958f705deb447d5c@rei2.9hal \
    --to=cinap_lenrek@gmx.de \
    --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).