vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| <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-...html#id2511832 -- 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. |
| |||
| bunka.munka@yahoo.com wrote: > 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) ? Who says the application is running on the local host? Who says it's even running on an operating system that has the notion of processes in the first place? All you really know is that it's something which is interacting with the X server. - Logan |
| |||
| <bunka.munka@yahoo.com> <bunka.munka@yahoo.com> wrote: > 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) ? How does xkill do that kind of stuff? lg, Bernd -- When emailing me, excuse my annoying spamfilter - it works for me. |
| |||
| Bernd Haug wrote: > <bunka.munka@yahoo.com> <bunka.munka@yahoo.com> wrote: >>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) ? > How does xkill do that kind of stuff? I always assumed it tells the X server to kill the window. The X server then kills the window and breaks the client's connection. The client then exits when it senses it has lost the connection to the X server. I may not have the details right, but the point is that as I understand it, the client chooses to exit because it realizes its connection to the X server has been lost. - Logan |
| |||
| Bernd Haug <haug@berndhaug.net> writes in comp.unix.solaris: |<bunka.munka@yahoo.com> <bunka.munka@yahoo.com> wrote: |> 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) ? | |How does xkill do that kind of stuff? It doesn't - it tells the X server to close the connection to the client, which causes many clients, but not all, to exit. -- 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. |
| |||
| 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-...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... thx anyway |
| ||||
| <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-...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. |