open-src/xserver/xorg/sun-src/os/solaris/mdb/README
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Sun, 21 Aug 2011 23:17:36 -0700
changeset 1192 60e4ec16e28d
parent 943 294f64612d23
child 1265 0b5cc5c013e4
permissions -rw-r--r--
7081442 Xorg mdb modules can't load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     1
We have created an mdb module and some simple shell script wrappers
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     2
that can be used to retrieve various information from a running X server
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     3
or a X server core dump.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     4
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     5
Currently available information includes:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     6
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     7
 - a list of the clients connected to an X server, including for each one:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     8
	- the sequence number of the last request it sent
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
     9
	- in the case of most local clients, their process id
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    10
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    11
 - a list of the input devices connected to an X server and if any
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    12
	active grabs are applied to them, which client has done so.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    13
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    14
 - if a server grab has been done, the id of the client that has the grab.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    15
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    16
Scripts
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    17
-------
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    18
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    19
The simple shell script wrappers are all delivered in /usr/demo/Xserver/mdb
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    20
All of these scripts can be run on either a running process or a core file.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    21
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    22
To use these scripts on a running Xserver, specify the process id with the
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    23
-p flag, such as "list_Xserver_clients -p 32999".   To use on a core file,
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    24
simply provide the core file as an argument.   (The command line arguments
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    25
are passed through to mdb, see the mdb(1) man page for more details.)
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    26
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    27
To use on a running Xorg server, you will need to run as root, due to the
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    28
restrictions
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    29
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    30
- list_Xserver_clients
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    31
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    32
This can be useful for trying to figure out which client is
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    33
responsible for the reads and writes you see to a certain file
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    34
descriptor in a truss and similar debugging activities. The sequence
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    35
number will basically be a count of the number of requests an X client
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    36
has sent during its lifetime.
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    37
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    38
You will get output like this:
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    39
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    40
max_clients = 1024
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    41
CLIENT SEQUENCE #  FD  PIDS
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    42
    0           0  -1 9719
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    43
    1           8  15  ??? - NULL OsCommPtr->process
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    44
    2           9  16 9721
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    45
    4           8  18  ??? - NULL OsCommPtr->process
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    46
    5          17 ??? - NULL ClientPtr->osPrivate
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    47
    6          14  19 9763
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    48
    7          71  20 9814
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    49
    8          13  21 9819
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    50
    9          17  22 9836
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    51
   10      501747  23 9837
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    52
   11         147  24 9837
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    53
   12          11  25 9837
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    54
   13        9676  26 9843
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    55
   14       38347  27 9843
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    56
   15          11  28 9843
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    57
   16       13251  29 9846 9857 9861 9871
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    58
   18        5299  31 9847 9891 9894 9900 9904 9922
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    59
   19        2397  32 9879
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    60
   21          11  34 9879
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    61
   23    34389507  36 9885
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    62
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    63
1342  /usr/dt/bin/dtlogin -daemon
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    64
  9719  /usr/X11/bin/Xorg :0 -depth 24 -nobanner -auth /var/dt/A:0-epayvc
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    65
  9721  /usr/openwin/bin/fbconsole -d :0
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    66
  9720  /usr/dt/bin/dtlogin -daemon
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    67
    9741  /bin/ksh /usr/dt/bin/Xsession
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    68
      9819  /usr/dt/bin/sdt_shell -c unsetenv _ PWD;             unsetenv DT;
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    69
        9821  -csh -c unsetenv _ PWD;             unsetenv DT;      setenv DISP
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    70
          9837  /usr/dt/bin/dtsession
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    71
            9843  dtwm
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    72
            9846  /usr/dt/bin/dtterm -session dtb2aitb -C -ls
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    73
              9857  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    74
              9861  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    75
              9871  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    76
            9847  /usr/dt/bin/dtterm -session dtP2aqtb -C -ls
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    77
              9891  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    78
              9894  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    79
              9900  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    80
              9904  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    81
              9922  -csh
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    82
            9879  dtfile -session dtqRaOFb
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    83
              9949  dtfile -session dtqRaOFb
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    84
            9885  sdtperfmeter -f -H -t cpu -t disk -s 1 -name fpperfmeter
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    85
9836  /usr/dt/bin/ttsession
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    86
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    87
The output at the end comes from ptree. From this example we can see
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    88
the busiest client in this CDE session has been sdtperfmeter since it
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    89
has sent 34389507 X requests in order to update the performance meter
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    90
once a second. (This session was running for 6 days before this output
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    91
was taken.)
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    92
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    93
- list_Xserver_devicegrab_client
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    94
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    95
This lists all the input devices known to the Xserver and if they have
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    96
been grabbed by any clients, which client holds an active grab.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    97
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    98
For instance, on a machine where the xterm "Secure Keyboard" menu item
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    99
was chosen to grab the keyboard:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   100
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   101
 # list_Xserver_devicegrab_client -p 6072
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   102
  Device "Virtual core pointer" id 2:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   103
    -- no active grab on device
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   104
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   105
  Device "Virtual core keyboard" id 3:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   106
    -- active grab 5e00000 by client 47
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   107
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   108
  Device "Virtual core XTEST pointer" id 4:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   109
    -- no active grab on device
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   110
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   111
  Device "Virtual core XTEST keyboard" id 5:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   112
    -- no active grab on device
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   113
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   114
  Device "mouse" id 6:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   115
    -- no active grab on device
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   116
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   117
  Device "hotkey" id 7:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   118
    -- no active grab on device
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   119
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   120
  Device "keyboard" id 8:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   121
    -- no active grab on device
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   122
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   123
You can then use list_Xserver_clients to find out what client 47 is:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   124
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   125
  CLIENT SEQUENCE #  FD  PIDS
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   126
   [...]
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   127
     47        3378  78 8936
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   128
   [...]
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   129
      8936  xterm
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   130
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   131
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   132
- list_Xserver_servergrab_client
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   133
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   134
This script checks a variable in the X server to determine if a server
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   135
grab has been done, and if so which client has done it.
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   136
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   137
Debugging with mdb
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   138
------------------
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   139
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   140
The mdb module can also be used directly in an mdb debugging session
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   141
on either a live server or a core file.  The module is delivered in
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   142
/usr/lib/mdb/proc as Xorg.so, Xvfb.so, Xephyr.so and Xvnc.so so that
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   143
it should be automatically loaded when mdb attaches to a process or
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   144
core of any of those programs.
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   145
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   146
Two sets of dcmds are provided, each with a "walker" which simply
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   147
iterates over the entries in the X server internal tables, and a
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   148
command that prints the information for each entry.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   149
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   150
The commands currently provided are:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   151
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   152
	::client_pids - prints information about a ClientRec entry
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   153
	   in the X server's array of currently connected X clients.
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   154
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   155
	::inputdev_grabs - prints information about a DeviceIntRec entry
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   156
	   in the X server's list of currently connected input devices.
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   157
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   158
The walkers to iterate over the lists of these structures in the X server are:
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   159
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   160
	::client_walk - walks the array of ClientRec entries stored in the
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   161
		global array "clients", from 0 to the value of the global
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   162
		variable "currentMaxClients"
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   163
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   164
	::inputdev_walk - walks the linked list of DeviceIntRec entries
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   165
		starting at the entry stored in the global variable "InputInfo"
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   166
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   167
You can run them like this:
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   168
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   169
# mdb -p 9719
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   170
Loading modules: [ Xorg ld.so.1 libc.so.1 libproc.so.1 libnvpair.so.1 libuutil.so.1 libavl.so.1 libsysevent.so.1 ]
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   171
> ::walk client_walk
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   172
max_clients = 1024
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   173
1b7db8
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   174
1b7dbc
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   175
1b7dc0
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   176
[...]
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   177
> 1b7dc0  ::client_pids
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   178
CLIENT SEQUENCE #  FD  PIDS
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   179
    2           9  16 9721
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   180
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   181
If you run one of the commands (such as ::client_pids) without an address in
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   182
front, it will automatically call the associated walker to list the
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   183
information for all the entries in the list.
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   184
1192
60e4ec16e28d 7081442 Xorg mdb modules can't load
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
   185
For more information about using mdb, see the Solaris Modular Debugger Guide
60e4ec16e28d 7081442 Xorg mdb modules can't load
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
   186
on http://www.oracle.com/technetwork/indexes/documentation/index.html and 
60e4ec16e28d 7081442 Xorg mdb modules can't load
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
   187
the mdb OpenSolaris Community website at
908
ee1047befc15 6928167 Integrate X server mdb module into xorg-server build & packages
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   188
http://hub.opensolaris.org/bin/view/Community+Group+mdb/
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   189
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   190
=============================================================================
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   191
1192
60e4ec16e28d 7081442 Xorg mdb modules can't load
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
   192
Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   193
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   194
Permission is hereby granted, free of charge, to any person obtaining a
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   195
copy of this software and associated documentation files (the "Software"),
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   196
to deal in the Software without restriction, including without limitation
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   197
the rights to use, copy, modify, merge, publish, distribute, sublicense,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   198
and/or sell copies of the Software, and to permit persons to whom the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   199
Software is furnished to do so, subject to the following conditions:
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   200
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   201
The above copyright notice and this permission notice (including the next
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   202
paragraph) shall be included in all copies or substantial portions of the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   203
Software.
492
abfa40ff15ef 6735204 Port Xsun mdb dcmds/scripts to Xorg and move to open-src tree
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   204
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   205
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   206
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   207
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   208
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   209
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   210
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 908
diff changeset
   211
DEALINGS IN THE SOFTWARE.