Re: Fwd: [Xpert]New extension for keeping track of client resources



On 6 Mar 2002, Havoc Pennington wrote:

> jg pa dec com (Jim Gettys) writes:
> > For those of you willing to build out of XFree86's CVS, a new tool
> > that will get you resource usage out of the X server.  We should have
> > done this in 1988.  Sigh...
> 
> This is great!
> 
> If any X hackers are taking feature requests, it'd be great to get the 
> IDs of each resource. If we could get the Window/Pixmap IDs, 
> we could for example:

  For each client you get passed a mask and a base such that if

    XID & ~mask == base

  then the XID belongs to your client.  So for now you can see
which windows belong to which clients if you query the tree.  If 
you run xwininfo on your client's window you'll see that it's your 
base plus some number.

   There's no way to get Pixmap IDs, but I'm not sure that's 
useful as there's not anything you could do with them.  You already
know it belongs to your client and the ID doesn't give you any
more information.

> 
>  a) find out how large the pixmaps are and display total 
>     pixels used by each client


   I'm not sure a pixmap querying function is appropriate for
this extension.  A "total" pixmap area per client might be useful 
for assigning blame, however.  In order to be useful it would
probably need to be in bytes rather than pixels.  That number
is easy to attain in the SI and XFree86, but some of these end
up in video ram and aren't actually taking up any system ram. 

> 
>  b) map from Window->PID using the _NET_WM_PID hint, and display X
>     resource usage for processes in gnome-system-monitor right next to
>     CPU/mem usage

   I'm not sure how to equate PIDs with X-server connections (clients).
I don't think the X-server knows this.  Maybe an OS specific client
could do this though.


				Mark.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]