tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Joining PIDs to in_pcb structs & TCP/IP sockets in kernel debug..
@ 1996-07-15  7:55 Franxosaurus Rex
  0 siblings, 0 replies; only message in thread
From: Franxosaurus Rex @ 1996-07-15  7:55 UTC (permalink / raw)
  To: tru64-unix-managers

Hi,

I have already posted this request on UNIX-WIZ@LISTSERV.NODAK.EDU;
Nathan.Bailey@cc.monash.edu.au suggested I try the query here, please
disregard if you have already read it...

I am currently migrating from DEC RISC ULTRIX to Alpha. One thing that
was useful (for killing runaway ORACLE RDBMS SQL queries using the IP
address of the PC that started the query, etc.) was to be able to find a
process ID for a given TCP/IP socket, ie.:

1. Do a "netstat -A" to bring up the "Active PCB" column.
2. In kernel debug, do a "inpcb -tcp", cut the socket and pcb columns.
3. Then from a set of PIDs, foreach PID dump the Process Control Block
struct slots using "pcb #${PID}".
4. Join the pcb address to the socket address, retaining IP info from
the netstat.
5. grep the Process Control Block struct slots for the process that has
the socket address in its File Descriptor Table.

This works under ULTRIX (ie. 4.3 BSD) using the "crash /dev/mem /vmunix"
system dump analyser command.

The problem is, when I tried replacing the command with "kdbx -k /vmunix
/dev/mem" for the Digital UNIX (ie. Carnegie-Mellon???) version in the
script I was porting, trying to get the I get something like the
following (where 1311 is the PID of a running process):

(kdbx) pcb #1311
Addr pcb        ksp             usp             pc
ps
field .stack->pcb: Can't dereference a NULL pointer
(kdbx) 

Can anybody point me back in the right direction, or has a more elegant
or efficient way of doing the same thing???

dan@siac.com wrote:

>Try using lsof, it can give info on open files and sockets.
>at coast.cs.purdue.edu:/pub/Purdue/lsof

Does anyone know how to access this via email, because the my work
environment has all these firewalls, etc. *yucko* :-/

TIA,

FRANK GALLACHER.

--Frank Gallacher,Systems Programmer,(aka. Franxosaurus Rex)	
 Systems D&I, Operator Assisted Services, Telecom Australia (Telstra).	
 8/360 Elizabeth Street, MELBOURNE VIC 3000 AUSTRALIA.			
 									
 phone:	(03) 969 34034          Int.: +61 3 969 34034			
 fax:	(03) 969 34127          Int.: +61 3 969 34127			
 snail:	Locked Bag 5763, MELBOURNE VIC 8100 AUSTRALIA			
 smtp:	franx@oas.telecom.com.au FGallach@VENTNOAS.telecom.com.au	
 X.400:	(C:AU,A:TELEMEMO,P:telecom012,O:TELECOM,OU:VENTNOAS,SN:FGallach)
 									
 	It is a capital mistake to theorize before one has data.	
 									
 		(Sherlock Holmes, 'A Sign of Four', A. Conan-Doyle)	
 									
 <<<<<<<< MESSAGE ENDS >>>>>>>>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-07-15  7:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-07-15  7:55 Joining PIDs to in_pcb structs & TCP/IP sockets in kernel debug Franxosaurus Rex

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox