Xmsgtrace: An X11 protocol recorder for the X Window System!
What is Xmsgtrace?
Xmsgtrace (pronounced "X message trace") is a software program that records X Window System protocol messages. X Window
programs (e.g., Gimp, Netscape, Ghostview, Staroffice, etc.) work by exchanging messages with the X server.
Xmsgtrace saves these messages in a log (text) file in a human readable form.
Communication between an X client program and the X server is through the low-level X11 protocol.
All X programs must ultimately use this protocol in order to talk to the X server.
Most X programs make calls to the Xlib library (either directly or indirectly through high level libraries such as
Xt, Motif®, GTK, KDE, etc.) which provides the X11 protocol interface to the X server.
Why Use Xmsgtrace?
Debugging Tool for X.
As its name implies, Xmsgtrace allows you to trace the X message flow of the GUI of a program; whereas,
in a programming language debugger like the GNU GDB
you are tracing the code flow. Looking at the message flow gives a different perspective of how the program is working,
which sometimes makes it easier in tracking down a GUI bug in a program than using the language debugger alone.
- Performance Tool.The bigger and more complex an X program becomes, the greater the chance for the
program to become inefficient by generating unnecessary X protocol. While Xmsgtrace was being developed, we tested it one day on
a popular open source text editor (which shall go nameless) and discovered to our surprise that it was continuously generating
quite a bit of needless
X protocol to the X server while idle! X protocol continually scrolled across the log window of Xmsgtrace. For programs intended to
run across a slow Internet connection this is an important bandwidth issue.
- Learning Tool. Xmsgtrace is an excellent tool for learning how the X Window System protocol works. As you interact with
a client program, you can watch what X protocol messages scroll across the view window of Xmsgtrace.
Sample Log File
If your curious about what kind of output Xmsgtrace records in the log file, look
here; then read about what Xmsgtrace can do in
the Features section.