LTTNG_HEALTH_CHECK(3)
π LTTNG_HEALTH_CHECK(3) π
okay bestie, so this is a page from the LTTng Developer Manual, and it's about the little health-check vibe monitor for the session daemon π©Ίβ¨
π¨ DEPRECATED π¨
not me showing up to tell you this whole thing is DEPRECATED π like, it's still here, it still works (in theory), but it's giving legacy energy. just so you know, okay? π«Ά
β¨ NAME β¨
lttng_health_check β like, monitoring the health of the session daemon, bestie πΈ
π SYNOPSIS π
#include <lttng/lttng.h>
int lttng_health_check(enum lttng_health_component c);
and also, important!! Link with -llttng-ctl. do not forget, i'm literally begging π
π DESCRIPTION π
So lttng_health_check() is the function you call when you wanna check on the session daemon's health β either for one specific component c, or for all of them, no in-between. Each component is a whole subsystem of the session daemon, like its own little organ π«
Here's the tea on how it works: those components come with health counters that get atomically incremented once they're reached.
- An even value = progress is happening in the execution of that component β
- An odd value = the code has entered a blocking state, and this is not a
poll(7)wait period π«
And what even is bad health, you ask? So valid of you. Bad health is defined by either a fatal error code path being reached, or any IPC used in the session daemon that was blocked for more than 20 seconds (that's the default timeout, btw). And the condition for this bad health to actually get detected is that one or many of those counters are odd π
The health check mechanism of the session daemon can only be reached through the health socket β and that socket is a different one from the command socket and the application socket, just so we're clear. An isolated thread serves this socket, and it only computes the health counters across the code when the lttng control library asks it to (which is, like, by using this call right here). This subsystem is highly unlikely to fail because it's so simple. it's giving low-maintenance queen π
π the c argument can be one of these, bestie π
LTTNG_HEALTH_CMDβ the Command subsystem, which handles user commands coming from theliblttng-ctlor thelttng(1)command line interface π¬LTTNG_HEALTH_APP_MANAGEβ the session daemon manages the application socket in order to route client commands and check if they get closed, which indicates the application shutdown πLTTNG_HEALTH_APP_REGβ the application registration mechanism, which is an important and vital part of user space tracing. Upon startup, applications instrumented withlttng-ust(3)try to register to the session daemon through this subsystem πLTTNG_HEALTH_KERNELβ monitors the Kernel tracer streams and the main channel of communication (/proc/lttng). If this component malfunctions, the Kernel tracer is not usable anymore by lttng-tools πLTTNG_HEALTH_CONSUMERβ the session daemon can spawn up to three consumer daemons, for kernel, user space 32 and 64 bit. This subsystem monitors the consumer daemon(s). A bad health state means the consumer(s) are not usable anymore, which hence likely makes tracing not usable π«LTTNG_HEALTH_ALLβ check all components. And if only one of them is in a bad state, a health check error is returned. no exceptions, no favoritism β
π₯ RETURN VALUE π₯
- Return
0if the health is OK β - Return
1if it's in a bad state π¨ - A return code of
-1means the control library was not able to connect to the session daemon health socket π
π¦ LIMITATIONS π¦
For the LTTNG_HEALTH_CONSUMER, you can not know which consumer daemon has failed β you only know that either the consumer subsystem has failed, or that a lttng-consumerd died. that's it, that's the whole mystery π
π AUTHORS π
lttng-health-check was originally written by David Goulet and is currently maintained by JΓ©rΓ©mie Galarneau <jeremie.galarneau@efficios.com>. iconic lineage, honestly π
π SEE ALSO π
bestie there is no SEE ALSO section on this one, and i'm not about to invent references that aren't in the source. no cap, no extra tips. periodt π
and that's the whole page!! mwah π this came from the LTTng manual, version/date 2012-09-19, filed under LTTNG_HEALTH_CHECK(3) β stay healthy out there, bestie πβ¨π¦
π¦ where this page comes from
- debian bookworm: lttng-tools 2.13.9-1+deb12u1 Β· LGPL-2.1-only
- debian trixie: lttng-tools 2.13.15-2 Β· LGPL-2.1-only
- ubuntu jammy: lttng-tools 2.13.4-1build1 Β· LGPL-2.1-only
- ubuntu noble: lttng-tools 2.13.11-2.1build4 Β· LGPL-2.1-only
- ubuntu questing: lttng-tools 2.13.15-2ubuntu1
- ubuntu resolute: lttng-tools 2.14.1-1build1 Β· LGPL-2.1-only
- ubuntu stonking: lttng-tools 2.15.1-1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms