diff options
author | B. Watson <urchlay@slackware.uk> | 2023-01-03 03:04:10 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-01-07 08:13:42 +0700 |
commit | 0db11e86e5589d57192a1b686d08d61f2c65e134 (patch) | |
tree | 4c84375045d8dadd955dd823b3aa60fc73662d0f /development/xtruss | |
parent | fdfb81a718b0170e9e33508b9ad096d046fbeef5 (diff) |
development/xtruss: Updated for version 20211025.c25bf48.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/xtruss')
-rw-r--r-- | development/xtruss/xtruss.1 | 98 | ||||
-rw-r--r-- | development/xtruss/xtruss.SlackBuild | 41 | ||||
-rw-r--r-- | development/xtruss/xtruss.info | 6 |
3 files changed, 124 insertions, 21 deletions
diff --git a/development/xtruss/xtruss.1 b/development/xtruss/xtruss.1 new file mode 100644 index 0000000000000..5166722e9cf58 --- /dev/null +++ b/development/xtruss/xtruss.1 @@ -0,0 +1,98 @@ +.\" xtruss version 20211025.c25bf48 +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH "xtruss" "1" "2009\(hy05\(hy02" "PuTTY\ spinoffs" "PuTTY\ spinoffs" +.SH "NAME" +.PP +\fBxtruss\fP - trace X protocol exchanges, in the manner of \fBstrace\fP +.SH "SYNOPSIS" +.PP +.nf +\fBxtruss\fP\ [\ \fIoptions\fP\ ]\ \fIcommand\fP\ [\ \fIcommand\-arguments\fP\ ] +\fBxtruss\fP\ [\ \fIoptions\fP\ ]\ \fB\-p\fP\ \fIX\-resource\-ID\fP +\fBxtruss\fP\ [\ \fIoptions\fP\ ]\ \fB\-p\fP\ \fB\-\fP +\fBxtruss\fP\ [\ \fIoptions\fP\ ]\ \fB\-P\fP +.fi +.SH "DESCRIPTION" +.PP +\fBxtruss\fP is a utility which logs everything that passes between the X server and one or more X client programs. In this it is similar to \fBxmon\fP(1), but intended to combine \fBxmon\fP\*(Aqs basic functionality with an interface much more similar to \fBstrace\fP(1). +.PP +Like \fBxmon\fP, \fBxtruss\fP in its default mode works by setting up a proxy X server, waiting for connections to that, and forwarding them on to the real X server. However, unlike \fBxmon\fP, you don\*(Aqt have to deal with any of that by hand: there\*(Aqs no need to start the trace utility in one terminal and manually attach processes to it from another, unless you really want to (in which case the \fB-P\fP option will do that). The principal mode of use is just to type \fBxtruss\fP followed by the command line of your X program; \fBxtruss\fP will automatically take care of adjusting the new program\*(Aqs environment to point at its proxy server, and (also unlike \fBxmon\fP) it will also take care of X authorisation automatically. +.PP +As an alternative mode of use, you can also attach \fBxtruss\fP to an already-running X application, if you didn\*(Aqt realise you were going to want to trace it until it had already been started. This mode requires cooperation from the X server - specifically, it can\*(Aqt work unless the server supports the \fBRECORD\fP protocol extension - but since modern X.Org servers do provide that, it\*(Aqs often useful. +.PP +The logging format of \fBxtruss\fP is much more compact than that of \fBxmon\fP, and resembles \fBstrace\fP in that it\*(Aqs written to look like a series of function calls some of which return values. For instance, where \fBxmon\fP would print +.PP +.nf +\ \ \ \ \ \ \ \ \ ............REQUEST:\ GetSelectionOwner +\ \ \ \ \ \ \ \ \ \ \ \ \ sequence\ number:\ 000f +\ \ \ \ \ \ \ \ \ \ \ \ \ \ request\ length:\ 0002 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ selection:\ <PRIMARY> +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ..............REPLY:\ GetSelectionOwner +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sequence\ number:\ 000f +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reply\ length:\ 00000000 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ owner:\ WIN\ 02c0002b +\ \ \ \ \ \ \ \ \ ............REQUEST:\ InternAtom +\ \ \ \ \ \ \ \ \ \ \ \ \ sequence\ number:\ 0010 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ only\-if\-exists:\ False +\ \ \ \ \ \ \ \ \ \ \ \ \ \ request\ length:\ 0005 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ of\ name:\ 000c +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ name:\ "VT_SELECTION" +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ..............REPLY:\ InternAtom +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sequence\ number:\ 0010 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reply\ length:\ 00000000 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ atom:\ ATM\ 000002bf +.fi +.PP +\fBxtruss\fP will instead print +.PP +.nf +GetSelectionOwner(selection=a#1)\ =\ {owner=w#02C0002B} +InternAtom(name="VT_SELECTION",\ only\-if\-exists=False)\ =\ {atom=a#703} +.fi +.PP +Note that not only has each request been condensed on to one line (though most lines will be long enough to wrap, at least on a standard 80-column terminal), but also each request and reply have been printed on the \fIsame\fP line. +.PP +That last is not always possible, of course: sometimes an application will queue multiple requests before receiving the reply to the first one (in fact, this is generally good behaviour since it minimises network round-trip delays), in which case \fBxtruss\fP\*(Aqs output will look - again mimicking \fBstrace\fP - something like this: +.PP +.nf +InternAtom(name="TARGETS",\ only\-if\-exists=False)\ =\ <unfinished> +InternAtom(name="TIMESTAMP",\ only\-if\-exists=False)\ =\ <unfinished> +\ ...\ InternAtom(name="TARGETS",\ only\-if\-exists=False)\ =\ {atom=a#378} +\ ...\ InternAtom(name="TIMESTAMP",\ only\-if\-exists=False)\ =\ {atom=a#379} +.fi +.SH "OPTIONS" +.PP +These options change the mode of operation of \fBxtruss\fP away from the default of acting as a wrapper on a single command: +.IP "\fB-p\fP \fIresource-ID\fP" +Attach to the X client owning the given resource, using the X \fBRECORD\fP extension (which the server must support for this to work). The resource ID can be a decimal integer or a hex integer preceded with `\fB0x\fP'. It typically names an X window, but can name another type of resource instead (e.g. a pixmap or cursor) or just specify the resource base of the client connection. If you don\*(Aqt know any of those things, you can give the resource ID as just `\fB-\fP', in which case \fBxtruss\fP will allow you to interactively select a window by clicking with the mouse (similarly to \fBxkill\fP(1), \fBxwininfo\fP(1) and \fBxprop\fP(1)) and will trace the client that owns the window you select. +.IP "\fB-P\fP" +Set up a logging X proxy as in the normal mode, but instead of spawning a subprocess to connect to that proxy, just wait for connections. This turns \fBxtruss\fP into a tool more similar to \fBxmon\fP: you start it in one terminal window, and then from another terminal window you can configure selected processes to connect to the proxy server and be logged. \fBxtruss\fP will print on standard output the environment variables you need to set up to connect other processes to the proxy (in both \fBsh\fP and \fBcsh\fP syntax). +.PP +The following options apply to all modes of operation: +.IP "\fB-s\fP \fIlength\fP" +Limit the length of output lines by eliding most of the contents of long arrays, strings and blocks of data. \fBxtruss\fP will begin to shorten lines at the specified length (any line shorter than that should not be interfered with), but lines cannot always be chopped to the exact length and continue to make sense, so the line length is approximate only. Specifying zero or `\fBunlimited\fP' will remove all restriction, so that \fBxtruss\fP will display the full contents of every request it understands, no matter how big. Default is 256. +.IP "\fB-o\fP \fIfilename\fP" +Send the trace output to the specified file, or to standard output if \fIfilename\fP is just `\fB-\fP'. The default is to log to standard error. +.IP "\fB-e\fP [\fIclass\fP\fB=\fP][\fB!\fP]\fIitem\fP[\fB,\fP\fIitem\fP...]" +Specify a subset of X requests or X events to log. \fIclass\fP can be either `\fBrequests\fP' or `\fBevents\fP'; if the class is omitted, `\fBrequests\fP' is assumed. The list of \fIitem\fP gives a list of X request names or X event names (respectively) to be logged; all other requests or events are omitted. If the list of items is prefixed with \fB!\fP, it is instead treated as a list of requests or events \fInot\fP to be logged, and anything not in the list is printed. Reply and error packets are not separately filtered: they are logged if and only if the request they respond to was logged. +.RS +.PP +For example, to log only \fBImageText8\fP and \fBImageText16\fP requests, you might say `\fBxtruss -e requests=ImageText8,ImageText16\fP \fIcommand\fP' or just `\fBxtruss -e ImageText8,ImageText16\fP \fIcommand\fP'. To inhibit the display of \fBFocusIn\fP and \fBFocusOut\fP events, you might say `\fBxtruss -e events=!FocusIn,FocusOut\fP \fIcommand\fP'. +.PP +(Note that the \fB!\fP character might be treated specially by your shell, so you may need to escape it.) +.RE +.IP "\fB-I\fP" +Log the initialisation message sent by the X server at the start of the connection. This is omitted by default because it's particularly long and ugly. +.IP "\fB-R\fP" +As well as translating the X protocol, also give a raw hex dump of all the data transferred over the connection. (Probably most useful to include in a bug report about \fBxtruss\fP itself!) +.IP "\fB-C\fP" +Prefix every output line with the X client id (resource base) of the client connection it came from. By default \fBxtruss\fP only starts to do this if it\*(Aqs tracing more than one X client; before then, lines are unprefixed. This option makes prefixing unconditional from the start of the run. +.SH "BUGS" +.PP +Many commonly used X protocol extensions are not currently decoded. +.PP +A lot of this program has been only minimally tested. +.SH "LICENCE" +.PP +\fBxtruss\fP is free software, distributed under the MIT/X11 licence. Type \fBxtruss --licence\fP to see the full licence text. diff --git a/development/xtruss/xtruss.SlackBuild b/development/xtruss/xtruss.SlackBuild index f3ed5bd231d6d..ec340a3f36c0a 100644 --- a/development/xtruss/xtruss.SlackBuild +++ b/development/xtruss/xtruss.SlackBuild @@ -7,8 +7,10 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. -# 20210907 bkw: -# - update for v20210225.2addd50 +# 20230103 bkw: update for v20211025.c25bf48. can't build older versions +# as upstream has switched to cmake. + +# 20210907 bkw: update for v20210225.2addd50 # 20201102 bkw: # - update for v20200918.a94a153 @@ -18,7 +20,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=xtruss -VERSION=${VERSION:-20210225.2addd50} +VERSION=${VERSION:-20211025.c25bf48} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,6 +42,7 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +# Note: upstream default adds -O3 after our flags :( if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -66,21 +69,23 @@ chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --build=$ARCH-slackware-linux - -make -make install-strip DESTDIR=$PKG - -gzip $PKG/usr/man/man?/*.? +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release .. + make VERBOSE=1 + make install/strip DESTDIR=$PKG +cd .. + +# 20230103 bkw: to avoid having halibut as a dependency, use a +# prebuilt man page. +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +# in case halibut actually is installed (nothing in /usr/share but man/) +rm -rf $PKG/usr/share mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENCE README $PKG/usr/doc/$PRGNAM-$VERSION diff --git a/development/xtruss/xtruss.info b/development/xtruss/xtruss.info index f5cf2f4a3fd15..7a3085abe06b2 100644 --- a/development/xtruss/xtruss.info +++ b/development/xtruss/xtruss.info @@ -1,8 +1,8 @@ PRGNAM="xtruss" -VERSION="20210225.2addd50" +VERSION="20211025.c25bf48" HOMEPAGE="https://www.chiark.greenend.org.uk/~sgtatham/xtruss/" -DOWNLOAD="https://slackware.uk/~urchlay/src/xtruss-20210225.2addd50.tar.gz" -MD5SUM="e8352df70de5b1938fa90ba6bb7e2ad2" +DOWNLOAD="https://slackware.uk/~urchlay/src/xtruss-20211025.c25bf48.tar.gz" +MD5SUM="fbfa31a93f14c47d0f584e8e937e9a66" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" |