[wiki] Collecting debug information

This wikis intention is a work-in-progress to provide a handy and up-to-date list on how to collect debugging information (mainly logs). Everyones contributions are welcome!

This is maybe better placed in the sfos docs.

If something like this already exists, please let me know.

The official wiki page is sometimes more up to date: Testing Advice | Sailfish OS Documentation

Basics:

  • Enable developer mode
  • Show failed services: systemctl list-units --failed
  • Collect logs for a specific systemd unit journalctl -u <unitname>
  • Follow actions of out of memory killer: dmesg -w | egrep "lowmemorykiller|oom_reaper|^ {19}.*|Out of memory"
  • collect-logs.zip from Collect Basic Logs
  • Edit journalctl logging settings with devel-su nano /etc/systemd/journald.conf.
    • You can set Storage=Persistent to persist logs accross reboots and write them every SyncIntervalSec to flash storage.
    • RuntimeMaxUse how much to keep in memory before discarding it, or writing it to disc
    • further config settings documented at man journald.conf
  • Make journal logs (more) persistent.
  • Take a snapshot of the latest logs (e.g. for later investigation while you are outside): devel-su journalctl > log-filename.log

Audio

  • systemctl status pulseaudio and journalctl -u pulseaudio

bluetooth

  • systemctl status mpris mpris is responsible for actions (play,pause,…)
  • systemctl status bluetooth and journalctl -u bluetooth
  • is audio device registered in pulseaudio? pactl list sinks

Android

  • systemctl status aliendalvik and journalctl -u aliendalvik

Android apps

  • devel-su lxc-attach -n aliendalvik /system/bin/logcat
  • devel-su appsupport-attach /system/bin/logcat on Sailfish OS 4.5.0 onwards

Android Base system

  • /system/bin/logcat

note that this gives the logs of the base system layer, not Android Support.

EMail

Mobile Data / Calling / sms

the logs may contain your personal data!

  • logs devel-su journalctl -u ofono
  • sms devel-su journalctl --system -f | grep jolla-messages
  • more call related logs journalctl -b | grep -iE '(ofono|voicecall|telepathy)'

Packages

  • get installed package version pkcon get-details <packagename> (without the <>)

Sandboxing/Booster

  • list active boosters: systemctl --user list-units | grep -E 'booster-.*@.*\.service'
13 Likes

Additionally for monitoring low memory behaviour it is good to monitor warnings sent my mce, from here: Mce | Sailfish OS Documentation
You will probably need devel-su pkcon install dbuslog-tools
The current state can be queried via:

dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.get_memory_level

And tracked via:

dbus-monitor --system sender=com.nokia.mce,interface=com.nokia.mce.signal,member=sig_memory_level_ind

Also general useful Linux commands that can be useful here too is just running dmesg -w to see kernel messages, to diagnose boot for example.
And sudo journalctl -b -1 -r is useful to see what happened last boot, for example if phone restarted and we don’t know why.

4 Likes

Thanks for this, good stuff, I added this content also to docs: Testing Advice | Sailfish OS Documentation
all the feedback and comments are welcome so that we can gather needed content there.

2 Likes

Ok, thanks for the feedback, if there are wrong commands etc there need to check and correct those. Naturally concrete correction proposals are welcome.