Posts in category debug

LTRACE enhancement in the daemon

Starting from now, the only thing you've got to do to enable LTRACE is to set the environment variable. If the daemon finds it at start, it will refork itself with the appropriate options to enable it.

The LTRACE status is maintained while restarting from inside the daemon (this was not as easy as it seems to implement).

Bonus: just export LTRACE=std to get a nice but not so verbose LTRACE output, you will notice that the only places where the daemon hands on stop/restart are justified (__unihibit_udisks() and PyroFinder queue not empty). In this case, just wait. The udisks thing can take up to 10 secs, and the PyroFinder one, up to 20 secs (i'm searching how to lower this one, the Pyro timeout is already set to 5 secs).

Better trace customization

Starting from now, ltrace understands binary exclusions. You can debug the daemon and CLI tools with better cherry-picking of trace messages:

export LICORN_TRACE='core^configuration^groups'
sudo python /usr/sbin/licornd -vD

This will trace everything in the core, except configuration and groups messages.

Binary inclusions still work, and you can combine the two:

export LICORN_TRACE='foundations^base^objects|core^configuration^groups'
sudo python /usr/sbin/licornd -vD

Which will debug same level of core, but added foundations, without base and objects modules (which are very verbose and very low-level).

NOTE: the order matters when you write components name in the variable:

  • you can write 'core^users^configuration', it will work because users and configuration are subparts of core.
  • 'configuration^users' will display configuration messages only (users is not a subpart of configuration, nothing more is excluded).
  • 'foundations|core^base^users' will work as expected.
  • 'foundations^users|core^base' will not substract users from core, because core is processed later by the ltrace parser. base will be substracted from foundations, though.