Xpra: Ticket #411: better debugging and logging tools
See wiki/Debugging
At the moment, we rely on:
- environment variables
-d all
SIGUSR1
/ SIGUSR2
as a big on/off switch for all debug logging
We need environment variables for 2 reasons:
- some logging in the hot paths can be expensive - env vars allow us to turn that off completely
- some logging happens very early on (during class loading), before we even initialize the logging properly
We want:
- more logging granularity, so we can specify strings with "
-d
" apart from the catch all "all
"
- ability to turn logging on or off at runtime without restarting the server
- better logging messages and context
How:
- add ability to modify the server (and maybe the client too?) via a new xpra runtime command? (maybe: "
xpra debug subsystem [on|off]
")
- tune how much detail we get
- potentially get the full calling function and frame details (as per winswitch logging utility)
Fri, 15 Nov 2013 14:14:15 GMT - Antoine Martin: milestone changed
- milestone
changed from 0.11 to 0.12
too late for 0.11
Mon, 20 Jan 2014 11:13:55 GMT - Antoine Martin: owner, status changed
- owner
changed from Antoine Martin to Antoine Martin
- status
changed from new to assigned
Fri, 07 Feb 2014 12:40:13 GMT - Antoine Martin:
First step in r5379 (very large changeset - see commit message), and more in r5381, r5382, r5383
Still left TODO:
- add "
xpra control
" ability to list the loggers we know about
- benchmark it to ensure we haven't made things slower
- look for remaining instances of environment variables used to control logging (x11 bindings probably ok - expensive)
- automatically generate the list of categories: list categories supplied not in default list
Fri, 14 Feb 2014 11:30:51 GMT - Antoine Martin: owner, status changed
- owner
changed from Antoine Martin to Smo
- status
changed from assigned to new
- lots of little fixes and improvements: r5461, r5458, r5457, r5455, r5427, r5403, r5402, r5399, r5398, r5391, r5389, r5386, r5385
- re-add ability (working this time) to exclude categories: r5388 (and also the same feature for X11 events debugging in r5397)
- r5466 restores the code duplication I had removed: the default python logger class is just ridiculously slow, so we shortcut it as soon as possible
I've ran some benchmarks, it looks good after r5466, the wiki has been updated: wiki/Logging.
smo/afarr: I am assigning it to you so you are aware of the new features, feel free to close as an ACK.
It is particularly useful for debugging specific problems *after* starting the server, as one can just run:
xpra control :10 debug enable focus
And to verify:
xpra control :10 debug status
Fri, 07 Mar 2014 00:37:24 GMT - Smo: status changed; resolution set
- status
changed from new to closed
- resolution
set to worksforme
Thanks works well.
sh-4.2$ xpra list
Found the following xpra sessions:
LIVE session at :15
sh-4.2$ xpra control :15 debug status
logging is enabled for: []
sh-4.2$ xpra control :15 debug enable focus
logging enabled for focus
sh-4.2$ xpra control :15 debug status
logging is enabled for: ['Logger(xpra.x11.server, server, focus)', 'Logger(xpra.x11.gtk_x11.send_wm, x11, focus)', 'Logger(xpra.x11.gtk_x11.wm, x11, window, focus)', 'Logger(xpra.x11.gtk_x11.world_window, x11, window, focus)', 'Logger(xpra.server.server_base, focus)', 'Logger(xpra.x11.gtk_x11.window, x11, window, focus)']
sh-4.2$ xpra control :15 debug disable focus
logging disabled for focus
Sat, 23 Jan 2021 04:54:38 GMT - migration script:
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/411