X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Fconsumer_testpoints.cpp;h=d7dc4c21e011401ee09322913d7cc4936517be5b;hb=HEAD;hp=9f2314acb8d3f82807ecbd95db581827a601261a;hpb=c9e313bc594f40a86eed237dce222c0fc99c957f;p=lttng-tools.git diff --git a/tests/regression/tools/notification/consumer_testpoints.cpp b/tests/regression/tools/notification/consumer_testpoints.cpp index 9f2314acb..d7dc4c21e 100644 --- a/tests/regression/tools/notification/consumer_testpoints.cpp +++ b/tests/regression/tools/notification/consumer_testpoints.cpp @@ -7,15 +7,17 @@ #include #include -#include #include -#include -#include +#include + #include #include -#include + #include +#include +#include #include +#include static char *pause_pipe_path; static struct lttng_pipe *pause_pipe; @@ -27,8 +29,7 @@ int lttng_opt_verbose; int lttng_opt_mi; int lttng_opt_quiet; -static -void __attribute__((destructor)) pause_pipe_fini(void) +static void __attribute__((destructor)) pause_pipe_fini() { int ret; @@ -54,8 +55,7 @@ int __testpoint_consumerd_thread_data(void) int ret = 0; const char *pause_pipe_path_prefix, *domain; - pause_pipe_path_prefix = lttng_secure_getenv( - "CONSUMER_PAUSE_PIPE_PATH"); + pause_pipe_path_prefix = lttng_secure_getenv("CONSUMER_PAUSE_PIPE_PATH"); if (!pause_pipe_path_prefix) { ret = -1; goto end; @@ -67,9 +67,10 @@ int __testpoint_consumerd_thread_data(void) * dynamically would not allow this shared object to be LD_PRELOAD-ed * when launching the session daemon. */ - data_consumption_state = (int *) dlsym(NULL, "data_consumption_paused"); + data_consumption_state = (int *) dlsym(nullptr, "data_consumption_paused"); LTTNG_ASSERT(data_consumption_state); - lttng_consumer_get_type = (lttng_consumer_type (*)()) dlsym(NULL, "lttng_consumer_get_type"); + lttng_consumer_get_type = + (lttng_consumer_type(*)()) dlsym(nullptr, "lttng_consumer_get_type"); LTTNG_ASSERT(lttng_consumer_get_type); switch (lttng_consumer_get_type()) { @@ -86,16 +87,15 @@ int __testpoint_consumerd_thread_data(void) abort(); } - ret = asprintf(&pause_pipe_path, "%s-%s", pause_pipe_path_prefix, - domain); + ret = asprintf(&pause_pipe_path, "%s-%s", pause_pipe_path_prefix, domain); if (ret < 1) { ERR("Failed to allocate pause pipe path"); goto end; } DBG("Creating pause pipe at %s", pause_pipe_path); - pause_pipe = lttng_pipe_named_open(pause_pipe_path, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, O_NONBLOCK); + pause_pipe = lttng_pipe_named_open( + pause_pipe_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, O_NONBLOCK); if (!pause_pipe) { ERR("Failed to create pause pipe at %s", pause_pipe_path); ret = -1; @@ -133,7 +133,7 @@ int __testpoint_consumerd_thread_data_poll(void) if (value_read) { *data_consumption_state = !!value; DBG("Message received on pause pipe: %s data consumption", - *data_consumption_state ? "paused" : "resumed"); + *data_consumption_state ? "paused" : "resumed"); } end: return ret;