LTTNG_HEALTH_CHECK(3)

πŸ“¦
version 2.15.1 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 the liblttng-ctl or the lttng(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 with lttng-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 0 if the health is OK βœ…
  • Return 1 if it's in a bad state 🚨
  • A return code of -1 means 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 πŸŽ€βœ¨πŸ¦‹