Fix: set_health_socket_path() as tracing group

liblttng-ctl running as tracing group should talk to root sessiond, not
per-user sessiond (missing return 0 there). Take care of cleaning up
this function while we are there (the if (uid && is_tracing) {} if
(!uid) {} are misleading).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add missing pthread_join in sessiond

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: relayd: incorrectly placed exit labels

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: sessiond poll thread normal error path should return 0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: health.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Turn health.h/health.c into a library

All app-specific state is now in an object: struct health_app.

This moves the per-application enumeration into health-sessiond.h (for
sessiond).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move health into its own common/ static library

- Introduce lttng/health-internal.h (not installed)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
relayd: register threads to health monitoring

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
relayd: add health instrumentation to threads

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
consumerd: register threads to health monitoring

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
consumerd: add health instrumentation into threads

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move health comm to health-internal.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Implement consumer health check thread

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
health check API

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Health check: implement health check query in sessiond and consumerd

At this stage, tests/regression/tools/health/health_check queries
sessiond and consumerd with the new API, however, the scripts using this
program have not yet been changed, and are therefore expected to fail.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Health check test: add relayd check support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
relayd: add health check support for live threads

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng ctl health: add string description of relayd live threads

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
health consumerd: add missing extern

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add health thread to relayd

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>