- switch (msg.component) {
- case LTTNG_HEALTH_CMD:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_CMD);
- break;
- case LTTNG_HEALTH_APP_MANAGE:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_APP_MANAGE);
- break;
- case LTTNG_HEALTH_APP_REG:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_APP_REG);
- break;
- case LTTNG_HEALTH_KERNEL:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_KERNEL);
- break;
- case LTTNG_HEALTH_CONSUMER:
- reply.ret_code = check_consumer_health();
- break;
- case LTTNG_HEALTH_HT_CLEANUP:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_HT_CLEANUP);
- break;
- case LTTNG_HEALTH_APP_MANAGE_NOTIFY:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_APP_MANAGE_NOTIFY);
- break;
- case LTTNG_HEALTH_APP_REG_DISPATCH:
- reply.ret_code = health_check_state(health_sessiond, HEALTH_TYPE_APP_REG_DISPATCH);
- break;
- case LTTNG_HEALTH_ALL:
- reply.ret_code =
- health_check_state(health_sessiond, HEALTH_TYPE_APP_MANAGE) &&
- health_check_state(health_sessiond, HEALTH_TYPE_APP_REG) &&
- health_check_state(health_sessiond, HEALTH_TYPE_CMD) &&
- health_check_state(health_sessiond, HEALTH_TYPE_KERNEL) &&
- check_consumer_health() &&
- health_check_state(health_sessiond, HEALTH_TYPE_HT_CLEANUP) &&
- health_check_state(health_sessiond, HEALTH_TYPE_APP_MANAGE_NOTIFY) &&
- health_check_state(health_sessiond, HEALTH_TYPE_APP_REG_DISPATCH);
- break;
- default:
- reply.ret_code = LTTNG_ERR_UND;
- break;
- }
-
- /*
- * Flip ret value since 0 is a success and 1 indicates a bad health for
- * the client where in the sessiond it is the opposite. Again, this is
- * just to make things easier for us poor developer which enjoy a lot
- * lazyness.
- */
- if (reply.ret_code == 0 || reply.ret_code == 1) {
- reply.ret_code = !reply.ret_code;