XTRACE(1)

๐Ÿ’– XTRACE ๐Ÿ’–

okay bestie, settle in, because xtrace is that girl. it's a lil program (a manual page in section 1, so it's a user command, iykyk) that traces communication between an X11 client and server. yes, like, wiretap but make it cute and for X11. โœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

xtrace [ options ] [ -s | -k ] [ [ -W ] [ -- ] command args ...

like, options first, then you pick -s or -k, then optionally -W, then optionally --, then whatever command you want it to run. simple as. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So here's the whole vibe: xtrace fakes an X server and then forwards all connections to a real X server, showing you the communication between the clients in (and this is the original's own words, not mine) well, theoretically human readable form. it's giving translator but for X11 gossip. ๐Ÿ™ˆ

if you hand it a command, xtrace runs that named command with $DISPLAY set to the faked X server. slay. but heads up: if that command exits before any connections are made, xtrace exits immediately โ€” unless you passed -W. that's the whole rule, no cap. โœจ


โœจ OPTIONS โœจ

  • -I directory โ€” look into directory for protocol description files. like, the directory where the .proto files can be found. ๐ŸŽ€
  • -s, --stopwhendone (this one's the default) โ€” terminate when all forwarded clients have disconnected. (or, if a program was run, once the program has finished and all connections are closed.) ๐Ÿ’ค
  • -k, --keeprunning โ€” if all clients disconnected, don't dip, just wait for new ones to connect. ๐Ÿ‘€
  • -W, --waitforclient โ€” do not stop when the started program terminates before any connection was made. might be necessary if the program forks to background, fr fr. ๐Ÿงš
  • -d name, --display name โ€” forward connections to the X server specified by name instead of the one specified by the environment variable DISPLAY.
  • -D name, --fakedisplay name โ€” fake display name instead of $FAKEDISPLAY or :9 respectively. ๐ŸŽญ
  • -f filename, --authfile filename โ€” add an -f filename to the arguments for all calls to xauth to get the authentication tokens of the X server to connect to.
  • -F filename, --newauthfile filename โ€” add an -f filename to the arguments for all calls to xauth to save the authentication tokens to connect to the faked X server.
  • -c, --copyauthentication (default, bestie, this is the default) โ€” copy the authentication tokens for the X server to connect to, so that clients connecting to our fake server will use them. ๐Ÿ’–

the commands run are roughly equivalent to:

xauth add $FAKEDISPLAY . `xauth list $DISPLAY | awk '$2=="MIT-MAGIC-COOKIE-1" {print $3}'`

and not that only MIT-MAGIC-COOKIE-1 tokens are copied, because xtrace does not yet support changing the authentication tokens so that XDM-AUTHORIZATION-1 would be possible. so that's a limit, not a vibe. ๐Ÿ˜ญ

  • -n, --nocopyauthentication โ€” do not call xauth and do fiddle with authentication tokens, but leave that to the user to handle. you're on your own, main character. ๐Ÿ‘‘
  • -e, --denyextensions โ€” modify all server replies to say there are no extensions available. (as xtrace supports only a small number of extensions anyway, and calls all extended requests unknown and all replies to such requests unexpected.) ๐Ÿ’€
  • -w, --readwritedebug โ€” print how many bytes are read and/or written, and when. ๐Ÿ”
  • -m count, --maxklistlength count โ€” print only the first count many elements of all lists.
  • -i, --interactive โ€” only send requests from the client to the server after interactive confirmation. confirmation is given by pressing enter, or a number followed by enter, via stdin. this can give funny results when multiple clients are tunneled. ๐Ÿ™ˆ
  • -o, --outfile filename โ€” dump output into filename instead of stdout. ๐Ÿ“
  • -b, --buffered โ€” do not write every line on its own, but wait until buffers are full. speeds up things a little bit when outputting to a file. not very useful at all together with -i. โšก
  • --timestamps โ€” print a timestamp before each line.

note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. โฐ

  • --relative-timestamps โ€” print a timestamp relative to the beginning of the connection before each line.

note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. โฑ๏ธ

  • --monotonic-timestamps โ€” print a CLOCK_MONOTONIC (see clock_gettime(3)) timestamp each time a package is printed. this is likely to be the uptime of your system.

note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. ๐Ÿ•ฐ๏ธ

  • --print-offsets โ€” print offsets of all fields (useful to debug nested lists in protocol descriptions). ๐Ÿง
  • --print-counts โ€” print counts (useful to debug lists in protocol descriptions). ๐Ÿ”ข

๐ŸŒˆ ENVIRONMENT VARIABLES ๐ŸŒˆ

  • DISPLAY โ€” without --display, the content of this variable is used to determine the server to connect to. (and without -n, it's given to xauth to get the authentication tokens for this display.) ๐ŸŒ
  • FAKEDISPLAY โ€” without --fakedisplay, the content of this variable is used to determine how to listen for clients. (and without -n, it's given to xauth to set the authentication tokens for this display.) if neither is given, xtrace will try :9. ๐ŸŽ€
  • XAUTHORITY โ€” without -n and without -f or -F, your xauth program will most likely look into this variable for the file to get/save the authentication tokens from/into. if this is not set, it will most likely use $HOME/.Xauthority. ๐Ÿ—‚๏ธ

๐Ÿ˜ค REPORTING BUGS ๐Ÿ˜ค

Report bugs to the Debian BTS. (that's it, that's the whole section, go off.) ๐Ÿ“ฎ


๐Ÿซถ SEE ALSO ๐Ÿซถ

xauth(1), x(7x)


Copyright ยฉ 2005 Bernhard R. Link

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿšจ


bestie reminder: no warranty, not even for merchantability or fitness for a particular purpose. that's not me being dramatic, that's literally the license. periodt. ๐Ÿ’…

and that's the whole page, gorgeous โ€” this one's from the xtrace manual, dated 26 June 2009, section XTRACE(1). now go trace something. ๐Ÿฆ‹โœจ๐ŸŽ€