X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=liblttngctl%2Fliblttngctl.c;h=de18210321fb8378a7e61f89470ecf6f4335823f;hb=773168b7255d45fd28f018055292e93b7a76482d;hp=37e202f2c35f7f1a099a50d7f9b4fa91524bf79d;hpb=0d0c377ae0d483b1070409811ff5409ab05aa72b;p=lttng-tools.git diff --git a/liblttngctl/liblttngctl.c b/liblttngctl/liblttngctl.c index 37e202f2c..de1821032 100644 --- a/liblttngctl/liblttngctl.c +++ b/liblttngctl/liblttngctl.c @@ -30,7 +30,7 @@ #include -#include "liblttsessiondcomm.h" +#include #include "lttngerr.h" #include "lttng-share.h" @@ -575,6 +575,22 @@ int lttng_set_tracing_group(const char *name) return 0; } +/* + * lttng_calibrate + */ +int lttng_calibrate(struct lttng_domain *domain, + struct lttng_calibrate *calibrate) +{ + int ret; + + copy_lttng_domain(domain); + + memcpy(&lsm.u.calibrate, calibrate, sizeof(struct lttng_calibrate)); + ret = ask_sessiond(LTTNG_CALIBRATE, NULL); + + return ret; +} + /* * lttng_check_session_daemon * @@ -592,13 +608,22 @@ int lttng_session_daemon_alive(void) return ret; } - /* If socket exist, we consider the daemon started */ + /* If socket exist, we check if the daemon listens to connect. */ ret = access(sessiond_sock_path, F_OK); if (ret < 0) { /* Not alive */ return 0; } + ret = lttcomm_connect_unix_sock(sessiond_sock_path); + if (ret < 0) { + /* Not alive */ + return 0; + } + ret = lttcomm_close_unix_sock(ret); + if (ret < 0) + perror("lttcomm_close_unix_sock"); + /* Is alive */ return 1; }