From Fedora Project Wiki

< KDE

Revision as of 09:18, 26 January 2017 by Tuju (talk | contribs) (→‎General)

Some loose, partially undocumented, but useful debugging tips and tricks found here and there in discussions, bug comments etc.

General

Free space running out in home or system's /tmp directories is likely cause problems. KDE will start loosing application configurations etc, very unwanted behaviour so always having some free space is recommended. Likely culprits/locations filling the disk are:

  • $HOME/.local/share/baloo
  • $HOME/.local/share/akonadi

Useful tool for space issues can be found from Program menu -> Utilities -> Filelight

NFS as $HOME directory storage solution might cause problems, there are bugs that hint to that direction but NFS is probably so rarely used among KDE developers. Related bugs:

.xsession-errors

Users $HOME/.xsession-errors is the 'standard output and error' of graphic desktop. Most lines are not prefixed with source nor timestamp so it might be hard to understand from which process they're coming from.

Xorg.0.log

System wide X11 log /var/log/Xorg.0.log contains all base windowing system, graphic hardware, user interface like mouse, keyboard, tablet etc related log and error messages. Especially userful if problems are related to display controller's driver.

xwininfo, xprop

xwininfo -root -tree
xprop _NET_WM_PID

and click the window in question.

xprop can also set process variables, jonisalonen.com - Setting X11 window properties

gam_server

Sometimes it helps to kill the gam_server process to release odd hangups or when applications wont start from panel buttons. Process can be safely killed, it gets respawned automatically, but running processes might not like it. Once killed, all pending start attempts are executed if the gam_server was the culprit. Sending a SIGUSR2 to running gam_server makes it dump its debugging information into /tmp/gamin_debug_*

kill -s SIGUSR2 $(pidof gam_server)

DBUS

DBUS can be followed using dbus-monitor, it can be lousy thou and hard to follow. Wireshark has dissector for dbus these days but it doesn't do that good job on it.

dbus-monitor

Certain processes can be queried during their runtime using qdbus

$ qdbus | grep address
org.kde.kaddressbook

$ qdbus org.kde.kaddressbook
/
/KAddressBook
/kaddressbook
/kaddressbook/MainWindow_1
/kaddressbook/MainWindow_1/actions
.
.
$

adding more options gives more information of running process. Some options allow remote controlling process and triggering its methods.


GDB

$ gdb dolphin
(gdb) set follow-fork-mode child
(gdb) run

KDE4 ()

plasma-desktop

KDE5 (F24, F25)

Two main desktop components, kwin_x11 a window manager and desktop's shell - the plasmashell processes that can both be restarted on running desktop, without need to re-login with new session. If krunner process is working on desktop, using ALT+F2 pops up a small command dialog at the top of screen. All commands can be run through that or in separate konsole window(s), where latter allows folloing their character based output as they run.

Enviroment variables for KDE on Fedora are set system widely in /etc/profile.d/kde.sh - if something needs to be added permanently, that is the right place.


kdebugdialog

kdebugdialog is a gui configuration dialog that is used to switch on/off KDE debugging information. All increased information will be in .xsession-errors file.

--fullmode Show the fully-fledged dialog instead of the default list dialog

kwin_x11

kwin_x11 can be killed or replaced by itself with --replace option. Once its not running, all virtual destkop windows appear at one view. Having a konsole open during replace might be useful. A typical ALT+F2 restart is done in krunner dialog:

kwin_x11 --replace

Some regocnized environment variables:

export KWIN_USE_INTEL_SWAP_EVENT=0 # only affects intel IGPs 
export KWIN_EXPLICIT_SYNC=0 # most likely candidate on nvidia GPUs 
export KWIN_USE_BUFFER_AGE=0 # well, you tried, but hey ... ;-) 

kwin_x11 --replace &


xdotool lets you programatically (or manually) simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11's XTEST extension and other Xlib functions.

For example if screen is locked

xdotool key "XF86LogGrabInfo"

dumbs all device grabs into /var/log/Xorg.0.log file. It can be run from character based consoles by prefixing it with DISPLAY=:0

xdotool selectwindow getwindowpid

followed by click to window returns its process id.

More KWIN debugging tips at KDE: https://community.kde.org/KWin/Debugging

keyboard layouts

kded related entries in kdebugdialog should be activated.

$ setxkbmap -print
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+it:2+inet(evdev)+group(shifts_toggle)"   };
        xkb_geometry  { include "pc(pc101)"     };
};
$ setxkbmap it

sets the layout.

Config files:

/usr/share/kde-settings/kde-profile/default/share/config/kxkbrc
~/.kde/share/config/kxkbrc

plasmashell

plasmashell can killed and restarted during the same session. Some of its plugins are known to leak memory and thus it can grow and cause problems in memory footprint wise during long session. Removing plugins one by one might help to pinpoint the problematic one.

Akonadi

Unlike in KDE4, restarting akonadi service in console doesn't print its std out/errors anymore.

See also

External links