Feature #932

LTTng client error code semantics are ill-defined

Added by Jérémie Galarneau over 5 years ago. Updated almost 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


The LTTNG (1) man page mentions that

On  success 0 is returned and a positive value on error. Value of 1 means a command error, 2 an undefined command, 3 a fatal error and 4 a command warning meaning that something went wrong during the command.

Any other value above 10, please refer to <lttng/lttng-error.h> for a detailed list or use lttng_strerror() to get a human readable string of the error code.

There are a number of things wrong with this. First of all, asking script authors to check some obscure error header deep in the bowels of their system is questionable, at best.

Second, as remarked by Michael Jeanson, Philippe Proulx, most command-line utilities don't return an error code to indicate a warning. A non-zero error code means an error as occurred.

We will have to go through commands and determine which errors are in fact harmless warnings (e.g. enabling the same event twice), and which ones shall signal an error (e.g. invalid channel configuration).

Related issues

Related to LTTng-tools - Bug #847: Enabling system calls returns code 35 instead of 0ResolvedMichael Jeanson10/22/2014


Updated by Jérémie Galarneau over 5 years ago

  • Related to Bug #847: Enabling system calls returns code 35 instead of 0 added

Updated by Jérémie Galarneau almost 5 years ago

  • Target version changed from 2.8 to 2.9

Also available in: Atom PDF