Re: Window -> PID
From: Alan Coopersmith (alanc_at_alum.calberkeley.org)
Date: 11/23/05
- Next message: codehead: "Solaris 10 Won't Boot After a halt, power off"
- Previous message: Roger P. Johnson: "Re: su problems"
- In reply to: bunka.munka_at_email.si: "Re: Window -> PID"
- Next in thread: Logan Shaw: "Re: Window -> PID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Nov 2005 00:37:35 +0000 (UTC)
<bunka.munka@email.si> writes in comp.unix.solaris:
|In article <dlqtg9$ql$2@agate.berkeley.edu>, alanc@alum.calberkeley.org
|says...
|> <bunka.munka@yahoo.com> writes in comp.unix.solaris:
|> |Sometimes, I have an application running in Window and want to
|> |know the PID. Is there a way I can get it somehow digging into
|> |structures, if I know the Window ID (obtained by xwininfo) ?
|>
|> Not really easily. (On most OS'es, it's a flat out no - on Solaris,
|> with Xsun, the X server knows the pid for each client in order to do the
|> IA process priority manipulations, so you can dig it out with debugger
|> magic, but that's not something you'ld want to include in a script or
|> program (though I have).)
|>
|> The best way to do this would be get the applications you care about
|> to set the _NET_WM_PID property - see the Extended WM spec at:
|> http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#id2511832
|>
|>
|I am familiar with the most kernel structures (actually i am digging
|with adb into crash files many times), but didn't find any appropriate.
|
|Application are 3rd party, all runs on a host itself. They're very
|complex (about 400-500 java processes).
|Most of the time i am successfull finding one (with truss -p <assume
|pid> and moving mouse over that window produce a massive
|lwp_mutexes...), but I am pretty sure XServer has that structure
|somewhere, if not in their temporary files, it must have some kernel
|process window tree...
As I said, the X servers on Solaris do have that in memory, but there's
no way to get it out other than via poking in the X server process
memory with a debugger or similar tool. It's in the user-space process,
not the kernel, and you'ld need the X server structure definitions from
the source code, since they're not in header files shipped with the
system.
-- Alan Coopersmith * alanc@alum.calberkeley.org * Alan.Coopersmith@Sun.COM http://blogs.sun.com/alanc/ * http://people.freedesktop.org/~alanc/ http://del.icio.us/alanc/ * http://www.csua.berkeley.edu/~alanc/ Working for, but definitely not speaking for, Sun Microsystems, Inc.
- Next message: codehead: "Solaris 10 Won't Boot After a halt, power off"
- Previous message: Roger P. Johnson: "Re: su problems"
- In reply to: bunka.munka_at_email.si: "Re: Window -> PID"
- Next in thread: Logan Shaw: "Re: Window -> PID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|