Clean-up: run format-cpp on the tree
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 12 Apr 2023 15:57:50 +0000 (11:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 12 Apr 2023 18:24:49 +0000 (14:24 -0400)
The original re-format commit missed a number of files that were caught
by format-cpp. Hopefully this is the last large reformat commit for a
while.

Change-Id: I493ee6d9fe6187e0bd087c68ed346af69c929c1e
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
354 files changed:
doc/examples/rotation/rotate-client-example.c
doc/examples/trigger-condition-event-matches/instrumented-app.c
doc/examples/trigger-condition-event-matches/tracepoint-trigger-example.h
extras/core-handler/crash.c
include/lttng/action/action-internal.hpp
include/lttng/action/action.h
include/lttng/action/list-internal.hpp
include/lttng/action/list.h
include/lttng/action/notify-internal.hpp
include/lttng/action/notify.h
include/lttng/action/path-internal.hpp
include/lttng/action/path.h
include/lttng/action/rate-policy-internal.hpp
include/lttng/action/rate-policy.h
include/lttng/action/rotate-session-internal.hpp
include/lttng/action/rotate-session.h
include/lttng/action/snapshot-session-internal.hpp
include/lttng/action/snapshot-session.h
include/lttng/action/start-session-internal.hpp
include/lttng/action/start-session.h
include/lttng/action/stop-session-internal.hpp
include/lttng/action/stop-session.h
include/lttng/channel-internal.hpp
include/lttng/channel.h
include/lttng/clear-handle.h
include/lttng/clear.h
include/lttng/condition/buffer-usage-internal.hpp
include/lttng/condition/buffer-usage.h
include/lttng/condition/condition-internal.hpp
include/lttng/condition/condition.h
include/lttng/condition/evaluation-internal.hpp
include/lttng/condition/evaluation.h
include/lttng/condition/event-rule-matches-internal.hpp
include/lttng/condition/event-rule-matches.h
include/lttng/condition/session-consumed-size-internal.hpp
include/lttng/condition/session-consumed-size.h
include/lttng/condition/session-rotation-internal.hpp
include/lttng/condition/session-rotation.h
include/lttng/constant.h
include/lttng/destruction-handle.h
include/lttng/domain-internal.hpp
include/lttng/domain.h
include/lttng/endpoint-internal.hpp
include/lttng/error-query-internal.hpp
include/lttng/error-query.h
include/lttng/event-expr-internal.hpp
include/lttng/event-expr.h
include/lttng/event-field-value-internal.hpp
include/lttng/event-field-value.h
include/lttng/event-internal.hpp
include/lttng/event-rule/event-rule-internal.hpp
include/lttng/event-rule/event-rule.h
include/lttng/event-rule/jul-logging-internal.hpp
include/lttng/event-rule/jul-logging.h
include/lttng/event-rule/kernel-kprobe-internal.hpp
include/lttng/event-rule/kernel-kprobe.h
include/lttng/event-rule/kernel-syscall-internal.hpp
include/lttng/event-rule/kernel-syscall.h
include/lttng/event-rule/kernel-tracepoint-internal.hpp
include/lttng/event-rule/kernel-tracepoint.h
include/lttng/event-rule/kernel-uprobe-internal.hpp
include/lttng/event-rule/kernel-uprobe.h
include/lttng/event-rule/log4j-logging-internal.hpp
include/lttng/event-rule/log4j-logging.h
include/lttng/event-rule/python-logging-internal.hpp
include/lttng/event-rule/python-logging.h
include/lttng/event-rule/user-tracepoint-internal.hpp
include/lttng/event-rule/user-tracepoint.h
include/lttng/event.h
include/lttng/handle.h
include/lttng/health-internal.hpp
include/lttng/health.h
include/lttng/kernel-probe-internal.hpp
include/lttng/kernel-probe.h
include/lttng/load-internal.hpp
include/lttng/load.h
include/lttng/location-internal.hpp
include/lttng/location.h
include/lttng/log-level-rule-internal.hpp
include/lttng/log-level-rule.h
include/lttng/lttng-error.h
include/lttng/lttng-export.h
include/lttng/lttng.h
include/lttng/notification/channel-internal.hpp
include/lttng/notification/channel.h
include/lttng/notification/notification-internal.hpp
include/lttng/notification/notification.h
include/lttng/ref-internal.hpp
include/lttng/rotate-internal.hpp
include/lttng/rotation.h
include/lttng/save-internal.hpp
include/lttng/save.h
include/lttng/session-descriptor-internal.hpp
include/lttng/session-descriptor.h
include/lttng/session-internal.hpp
include/lttng/session.h
include/lttng/snapshot-internal.hpp
include/lttng/snapshot.h
include/lttng/tracker.h
include/lttng/trigger/trigger-internal.hpp
include/lttng/trigger/trigger.h
include/lttng/userspace-probe-internal.hpp
include/lttng/userspace-probe.h
src/bin/lttng-consumerd/health-consumerd.hpp
src/bin/lttng-consumerd/lttng-consumerd.hpp
src/bin/lttng-relayd/backward-compatibility-group-by.hpp
src/bin/lttng-relayd/cmd-2-1.hpp
src/bin/lttng-relayd/cmd-2-11.hpp
src/bin/lttng-relayd/cmd-2-2.hpp
src/bin/lttng-relayd/cmd-2-4.hpp
src/bin/lttng-relayd/cmd.hpp
src/bin/lttng-relayd/connection.hpp
src/bin/lttng-relayd/ctf-trace.hpp
src/bin/lttng-relayd/health-relayd.hpp
src/bin/lttng-relayd/index.hpp
src/bin/lttng-relayd/live.hpp
src/bin/lttng-relayd/lttng-relayd.hpp
src/bin/lttng-relayd/lttng-viewer-abi.hpp
src/bin/lttng-relayd/main.cpp
src/bin/lttng-relayd/session.hpp
src/bin/lttng-relayd/sessiond-trace-chunks.hpp
src/bin/lttng-relayd/stream.hpp
src/bin/lttng-relayd/tracefile-array.hpp
src/bin/lttng-relayd/viewer-session.hpp
src/bin/lttng-relayd/viewer-stream.hpp
src/bin/lttng-sessiond/action-executor.hpp
src/bin/lttng-sessiond/agent-thread.hpp
src/bin/lttng-sessiond/agent.hpp
src/bin/lttng-sessiond/buffer-registry.hpp
src/bin/lttng-sessiond/channel.hpp
src/bin/lttng-sessiond/client.cpp
src/bin/lttng-sessiond/clock-class.hpp
src/bin/lttng-sessiond/cmd.cpp
src/bin/lttng-sessiond/cmd.hpp
src/bin/lttng-sessiond/condition-internal.hpp
src/bin/lttng-sessiond/consumer.hpp
src/bin/lttng-sessiond/context.hpp
src/bin/lttng-sessiond/ctf2-trace-class-visitor.hpp
src/bin/lttng-sessiond/dispatch.hpp
src/bin/lttng-sessiond/event-class.hpp
src/bin/lttng-sessiond/event-notifier-error-accounting.hpp
src/bin/lttng-sessiond/event.cpp
src/bin/lttng-sessiond/event.hpp
src/bin/lttng-sessiond/field.hpp
src/bin/lttng-sessiond/health-sessiond.hpp
src/bin/lttng-sessiond/kern-modules.hpp
src/bin/lttng-sessiond/kernel-consumer.hpp
src/bin/lttng-sessiond/kernel.cpp
src/bin/lttng-sessiond/kernel.hpp
src/bin/lttng-sessiond/lttng-sessiond.hpp
src/bin/lttng-sessiond/lttng-syscall.hpp
src/bin/lttng-sessiond/main.cpp
src/bin/lttng-sessiond/manage-apps.hpp
src/bin/lttng-sessiond/manage-consumer.hpp
src/bin/lttng-sessiond/manage-kernel.hpp
src/bin/lttng-sessiond/notification-thread-commands.hpp
src/bin/lttng-sessiond/notification-thread-events.hpp
src/bin/lttng-sessiond/notification-thread-internal.hpp
src/bin/lttng-sessiond/notification-thread.hpp
src/bin/lttng-sessiond/notify-apps.hpp
src/bin/lttng-sessiond/register.hpp
src/bin/lttng-sessiond/rotation-thread.cpp
src/bin/lttng-sessiond/rotation-thread.hpp
src/bin/lttng-sessiond/save.hpp
src/bin/lttng-sessiond/session.cpp
src/bin/lttng-sessiond/session.hpp
src/bin/lttng-sessiond/sessiond-config.hpp
src/bin/lttng-sessiond/snapshot.hpp
src/bin/lttng-sessiond/stream-class.hpp
src/bin/lttng-sessiond/thread.hpp
src/bin/lttng-sessiond/timer.cpp
src/bin/lttng-sessiond/timer.hpp
src/bin/lttng-sessiond/trace-class.hpp
src/bin/lttng-sessiond/trace-kernel.hpp
src/bin/lttng-sessiond/trace-ust.hpp
src/bin/lttng-sessiond/tracker.hpp
src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp
src/bin/lttng-sessiond/tsdl-trace-class-visitor.hpp
src/bin/lttng-sessiond/ust-abi-internal.hpp
src/bin/lttng-sessiond/ust-app.hpp
src/bin/lttng-sessiond/ust-consumer.hpp
src/bin/lttng-sessiond/ust-ctl-internal.hpp
src/bin/lttng-sessiond/ust-error-internal.hpp
src/bin/lttng-sessiond/ust-field-convert.hpp
src/bin/lttng-sessiond/ust-registry-channel.hpp
src/bin/lttng-sessiond/ust-registry-event.hpp
src/bin/lttng-sessiond/ust-registry-session-pid.hpp
src/bin/lttng-sessiond/ust-registry-session-uid.hpp
src/bin/lttng-sessiond/ust-registry-session.hpp
src/bin/lttng-sessiond/ust-registry.hpp
src/bin/lttng-sessiond/ust-sigbus.hpp
src/bin/lttng-sessiond/utils.hpp
src/bin/lttng/command.hpp
src/bin/lttng/commands/disable_events.cpp
src/bin/lttng/loglevel.hpp
src/bin/lttng/uprobe.hpp
src/bin/lttng/utils.hpp
src/common/align.hpp
src/common/argpar-utils/argpar-utils.hpp
src/common/argpar/argpar.c
src/common/argpar/argpar.h
src/common/buffer-view.hpp
src/common/bug.hpp
src/common/bytecode/bytecode.hpp
src/common/common.hpp
src/common/compat/directory-handle.hpp
src/common/compat/dirent.hpp
src/common/compat/endian.hpp
src/common/compat/fcntl.hpp
src/common/compat/getenv.hpp
src/common/compat/netdb.hpp
src/common/compat/paths.hpp
src/common/compat/poll.hpp
src/common/compat/pthread.hpp
src/common/compat/socket.hpp
src/common/compat/string.hpp
src/common/compat/time.hpp
src/common/config/config-session-abi.hpp
src/common/config/session-config.hpp
src/common/consumer/consumer-metadata-cache.hpp
src/common/consumer/consumer-stream.hpp
src/common/consumer/consumer-timer.hpp
src/common/consumer/consumer.hpp
src/common/consumer/metadata-bucket.hpp
src/common/context.hpp
src/common/credentials.hpp
src/common/daemonize.hpp
src/common/defaults.hpp
src/common/dynamic-array.hpp
src/common/dynamic-buffer.hpp
src/common/error.hpp
src/common/event-rule/user-tracepoint.cpp
src/common/exception.hpp
src/common/fd-tracker/fd-tracker.hpp
src/common/fd-tracker/inode.hpp
src/common/fd-tracker/utils.hpp
src/common/file-descriptor.hpp
src/common/filter.hpp
src/common/filter/filter-ast.hpp
src/common/filter/filter-ir.hpp
src/common/filter/filter-symbols.hpp
src/common/filter/memstream.hpp
src/common/format.hpp
src/common/fs-handle.hpp
src/common/hashtable/hashtable-symbols.hpp
src/common/hashtable/hashtable.hpp
src/common/index-allocator.hpp
src/common/index/ctf-index.hpp
src/common/index/index.hpp
src/common/ini-config/ini-config.hpp
src/common/kernel-consumer/kernel-consumer.hpp
src/common/kernel-ctl/kernel-ctl.hpp
src/common/kernel-ctl/kernel-ioctl.hpp
src/common/locked-reference.hpp
src/common/lttng-elf.hpp
src/common/lttng-kernel-old.hpp
src/common/lttng-kernel.hpp
src/common/macros.hpp
src/common/make-unique-wrapper.hpp
src/common/mi-lttng.hpp
src/common/optional.hpp
src/common/payload-view.hpp
src/common/payload.hpp
src/common/pipe.hpp
src/common/pthread-lock.hpp
src/common/random.cpp
src/common/random.hpp
src/common/readwrite.hpp
src/common/relayd/relayd.hpp
src/common/runas.hpp
src/common/sessiond-comm/agent.hpp
src/common/sessiond-comm/inet.hpp
src/common/sessiond-comm/inet6.hpp
src/common/sessiond-comm/relayd.hpp
src/common/sessiond-comm/sessiond-comm.hpp
src/common/snapshot.hpp
src/common/spawn-viewer.hpp
src/common/string-utils/format.hpp
src/common/string-utils/string-utils.hpp
src/common/testpoint/testpoint.hpp
src/common/time.hpp
src/common/trace-chunk-registry.hpp
src/common/trace-chunk.hpp
src/common/tracker.hpp
src/common/unix.hpp
src/common/urcu.hpp
src/common/uri.hpp
src/common/ust-consumer/ust-consumer.hpp
src/common/utils.hpp
src/common/uuid.hpp
src/common/waiter.hpp
src/lib/lttng-ctl/lttng-ctl-health.cpp
src/lib/lttng-ctl/lttng-ctl-helper.hpp
tests/perf/find_event.c
tests/regression/tools/filtering/gen-ust-events.c
tests/regression/tools/filtering/tp.h
tests/regression/tools/health/health_check.c
tests/regression/tools/health/health_fail.c
tests/regression/tools/health/health_stall.c
tests/regression/tools/notification/base_client.c
tests/regression/tools/notification/rotation.c
tests/regression/tools/rotation/schedule_api.c
tests/regression/tools/trigger/utils/notification-client.c
tests/regression/ust/baddr-statedump/tp.h
tests/regression/ust/clock-override/lttng-ust-clock-override-test.c
tests/regression/ust/daemon/daemon.c
tests/regression/ust/daemon/ust_tests_daemon.h
tests/regression/ust/exit-fast/ust_tests_exitfast.h
tests/regression/ust/fork/fork.c
tests/regression/ust/fork/ust_tests_fork.h
tests/regression/ust/getcpu-override/lttng-ust-getcpu-override-test.c
tests/regression/ust/high-throughput/main.c
tests/regression/ust/high-throughput/tp.h
tests/regression/ust/libc-wrapper/prog.c
tests/regression/ust/linking/demo.c
tests/regression/ust/linking/ust_tests_demo.h
tests/regression/ust/linking/ust_tests_demo2.h
tests/regression/ust/linking/ust_tests_demo3.h
tests/regression/ust/low-throughput/tp.h
tests/regression/ust/multi-lib/callsites.c
tests/regression/ust/multi-lib/multi-lib-test.c
tests/regression/ust/multi-lib/probes.h
tests/regression/ust/multi-session/ust_gen_nevents.h
tests/regression/ust/overlap/demo/demo.c
tests/regression/ust/overlap/demo/ust_tests_demo.h
tests/regression/ust/overlap/demo/ust_tests_demo2.h
tests/regression/ust/overlap/demo/ust_tests_demo3.h
tests/regression/ust/type-declarations/type-declarations.c
tests/regression/ust/type-declarations/ust_tests_td.h
tests/regression/ust/ust-dl/libbar-tp.h
tests/regression/ust/ust-dl/libbar.h
tests/regression/ust/ust-dl/libfoo-tp.h
tests/regression/ust/ust-dl/libfoo.c
tests/regression/ust/ust-dl/libfoo.h
tests/regression/ust/ust-dl/libzzz-tp.h
tests/regression/ust/ust-dl/libzzz.h
tests/regression/ust/ust-dl/prog.c
tests/utils/tap/tap.c
tests/utils/tap/tap.h
tests/utils/testapp/gen-kernel-test-events/gen-kernel-test-events.c
tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack.c
tests/utils/testapp/gen-ust-events-ns/tp.h
tests/utils/testapp/gen-ust-events/tp.h
tests/utils/testapp/gen-ust-nevents-str/tp.h
tests/utils/testapp/gen-ust-nevents/tp.h
tests/utils/testapp/signal-helper.hpp
tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary.c
tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.hpp
tests/utils/testapp/userspace-probe-sdt-binary/libbar.c
tests/utils/testapp/userspace-probe-sdt-binary/libfoo.c
tests/utils/testapp/userspace-probe-sdt-binary/libzzz.c
tests/utils/testapp/userspace-probe-sdt-binary/sema.c
tests/utils/testapp/userspace-probe-sdt-binary/userspace-probe-sdt-binary.c
tests/utils/utils.h

index 86e5b04f25fc9a5cd55fcd9ca83bcad82c7b7833..1f9070a04138f24672ba6534242b561dfdc6f943 100644 (file)
  */
 
 #include <lttng/lttng.h>
+
+#include <assert.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <assert.h>
 
 #define DEFAULT_DATA_AVAILABILITY_WAIT_TIME 200000 /* usec */
 
@@ -46,7 +47,7 @@ static volatile int quit = 0;
 static void sighandler(int signal __attribute__((unused)))
 {
        const char msg[] = "Signal caught, exiting\n";
-       const int ret =  write(STDOUT_FILENO, msg, sizeof(msg));
+       const int ret = write(STDOUT_FILENO, msg, sizeof(msg));
 
        assert(ret == 0); /* NOLINT assert is not async signal safe */
        quit = 1;
@@ -80,8 +81,7 @@ static int setup_session(const char *session_name, const char *path)
        strcpy(ev.name, "*");
        ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
 
-       ret = lttng_enable_event_with_exclusions(
-                       chan_handle, &ev, "mychan", NULL, 0, NULL);
+       ret = lttng_enable_event_with_exclusions(chan_handle, &ev, "mychan", NULL, 0, NULL);
        if (ret < 0) {
                fprintf(stderr, "Failed to enable events (ret = %i)\n", ret);
                goto end;
@@ -157,16 +157,14 @@ static int rotate_session(const char *session_name, const char *ext_program)
 
        ret = lttng_rotate_session(session_name, NULL, &handle);
        if (ret < 0) {
-               fprintf(stderr, "Failed to rotate session, %s\n",
-                               lttng_strerror(ret));
+               fprintf(stderr, "Failed to rotate session, %s\n", lttng_strerror(ret));
                goto end;
        }
 
        fflush(stdout);
 
        do {
-               rotation_status = lttng_rotation_handle_get_state(
-                               handle, &rotation_state);
+               rotation_status = lttng_rotation_handle_get_state(handle, &rotation_state);
                if (rotation_status != LTTNG_ROTATION_STATUS_OK) {
                        ret = -1;
                        fprintf(stderr, "Failed to get the current rotation's state\n");
@@ -193,27 +191,24 @@ static int rotate_session(const char *session_name, const char *ext_program)
                const char *absolute_path;
                enum lttng_trace_archive_location_status location_status;
 
-               rotation_status = lttng_rotation_handle_get_archive_location(
-                               handle, &location);
+               rotation_status = lttng_rotation_handle_get_archive_location(handle, &location);
                if (rotation_status != LTTNG_ROTATION_STATUS_OK) {
-                       fprintf(stderr, "Failed to retrieve the rotation's completed chunk archive location\n");
+                       fprintf(stderr,
+                               "Failed to retrieve the rotation's completed chunk archive location\n");
                        ret = -1;
                        goto end;
                }
 
-               location_status =
-                               lttng_trace_archive_location_local_get_absolute_path(
-                                               location, &absolute_path);
+               location_status = lttng_trace_archive_location_local_get_absolute_path(
+                       location, &absolute_path);
                if (location_status != LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK) {
                        fprintf(stderr, "Failed to get absolute path of completed chunk archive");
                        ret = -1;
                        goto end;
                }
 
-               printf("Output files of session %s rotated to %s\n",
-                               session_name, absolute_path);
-               ret = snprintf(cmd, PATH_MAX, "%s %s", ext_program,
-                               absolute_path);
+               printf("Output files of session %s rotated to %s\n", session_name, absolute_path);
+               ret = snprintf(cmd, PATH_MAX, "%s %s", ext_program, absolute_path);
                if (ret < 0) {
                        fprintf(stderr, "Failed to prepare command string\n");
                        goto end;
@@ -223,20 +218,22 @@ static int rotate_session(const char *session_name, const char *ext_program)
        }
        case LTTNG_ROTATION_STATE_EXPIRED:
                printf("Output files of session %s rotated, but the handle expired\n",
-                               session_name);
+                      session_name);
                ret = 0;
                goto end;
        case LTTNG_ROTATION_STATE_ERROR:
-               fprintf(stderr, "An error occurred with the rotation of session %s\n",
-                               session_name);
+               fprintf(stderr,
+                       "An error occurred with the rotation of session %s\n",
+                       session_name);
                ret = -1;
                goto end;
        case LTTNG_ROTATION_STATE_ONGOING:
                abort();
                goto end;
        case LTTNG_ROTATION_STATE_NO_ROTATION:
-               fprintf(stderr, "No rotation was performed on rotation request for session %s\n",
-                               session_name);
+               fprintf(stderr,
+                       "No rotation was performed on rotation request for session %s\n",
+                       session_name);
                ret = -1;
                goto end;
        }
@@ -264,16 +261,15 @@ end:
 
 static void usage(const char *prog_name)
 {
-       fprintf(stderr, "Usage: %s <session-name> <delay-sec> <nr-rotate> <program>\n",
-                       prog_name);
+       fprintf(stderr, "Usage: %s <session-name> <delay-sec> <nr-rotate> <program>\n", prog_name);
        fprintf(stderr, "  <session-name>: the name of the session you want to create\n");
        fprintf(stderr, "  <delay-sec>: the delay in seconds between each rotation\n");
        fprintf(stderr,
-                       "  <nr-rotate>: the number of rotation you want to perform, "
-                       "-1 for infinite until ctrl-c\n");
+               "  <nr-rotate>: the number of rotation you want to perform, "
+               "-1 for infinite until ctrl-c\n");
        fprintf(stderr,
-                       "  <program>: program to run on each chunk, it must be "
-                       "executable, and expect a trace folder as only argument\n");
+               "  <program>: program to run on each chunk, it must be "
+               "executable, and expect a trace folder as only argument\n");
        fprintf(stderr, "\nThe trace folder is deleted when this program completes.\n");
 }
 
index 465b4a123c6646f497614fa16dfe4c17a06315d2..6148d1c090d3abd298e514accf94292ff35dd4d4 100644 (file)
@@ -8,6 +8,7 @@
 #include "tracepoint-trigger-example.h"
 
 #include <lttng/tracepoint.h>
+
 #include <stdio.h>
 #include <sys/time.h>
 #include <time.h>
@@ -25,10 +26,10 @@ int main(void)
                gettimeofday(&tv, NULL);
                the_time = tv.tv_sec;
 
-               strftime(time_str, sizeof(time_str), "[%m-%d-%Y] %T",
-                               localtime(&the_time));
+               strftime(time_str, sizeof(time_str), "[%m-%d-%Y] %T", localtime(&the_time));
                printf("%s.%ld - Tracing event \"trigger_example:my_event\"\n",
-                               time_str, tv.tv_usec);
+                      time_str,
+                      tv.tv_usec);
 
                tracepoint(trigger_example, my_event, i);
                sleep(2);
index e82e3c704998e2bc88f022a93bb5de4e7ef99b12..9aad47e7c66d7612c7999c20d6dbb2f6ec4daae6 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(trigger_example, my_event,
-       TP_ARGS(int, iteration),
-       TP_FIELDS(
-               ctf_integer(uint64_t, iteration, iteration)
-       )
-)
+TRACEPOINT_EVENT(trigger_example,
+                my_event,
+                TP_ARGS(int, iteration),
+                TP_FIELDS(ctf_integer(uint64_t, iteration, iteration)))
 
 #endif /* _TRACEPOINT_TRIGGER_EXAMPLE_H */
 
index bc7296814f4011e37365a5125da1fe73f5bed3a1..c1e2a91bcc51b257bc3959dddf0bcc4fe9950f09 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-
 #include <signal.h>
 
 int main(void)
index e52d91f594f98824f23043ccc2cda5ffde368678..bf55fa8037eb8a5fe23fb6bb9179425b0a3c3208 100644 (file)
@@ -13,7 +13,9 @@
 #include <common/macros.hpp>
 #include <common/payload-view.hpp>
 #include <common/payload.hpp>
+
 #include <lttng/lttng.h>
+
 #include <pthread.h>
 #include <stdbool.h>
 #include <sys/types.h>
@@ -70,31 +72,29 @@ struct lttng_action_comm {
 } LTTNG_PACKED;
 
 void lttng_action_init(struct lttng_action *action,
-               enum lttng_action_type type,
-               action_validate_cb validate,
-               action_serialize_cb serialize,
-               action_equal_cb equal,
-               action_destroy_cb destroy,
-               action_get_rate_policy_cb get_rate_policy,
-               action_add_error_query_results_cb add_error_query_results,
-               action_mi_serialize_cb mi);
+                      enum lttng_action_type type,
+                      action_validate_cb validate,
+                      action_serialize_cb serialize,
+                      action_equal_cb equal,
+                      action_destroy_cb destroy,
+                      action_get_rate_policy_cb get_rate_policy,
+                      action_add_error_query_results_cb add_error_query_results,
+                      action_mi_serialize_cb mi);
 
 bool lttng_action_validate(struct lttng_action *action);
 
-int lttng_action_serialize(struct lttng_action *action,
-               struct lttng_payload *buf);
+int lttng_action_serialize(struct lttng_action *action, struct lttng_payload *buf);
 
 ssize_t lttng_action_create_from_payload(struct lttng_payload_view *view,
-               struct lttng_action **action);
+                                        struct lttng_action **action);
 
-bool lttng_action_is_equal(const struct lttng_action *a,
-               const struct lttng_action *b);
+bool lttng_action_is_equal(const struct lttng_action *a, const struct lttng_action *b);
 
 void lttng_action_get(struct lttng_action *action);
 
 void lttng_action_put(struct lttng_action *action);
 
-const charlttng_action_type_string(enum lttng_action_type action_type);
+const char *lttng_action_type_string(enum lttng_action_type action_type);
 
 void lttng_action_increase_execution_request_count(struct lttng_action *action);
 
@@ -104,23 +104,23 @@ void lttng_action_increase_execution_failure_count(struct lttng_action *action);
 
 bool lttng_action_should_execute(const struct lttng_action *action);
 
-enum lttng_action_status lttng_action_add_error_query_results(
-               const struct lttng_action *action,
-               struct lttng_error_query_results *results);
+enum lttng_action_status
+lttng_action_add_error_query_results(const struct lttng_action *action,
+                                    struct lttng_error_query_results *results);
 
 /*
  * For use by the various lttng_action implementation. Implements the default
  * behavior to the generic error "execution failure counter" that all actions
  * (except list, which passes-through) provide.
  */
-enum lttng_action_status lttng_action_generic_add_error_query_results(
-               const struct lttng_action *action,
-               struct lttng_error_query_results *results);
-enum lttng_error_code lttng_action_mi_serialize(const struct lttng_trigger *trigger,
-               const struct lttng_action *action,
-               struct mi_writer *writer,
-               const struct mi_lttng_error_query_callbacks
-                               *error_query_callbacks,
-               struct lttng_dynamic_array *action_path_indexes);
+enum lttng_action_status
+lttng_action_generic_add_error_query_results(const struct lttng_action *action,
+                                            struct lttng_error_query_results *results);
+enum lttng_error_code
+lttng_action_mi_serialize(const struct lttng_trigger *trigger,
+                         const struct lttng_action *action,
+                         struct mi_writer *writer,
+                         const struct mi_lttng_error_query_callbacks *error_query_callbacks,
+                         struct lttng_dynamic_array *action_path_indexes);
 
 #endif /* LTTNG_ACTION_INTERNAL_H */
index 70237e43cd772fea79b0b8ecea332820d3e2d5b5..6e303f4414527441e515754d2ff824cdf07dccea 100644 (file)
@@ -39,8 +39,7 @@ enum lttng_action_status {
  *
  * Returns the type of an action on success, LTTNG_ACTION_TYPE_UNKNOWN on error.
  */
-LTTNG_EXPORT extern enum lttng_action_type lttng_action_get_type(
-               const struct lttng_action *action);
+LTTNG_EXPORT extern enum lttng_action_type lttng_action_get_type(const struct lttng_action *action);
 
 /*
  * Destroy (frees) an action object.
index 294a53ca24841c2769f12811f7a3a1c73a1a885f..7282ab7e4599ebc58a90d94c8cfbc12715233e1b 100644 (file)
@@ -8,10 +8,10 @@
 #ifndef LTTNG_ACTION_LIST_INTERNAL_H
 #define LTTNG_ACTION_LIST_INTERNAL_H
 
-#include <sys/types.h>
-
 #include <common/macros.hpp>
 
+#include <sys/types.h>
+
 struct lttng_action;
 struct lttng_payload_view;
 struct mi_writer;
@@ -25,18 +25,17 @@ struct lttng_trigger;
  * On success, return the number of bytes consumed from `view`, and the created
  * list in `*list`. On failure, return -1.
  */
-extern ssize_t lttng_action_list_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action **list);
-
-extern struct lttng_action *lttng_action_list_borrow_mutable_at_index(
-               const struct lttng_action *list, unsigned int index);
-
-enum lttng_error_code lttng_action_list_mi_serialize(const struct lttng_trigger *trigger,
-               const struct lttng_action *action,
-               struct mi_writer *writer,
-               const struct mi_lttng_error_query_callbacks
-                               *error_query_callbacks,
-               struct lttng_dynamic_array *action_path_indexes);
+extern ssize_t lttng_action_list_create_from_payload(struct lttng_payload_view *view,
+                                                    struct lttng_action **list);
+
+extern struct lttng_action *
+lttng_action_list_borrow_mutable_at_index(const struct lttng_action *list, unsigned int index);
+
+enum lttng_error_code
+lttng_action_list_mi_serialize(const struct lttng_trigger *trigger,
+                              const struct lttng_action *action,
+                              struct mi_writer *writer,
+                              const struct mi_lttng_error_query_callbacks *error_query_callbacks,
+                              struct lttng_dynamic_array *action_path_indexes);
 
 #endif /* LTTNG_ACTION_LIST_INTERNAL_H */
index 0dfffa296ad073e1e597c942bc9dcb252aec5430..5fe3a503b111eb30669a993047af084a8d3de1dc 100644 (file)
@@ -33,14 +33,14 @@ LTTNG_EXPORT extern struct lttng_action *lttng_action_list_create(void);
  *
  * Adding an action list to an action list is not supported.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_list_add_action(
-               struct lttng_action *list, struct lttng_action *action);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_list_add_action(struct lttng_action *list, struct lttng_action *action);
 
 /*
  * Get the number of actions in an action list.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_list_get_count(
-               const struct lttng_action *list, unsigned int *count);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_list_get_count(const struct lttng_action *list, unsigned int *count);
 
 /*
  * Get an action from the action list at a given index.
@@ -51,9 +51,8 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_list_get_count(
  *
  * Returns an action, or NULL on error.
  */
-LTTNG_EXPORT extern const struct lttng_action *lttng_action_list_get_at_index(
-               const struct lttng_action *list,
-               unsigned int index);
+LTTNG_EXPORT extern const struct lttng_action *
+lttng_action_list_get_at_index(const struct lttng_action *list, unsigned int index);
 
 #ifdef __cplusplus
 }
index c923019c31235e8426d24784c895620c9ee69aa4..2d4d1bd4ad9e2f9fc53492a7cc920eba21aa14a5 100644 (file)
@@ -8,16 +8,15 @@
 #ifndef LTTNG_ACTION_NOTIFY_INTERNAL_H
 #define LTTNG_ACTION_NOTIFY_INTERNAL_H
 
-#include <lttng/action/notify.h>
 #include <lttng/action/action-internal.hpp>
+#include <lttng/action/notify.h>
 
 struct lttng_action_notify {
        struct lttng_action parent;
        struct lttng_rate_policy *policy;
 };
 
-ssize_t lttng_action_notify_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action **action);
+ssize_t lttng_action_notify_create_from_payload(struct lttng_payload_view *view,
+                                               struct lttng_action **action);
 
 #endif /* LTTNG_ACTION_NOTIFY_INTERNAL_H */
index 3aa55e09c8e5084cdce97a1a2f3980e9787dad76..300e28507473a1cb5d7ccdfa96b702b8124b2537 100644 (file)
@@ -39,9 +39,9 @@ LTTNG_EXPORT extern struct lttng_action *lttng_action_notify_create(void);
  * LTTNG_ACTION_STATUS_ERROR on internal error,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_set_rate_policy(
-               struct lttng_action *action,
-               const struct lttng_rate_policy *policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_notify_set_rate_policy(struct lttng_action *action,
+                                   const struct lttng_rate_policy *policy);
 
 /*
  * Get the rate policy of a notify action.
@@ -49,9 +49,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_set_rate_policy
  * Returns LTTNG_ACTION_STATUS_OK on success,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_get_rate_policy(
-               const struct lttng_action *action,
-               const struct lttng_rate_policy **policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_notify_get_rate_policy(const struct lttng_action *action,
+                                   const struct lttng_rate_policy **policy);
 
 #ifdef __cplusplus
 }
index f07776b9bb251790c5a741ed56a1fa01ce3ea562..4ad63844915f6bd51b7e807ba48876ebbb095d03 100644 (file)
@@ -8,25 +8,25 @@
 #ifndef LTTNG_ACTION_PATH_INTERNAL_H
 #define LTTNG_ACTION_PATH_INTERNAL_H
 
-#include <lttng/action/path.h>
-#include <common/macros.hpp>
 #include <common/dynamic-array.hpp>
+#include <common/macros.hpp>
 #include <common/payload-view.hpp>
 #include <common/payload.hpp>
+
+#include <lttng/action/path.h>
+
 #include <sys/types.h>
 
 struct lttng_action_path {
        struct lttng_dynamic_array indexes;
 };
 
-int lttng_action_path_copy(const struct lttng_action_path *src,
-               struct lttng_action_path **dst);
+int lttng_action_path_copy(const struct lttng_action_path *src, struct lttng_action_path **dst);
 
-ssize_t lttng_action_path_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action_path **action_path);
+ssize_t lttng_action_path_create_from_payload(struct lttng_payload_view *view,
+                                             struct lttng_action_path **action_path);
 
 int lttng_action_path_serialize(const struct lttng_action_path *action_path,
-               struct lttng_payload *payload);
+                               struct lttng_payload *payload);
 
 #endif /* LTTNG_ACTION_PATH_INTERNAL_H */
index 6ec91676b9e090f57a5688537a20dda537ec6409..88d8b640d3586e4b9c58afa7d42bbc396cbae421 100644 (file)
@@ -9,8 +9,9 @@
 #define LTTNG_ACTION_PATH_H
 
 #include <lttng/lttng-export.h>
-#include <stdint.h>
+
 #include <stddef.h>
+#include <stdint.h>
 
 struct lttng_action_path;
 
@@ -45,22 +46,20 @@ enum lttng_action_path_status {
  *
  * The `indexes` are copied internally and can be disposed-of by the caller.
  */
-LTTNG_EXPORT extern struct lttng_action_path *lttng_action_path_create(
-               const uint64_t *indexes, size_t index_count);
+LTTNG_EXPORT extern struct lttng_action_path *lttng_action_path_create(const uint64_t *indexes,
+                                                                      size_t index_count);
 
 /*
  * Get the count of indexes in an action path.
  */
-LTTNG_EXPORT extern enum lttng_action_path_status lttng_action_path_get_index_count(
-               const struct lttng_action_path *path, size_t *index_count);
+LTTNG_EXPORT extern enum lttng_action_path_status
+lttng_action_path_get_index_count(const struct lttng_action_path *path, size_t *index_count);
 
 /*
  * Get an index from an action path.
  */
 LTTNG_EXPORT extern enum lttng_action_path_status lttng_action_path_get_index_at_index(
-               const struct lttng_action_path *path,
-               size_t path_index,
-               uint64_t *out_index);
+       const struct lttng_action_path *path, size_t path_index, uint64_t *out_index);
 
 /*
  * Destroy an action path object.
index 5f6eb1f456b3eaed003d4e1b199e46d6131c925e..643a01cdac22689efa7a59ba98ede77a14a5abef 100644 (file)
 
 #include <common/macros.hpp>
 #include <common/payload-view.hpp>
+
 #include <lttng/action/rate-policy.h>
 #include <lttng/lttng-error.h>
-#include <stdbool.h>
 
+#include <stdbool.h>
 
 struct mi_writer;
 
-int lttng_rate_policy_serialize(struct lttng_rate_policy *rate_policy,
-               struct lttng_payload *buf);
+int lttng_rate_policy_serialize(struct lttng_rate_policy *rate_policy, struct lttng_payload *buf);
 
 ssize_t lttng_rate_policy_create_from_payload(struct lttng_payload_view *view,
-               struct lttng_rate_policy **rate_policy);
+                                             struct lttng_rate_policy **rate_policy);
 
 bool lttng_rate_policy_is_equal(const struct lttng_rate_policy *a,
-               const struct lttng_rate_policy *b);
+                               const struct lttng_rate_policy *b);
 
-const char *lttng_rate_policy_type_string(
-               enum lttng_rate_policy_type rate_policy_type);
+const char *lttng_rate_policy_type_string(enum lttng_rate_policy_type rate_policy_type);
 
-struct lttng_rate_policy *lttng_rate_policy_copy(
-               const struct lttng_rate_policy *source);
+struct lttng_rate_policy *lttng_rate_policy_copy(const struct lttng_rate_policy *source);
 
-bool lttng_rate_policy_should_execute(
-               const struct lttng_rate_policy *policy, uint64_t counter);
+bool lttng_rate_policy_should_execute(const struct lttng_rate_policy *policy, uint64_t counter);
 
-enum lttng_error_code lttng_rate_policy_mi_serialize(
-               const struct lttng_rate_policy *policy,
-               struct mi_writer *writer);
+enum lttng_error_code lttng_rate_policy_mi_serialize(const struct lttng_rate_policy *policy,
+                                                    struct mi_writer *writer);
 
 #endif /* LTTNG_RATE_POLICY */
index 1cd0126e3dd52b6eeeaac3fccb94cf82d6a20dcd..229e14c0da4ecf4876b144b395deb0a24f471340 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef LTTNG_RATE_POLICY_H
 #define LTTNG_RATE_POLICY_H
 
-#include <inttypes.h>
 #include <lttng/lttng-export.h>
+
+#include <inttypes.h>
 #include <sys/types.h>
 
 struct lttng_rate_policy;
@@ -37,8 +38,8 @@ enum lttng_rate_policy_type {
 /*
  * Get the type of a rate policy.
  */
-LTTNG_EXPORT extern enum lttng_rate_policy_type lttng_rate_policy_get_type(
-               const struct lttng_rate_policy *policy);
+LTTNG_EXPORT extern enum lttng_rate_policy_type
+lttng_rate_policy_get_type(const struct lttng_rate_policy *policy);
 
 /*
  * Create a rate_policy of type `every n`.
@@ -50,8 +51,7 @@ LTTNG_EXPORT extern enum lttng_rate_policy_type lttng_rate_policy_get_type(
  * rate_policy objects must be destroyed using the lttng_rate_policy_destroy()
  * function.
  */
-LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_every_n_create(
-               uint64_t interval);
+LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_every_n_create(uint64_t interval);
 
 /*
  * Get the interval of a every N rate policy.
@@ -60,8 +60,8 @@ LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_every_n_create(
  * on success, LTTNG_RATE_FIRING_POLICY_STATUS_INVALID if an invalid
  * parameter is passed.
  */
-LTTNG_EXPORT extern enum lttng_rate_policy_status lttng_rate_policy_every_n_get_interval(
-               const struct lttng_rate_policy *policy, uint64_t *interval);
+LTTNG_EXPORT extern enum lttng_rate_policy_status
+lttng_rate_policy_every_n_get_interval(const struct lttng_rate_policy *policy, uint64_t *interval);
 
 /*
  * Create a rate_policy of type `once after N`.
@@ -74,8 +74,8 @@ LTTNG_EXPORT extern enum lttng_rate_policy_status lttng_rate_policy_every_n_get_
  * rate_policy objects must be destroyed using the lttng_rate_policy_destroy()
  * function.
  */
-LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_once_after_n_create(
-               uint64_t threshold);
+LTTNG_EXPORT extern struct lttng_rate_policy *
+lttng_rate_policy_once_after_n_create(uint64_t threshold);
 
 /*
  * Get the threshold of a once after N rate policy.
@@ -85,8 +85,8 @@ LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_once_after_n_cre
  * parameter is passed.
  */
 LTTNG_EXPORT extern enum lttng_rate_policy_status
-lttng_rate_policy_once_after_n_get_threshold(
-               const struct lttng_rate_policy *policy, uint64_t *threshold);
+lttng_rate_policy_once_after_n_get_threshold(const struct lttng_rate_policy *policy,
+                                            uint64_t *threshold);
 
 /*
  * Destroy (frees) a rate policy object.
index 5030aeac335fa0003c728f8d8014fb98c549ebd9..cbab68e39d882d27af2c91422aadb0feaec9010a 100644 (file)
@@ -19,8 +19,7 @@ struct lttng_payload_view;
  * On success, return the number of bytes consumed from `view`, and the created
  * action in `*action`. On failure, return -1.
  */
-extern ssize_t lttng_action_rotate_session_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action **action);
+extern ssize_t lttng_action_rotate_session_create_from_payload(struct lttng_payload_view *view,
+                                                              struct lttng_action **action);
 
 #endif /* LTTNG_ACTION_ROTATE_SESSION_INTERNAL_H */
index 199b6f169a52eae8d852b92f47d53ee221e842c6..e628c5f52a7cce66d0f77ea893c6c093b1501ae5 100644 (file)
@@ -33,15 +33,16 @@ LTTNG_EXPORT extern struct lttng_action *lttng_action_rotate_session_create(void
  * Set the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_ROTATE_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_rotate_session_set_session_name(
-               struct lttng_action *action, const char *session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_rotate_session_set_session_name(struct lttng_action *action, const char *session_name);
 
 /*
  * Get the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_ROTATE_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_rotate_session_get_session_name(
-               const struct lttng_action *action, const char **session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_rotate_session_get_session_name(const struct lttng_action *action,
+                                            const char **session_name);
 
 /*
  * Set the rate policy of a rotate session action.
@@ -50,9 +51,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_rotate_session_get_ses
  * LTTNG_ACTION_STATUS_ERROR on internal error,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_rotate_session_set_rate_policy(
-               struct lttng_action *action,
-               const struct lttng_rate_policy *policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_rotate_session_set_rate_policy(struct lttng_action *action,
+                                           const struct lttng_rate_policy *policy);
 
 /*
  * Get the rate policy of a rotate session action.
@@ -60,9 +61,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_rotate_session_set_rat
  * Returns LTTNG_ACTION_STATUS_OK on success,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_rotate_session_get_rate_policy(
-               const struct lttng_action *action,
-               const struct lttng_rate_policy **policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_rotate_session_get_rate_policy(const struct lttng_action *action,
+                                           const struct lttng_rate_policy **policy);
 
 #ifdef __cplusplus
 }
index 27a8795ade1f475a6d820ead0d7f0cd6d5b39645..3943fe8f31ba4de82e4f765995f7a08cdd57caa0 100644 (file)
@@ -8,10 +8,10 @@
 #ifndef LTTNG_ACTION_SNAPSHOT_SESSION_INTERNAL_H
 #define LTTNG_ACTION_SNAPSHOT_SESSION_INTERNAL_H
 
-#include <sys/types.h>
-
 #include <common/macros.hpp>
 
+#include <sys/types.h>
+
 struct lttng_action;
 struct lttng_payload_view;
 
@@ -21,8 +21,7 @@ struct lttng_payload_view;
  * On success, return the number of bytes consumed from `view`, and the created
  * action in `*action`. On failure, return -1.
  */
-extern ssize_t lttng_action_snapshot_session_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action **action);
+extern ssize_t lttng_action_snapshot_session_create_from_payload(struct lttng_payload_view *view,
+                                                                struct lttng_action **action);
 
 #endif /* LTTNG_ACTION_SNAPSHOT_SESSION_INTERNAL_H */
index 8590862007f9dc4fe7d3861dfac444f079340c91..aadb784b2c3de8e2f70c00314b4c730ea5650585 100644 (file)
@@ -34,15 +34,17 @@ LTTNG_EXPORT extern struct lttng_action *lttng_action_snapshot_session_create(vo
  * Set the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_session_name(
-               struct lttng_action *action, const char *session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_snapshot_session_set_session_name(struct lttng_action *action,
+                                              const char *session_name);
 
 /*
  * Get the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_session_name(
-               const struct lttng_action *action, const char **session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_snapshot_session_get_session_name(const struct lttng_action *action,
+                                              const char **session_name);
 
 /*
  * Set an explicit snapshot output for this snapshot session action.
@@ -52,16 +54,16 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_s
  *
  * This function takes ownership of the given snapshot output.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_output(
-               struct lttng_action *action,
-               struct lttng_snapshot_output *output);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_snapshot_session_set_output(struct lttng_action *action,
+                                        struct lttng_snapshot_output *output);
 
 /*
  * Get the explicit snapshot output for this snapshot session action.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_output(
-               const struct lttng_action *action,
-               const struct lttng_snapshot_output **output);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_snapshot_session_get_output(const struct lttng_action *action,
+                                        const struct lttng_snapshot_output **output);
 
 /*
  * Set the rate policy of a snapshot session action.
@@ -70,9 +72,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_o
  * LTTNG_ACTION_STATUS_ERROR on internal error,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_rate_policy(
-               struct lttng_action *action,
-               const struct lttng_rate_policy *policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_snapshot_session_set_rate_policy(struct lttng_action *action,
+                                             const struct lttng_rate_policy *policy);
 
 /*
  * Get the rate policy of a snapshot session action.
@@ -80,9 +82,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_r
  * Returns LTTNG_ACTION_STATUS_OK on success,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_rate_policy(
-               const struct lttng_action *action,
-               const struct lttng_rate_policy **policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_snapshot_session_get_rate_policy(const struct lttng_action *action,
+                                             const struct lttng_rate_policy **policy);
 
 #ifdef __cplusplus
 }
index 44dab1bf1c9f439513d75c638c0eaee89a77836f..d33e073af43e38568ae7c3b24b4ef824292dcab0 100644 (file)
@@ -19,8 +19,7 @@ struct lttng_payload_view;
  * On success, return the number of bytes consumed from `view`, and the created
  * action in `*action`. On failure, return -1.
  */
-extern ssize_t lttng_action_start_session_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action **action);
+extern ssize_t lttng_action_start_session_create_from_payload(struct lttng_payload_view *view,
+                                                             struct lttng_action **action);
 
 #endif /* LTTNG_ACTION_START_SESSION_INTERNAL_H */
index db52000321c208481ba32cf2d45adbb11d82559a..da8c1c1b9f68c50792a43298ed2cd327715f6218 100644 (file)
@@ -33,15 +33,16 @@ LTTNG_EXPORT extern struct lttng_action *lttng_action_start_session_create(void)
  * Set the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_START_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_set_session_name(
-               struct lttng_action *action, const char *session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_start_session_set_session_name(struct lttng_action *action, const char *session_name);
 
 /*
  * Get the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_START_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_get_session_name(
-               const struct lttng_action *action, const char **session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_start_session_get_session_name(const struct lttng_action *action,
+                                           const char **session_name);
 
 /*
  * Set the rate policy of a start session action.
@@ -50,9 +51,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_get_sess
  * LTTNG_ACTION_STATUS_ERROR on internal error,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_set_rate_policy(
-               struct lttng_action *action,
-               const struct lttng_rate_policy *policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_start_session_set_rate_policy(struct lttng_action *action,
+                                          const struct lttng_rate_policy *policy);
 
 /*
  * Get the rate policy of a start session action.
@@ -60,9 +61,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_set_rate
  * Returns LTTNG_ACTION_STATUS_OK on success,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_get_rate_policy(
-               const struct lttng_action *action,
-               const struct lttng_rate_policy **policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_start_session_get_rate_policy(const struct lttng_action *action,
+                                          const struct lttng_rate_policy **policy);
 
 #ifdef __cplusplus
 }
index 22055352fd9099b65600f4d1fff86e5555f9c690..46f1d6ebad6d64e6cfe9098d37adcf47ca9cdd00 100644 (file)
@@ -19,8 +19,7 @@ struct lttng_payload_view;
  * On success, return the number of bytes consumed from `view`, and the created
  * action in `*action`. On failure, return -1.
  */
-extern ssize_t lttng_action_stop_session_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_action **action);
+extern ssize_t lttng_action_stop_session_create_from_payload(struct lttng_payload_view *view,
+                                                            struct lttng_action **action);
 
 #endif /* LTTNG_ACTION_STOP_SESSION_INTERNAL_H */
index 5b223ef23fbfa846a893b5a266801388a8f87941..b4a82a229353106521086cf9f168d84198ecf3f6 100644 (file)
@@ -33,15 +33,16 @@ LTTNG_EXPORT extern struct lttng_action *lttng_action_stop_session_create(void);
  * Set the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_STOP_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_stop_session_set_session_name(
-               struct lttng_action *action, const char *session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_stop_session_set_session_name(struct lttng_action *action, const char *session_name);
 
 /*
  * Get the session name of an lttng_action object of type
  * LTTNG_ACTION_TYPE_STOP_SESSION.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_stop_session_get_session_name(
-               const struct lttng_action *action, const char **session_name);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_stop_session_get_session_name(const struct lttng_action *action,
+                                          const char **session_name);
 
 /*
  * Set the rate policy of a stop session action.
@@ -50,9 +51,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_stop_session_get_sessi
  * LTTNG_ACTION_STATUS_ERROR on internal error,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_stop_session_set_rate_policy(
-               struct lttng_action *action,
-               const struct lttng_rate_policy *policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_stop_session_set_rate_policy(struct lttng_action *action,
+                                         const struct lttng_rate_policy *policy);
 
 /*
  * Get the rate policy of a stop session action.
@@ -60,9 +61,9 @@ LTTNG_EXPORT extern enum lttng_action_status lttng_action_stop_session_set_rate_
  * Returns LTTNG_ACTION_STATUS_OK on success,
  * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_action_status lttng_action_stop_session_get_rate_policy(
-               const struct lttng_action *action,
-               const struct lttng_rate_policy **policy);
+LTTNG_EXPORT extern enum lttng_action_status
+lttng_action_stop_session_get_rate_policy(const struct lttng_action *action,
+                                         const struct lttng_rate_policy **policy);
 
 #ifdef __cplusplus
 }
index 4a7a53bb43820bc5088349db2ad72463033d24ce..ec17e8a19bc7dafeb69038a324697c76b8fa90ae 100644 (file)
@@ -45,17 +45,14 @@ struct lttng_channel *lttng_channel_create_internal();
 struct lttng_channel *lttng_channel_copy(const struct lttng_channel *src);
 
 ssize_t lttng_channel_create_from_buffer(const struct lttng_buffer_view *view,
-               struct lttng_channel **event);
+                                        struct lttng_channel **event);
 
-int lttng_channel_serialize(struct lttng_channel *channel,
-               struct lttng_dynamic_buffer *buf);
+int lttng_channel_serialize(struct lttng_channel *channel, struct lttng_dynamic_buffer *buf);
 
 void lttng_channel_set_default_extended_attr(struct lttng_domain *domain,
-               struct lttng_channel_extended *extended_attr);
+                                            struct lttng_channel_extended *extended_attr);
 
 enum lttng_error_code lttng_channels_create_and_flatten_from_buffer(
-               const struct lttng_buffer_view *view,
-               unsigned int count,
-               struct lttng_channel **channels);
+       const struct lttng_buffer_view *view, unsigned int count, struct lttng_channel **channels);
 
 #endif /* LTTNG_CHANNEL_INTERNAL_H */
index 62e202d2659fb00ad49cc6b14113f36b2035b0a4..3d175b8a4b7312fcc94349a740d2cc81831b486a 100644 (file)
@@ -11,6 +11,7 @@
 #include <lttng/domain.h>
 #include <lttng/event.h>
 #include <lttng/lttng-export.h>
+
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -22,19 +23,19 @@ extern "C" {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_CHANNEL_ATTR_PADDING1        LTTNG_SYMBOL_NAME_LEN + 12
+#define LTTNG_CHANNEL_ATTR_PADDING1 LTTNG_SYMBOL_NAME_LEN + 12
 struct lttng_channel_attr {
-       int overwrite;                      /* -1: session default, 1: overwrite, 0: discard */
-       uint64_t subbuf_size;               /* bytes, power of 2 */
-       uint64_t num_subbuf;                /* power of 2 */
+       int overwrite; /* -1: session default, 1: overwrite, 0: discard */
+       uint64_t subbuf_size; /* bytes, power of 2 */
+       uint64_t num_subbuf; /* power of 2 */
        unsigned int switch_timer_interval; /* usec */
-       unsigned int read_timer_interval;   /* usec */
-       enum lttng_event_output output;     /* splice, mmap */
+       unsigned int read_timer_interval; /* usec */
+       enum lttng_event_output output; /* splice, mmap */
        /* LTTng 2.1 padding limit */
-       uint64_t tracefile_size;            /* bytes */
-       uint64_t tracefile_count;           /* number of tracefiles */
+       uint64_t tracefile_size; /* bytes */
+       uint64_t tracefile_count; /* number of tracefiles */
        /* LTTng 2.3 padding limit */
-       unsigned int live_timer_interval;   /* usec */
+       unsigned int live_timer_interval; /* usec */
        /* LTTng 2.7 padding limit */
        uint32_t align_to_64;
        union {
@@ -50,7 +51,7 @@ struct lttng_channel_attr {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_CHANNEL_PADDING1             16
+#define LTTNG_CHANNEL_PADDING1 16
 struct lttng_channel {
        char name[LTTNG_SYMBOL_NAME_LEN];
        uint32_t enabled;
@@ -76,7 +77,7 @@ LTTNG_EXPORT extern void lttng_channel_destroy(struct lttng_channel *channel);
  * must free channels. On error, a negative LTTng error code is returned.
  */
 LTTNG_EXPORT extern int lttng_list_channels(struct lttng_handle *handle,
-               struct lttng_channel **channels);
+                                           struct lttng_channel **channels);
 
 /*
  * Create or enable a channel.
@@ -86,7 +87,7 @@ LTTNG_EXPORT extern int lttng_list_channels(struct lttng_handle *handle,
  * Return 0 on success else a negative LTTng error code.
  */
 LTTNG_EXPORT extern int lttng_enable_channel(struct lttng_handle *handle,
-               struct lttng_channel *chan);
+                                            struct lttng_channel *chan);
 
 /*
  * Disable channel.
@@ -95,8 +96,7 @@ LTTNG_EXPORT extern int lttng_enable_channel(struct lttng_handle *handle,
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_disable_channel(struct lttng_handle *handle,
-               const char *name);
+LTTNG_EXPORT extern int lttng_disable_channel(struct lttng_handle *handle, const char *name);
 
 /*
  * Set the default channel attributes for a specific domain and an allocated
@@ -105,7 +105,7 @@ LTTNG_EXPORT extern int lttng_disable_channel(struct lttng_handle *handle,
  * If one or both arguments are NULL, nothing happens.
  */
 LTTNG_EXPORT extern void lttng_channel_set_default_attr(struct lttng_domain *domain,
-               struct lttng_channel_attr *attr);
+                                                       struct lttng_channel_attr *attr);
 
 /*
  * Get the discarded event count of a specific LTTng channel.
@@ -113,7 +113,7 @@ LTTNG_EXPORT extern void lttng_channel_set_default_attr(struct lttng_domain *dom
  * Returns 0 on success, or a negative LTTng error code on error.
  */
 LTTNG_EXPORT extern int lttng_channel_get_discarded_event_count(struct lttng_channel *chan,
-               uint64_t *discarded_events);
+                                                               uint64_t *discarded_events);
 
 /*
  * Get the lost packet count of a specific LTTng channel.
@@ -121,19 +121,19 @@ LTTNG_EXPORT extern int lttng_channel_get_discarded_event_count(struct lttng_cha
  * Returns 0 on success, or a negative LTTng error code on error.
  */
 LTTNG_EXPORT extern int lttng_channel_get_lost_packet_count(struct lttng_channel *chan,
-               uint64_t *lost_packets);
+                                                           uint64_t *lost_packets);
 
 LTTNG_EXPORT extern int lttng_channel_get_monitor_timer_interval(struct lttng_channel *chan,
-               uint64_t *monitor_timer_interval);
+                                                                uint64_t *monitor_timer_interval);
 
 LTTNG_EXPORT extern int lttng_channel_set_monitor_timer_interval(struct lttng_channel *chan,
-               uint64_t monitor_timer_interval);
+                                                                uint64_t monitor_timer_interval);
 
 LTTNG_EXPORT extern int lttng_channel_get_blocking_timeout(struct lttng_channel *chan,
-               int64_t *blocking_timeout);
+                                                          int64_t *blocking_timeout);
 
 LTTNG_EXPORT extern int lttng_channel_set_blocking_timeout(struct lttng_channel *chan,
-               int64_t blocking_timeout);
+                                                          int64_t blocking_timeout);
 
 #ifdef __cplusplus
 }
index e07e6c47f502a4991599d5a75887de4713d3d676..4fc5695ed9a77d8caf3355d0b81e47e107f0766a 100644 (file)
@@ -54,8 +54,7 @@ LTTNG_EXPORT extern void lttng_clear_handle_destroy(struct lttng_clear_handle *h
  * operation completed successfully.
  */
 LTTNG_EXPORT extern enum lttng_clear_handle_status
-       lttng_clear_handle_wait_for_completion(
-               struct lttng_clear_handle *handle, int timeout_ms);
+lttng_clear_handle_wait_for_completion(struct lttng_clear_handle *handle, int timeout_ms);
 
 /*
  * Get the result of a session clear operation.
@@ -73,9 +72,8 @@ LTTNG_EXPORT extern enum lttng_clear_handle_status
  * invalid (e.g. NULL).
  */
 LTTNG_EXPORT extern enum lttng_clear_handle_status
-       lttng_clear_handle_get_result(
-               const struct lttng_clear_handle *handle,
-               enum lttng_error_code *result);
+lttng_clear_handle_get_result(const struct lttng_clear_handle *handle,
+                             enum lttng_error_code *result);
 #ifdef __cplusplus
 }
 #endif
index 5dfd5db583caccef22f07d3e8869ae465c9a6f19..8961e166fb0d122c82c00a92291f0306c9795814 100644 (file)
@@ -54,9 +54,9 @@ struct lttng_clear_handle;
  *    LTTNG_ERR_CLEAR_RELAY_DISALLOWED
  *    LTTNG_ERR_CLEAR_NOT_AVAILABLE_RELAY
  *    LTTNG_ERR_CLEAR_FAIL_CONSUMER
-*/
+ */
 LTTNG_EXPORT extern enum lttng_error_code lttng_clear_session(const char *session_name,
-               struct lttng_clear_handle **handle);
+                                                             struct lttng_clear_handle **handle);
 #ifdef __cplusplus
 }
 #endif
index b2e6f85c19b88d06157de95f634e9c48d62cded2..25c91d1761c2f3e7cf5f50c9f0222f6c4dc5110b 100644 (file)
@@ -8,12 +8,14 @@
 #ifndef LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
 #define LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
 
+#include "common/buffer-view.hpp"
+
+#include <common/macros.hpp>
+
 #include <lttng/condition/buffer-usage.h>
 #include <lttng/condition/condition-internal.hpp>
 #include <lttng/condition/evaluation-internal.hpp>
 #include <lttng/domain.h>
-#include "common/buffer-view.hpp"
-#include <common/macros.hpp>
 
 struct lttng_condition_buffer_usage {
        struct lttng_condition parent;
@@ -57,24 +59,21 @@ struct lttng_evaluation_buffer_usage_comm {
        uint64_t buffer_capacity;
 } LTTNG_PACKED;
 
-struct lttng_evaluation *lttng_evaluation_buffer_usage_create(
-               enum lttng_condition_type type, uint64_t use,
-               uint64_t capacity);
+struct lttng_evaluation *lttng_evaluation_buffer_usage_create(enum lttng_condition_type type,
+                                                             uint64_t use,
+                                                             uint64_t capacity);
 
-ssize_t lttng_condition_buffer_usage_low_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t lttng_condition_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
+                                                            struct lttng_condition **condition);
 
-ssize_t lttng_condition_buffer_usage_high_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t lttng_condition_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
+                                                             struct lttng_condition **condition);
 
-ssize_t lttng_evaluation_buffer_usage_low_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **evaluation);
+ssize_t lttng_evaluation_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
+                                                             struct lttng_evaluation **evaluation);
 
-ssize_t lttng_evaluation_buffer_usage_high_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **evaluation);
+ssize_t
+lttng_evaluation_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
+                                                      struct lttng_evaluation **evaluation);
 
 #endif /* LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H */
index dcdb7ca1f091c18ae47d68f1f8c29caed14076bb..198f3e65768198fec1148fe232fa269d42b601e5 100644 (file)
@@ -8,12 +8,13 @@
 #ifndef LTTNG_CONDITION_BUFFER_USAGE_H
 #define LTTNG_CONDITION_BUFFER_USAGE_H
 
-#include <lttng/condition/evaluation.h>
 #include <lttng/condition/condition.h>
-#include <stdint.h>
+#include <lttng/condition/evaluation.h>
 #include <lttng/domain.h>
 #include <lttng/lttng-export.h>
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -57,8 +58,7 @@ extern "C" {
  * Returns a new condition on success, NULL on failure. This condition must be
  * destroyed using lttng_condition_destroy().
  */
-LTTNG_EXPORT extern struct lttng_condition *
-lttng_condition_buffer_usage_low_create(void);
+LTTNG_EXPORT extern struct lttng_condition *lttng_condition_buffer_usage_low_create(void);
 
 /*
  * Create a newly allocated upper-bound buffer usage condition.
@@ -73,8 +73,7 @@ lttng_condition_buffer_usage_low_create(void);
  * Returns a new condition on success, NULL on failure. This condition must be
  * destroyed using lttng_condition_destroy().
  */
-LTTNG_EXPORT extern struct lttng_condition *
-lttng_condition_buffer_usage_high_create(void);
+LTTNG_EXPORT extern struct lttng_condition *lttng_condition_buffer_usage_high_create(void);
 
 /*
  * Get the buffer usage threshold ratio of a buffer usage condition.
@@ -89,9 +88,8 @@ lttng_condition_buffer_usage_high_create(void);
  * call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_get_threshold_ratio(
-               const struct lttng_condition *condition,
-               double *threshold_ratio);
+lttng_condition_buffer_usage_get_threshold_ratio(const struct lttng_condition *condition,
+                                                double *threshold_ratio);
 
 /*
  * Set the buffer usage threshold ratio of a buffer usage condition.
@@ -105,9 +103,8 @@ lttng_condition_buffer_usage_get_threshold_ratio(
  * if invalid paramenters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_set_threshold_ratio(
-               struct lttng_condition *condition,
-               double threshold_ratio);
+lttng_condition_buffer_usage_set_threshold_ratio(struct lttng_condition *condition,
+                                                double threshold_ratio);
 
 /*
  * Get the buffer usage threshold of a buffer usage condition.
@@ -121,9 +118,8 @@ lttng_condition_buffer_usage_set_threshold_ratio(
  * bytes, was not set prior to this call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_get_threshold(
-               const struct lttng_condition *condition,
-               uint64_t *threshold_bytes);
+lttng_condition_buffer_usage_get_threshold(const struct lttng_condition *condition,
+                                          uint64_t *threshold_bytes);
 
 /*
  * Set the buffer usage threshold in bytes of a buffer usage condition.
@@ -135,9 +131,8 @@ lttng_condition_buffer_usage_get_threshold(
  * if invalid paramenters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_set_threshold(
-               struct lttng_condition *condition,
-               uint64_t threshold_bytes);
+lttng_condition_buffer_usage_set_threshold(struct lttng_condition *condition,
+                                          uint64_t threshold_bytes);
 
 /*
  * Get the session name property of a buffer usage condition.
@@ -152,9 +147,8 @@ lttng_condition_buffer_usage_set_threshold(
  * was not set prior to this call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_get_session_name(
-               const struct lttng_condition *condition,
-               const char **session_name);
+lttng_condition_buffer_usage_get_session_name(const struct lttng_condition *condition,
+                                             const char **session_name);
 
 /*
  * Set the session name property of a buffer usage condition.
@@ -165,9 +159,8 @@ lttng_condition_buffer_usage_get_session_name(
  * if invalid paramenters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_set_session_name(
-               struct lttng_condition *condition,
-               const char *session_name);
+lttng_condition_buffer_usage_set_session_name(struct lttng_condition *condition,
+                                             const char *session_name);
 
 /*
  * Get the channel name property of a buffer usage condition.
@@ -182,9 +175,8 @@ lttng_condition_buffer_usage_set_session_name(
  * was not set prior to this call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_get_channel_name(
-               const struct lttng_condition *condition,
-               const char **channel_name);
+lttng_condition_buffer_usage_get_channel_name(const struct lttng_condition *condition,
+                                             const char **channel_name);
 
 /*
  * Set the channel name property of a buffer usage condition.
@@ -195,9 +187,8 @@ lttng_condition_buffer_usage_get_channel_name(
  * if invalid paramenters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_set_channel_name(
-               struct lttng_condition *condition,
-               const char *channel_name);
+lttng_condition_buffer_usage_set_channel_name(struct lttng_condition *condition,
+                                             const char *channel_name);
 
 /*
  * Get the domain type property of a buffer usage condition.
@@ -208,9 +199,8 @@ lttng_condition_buffer_usage_set_channel_name(
  * call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_get_domain_type(
-               const struct lttng_condition *condition,
-               enum lttng_domain_type *type);
+lttng_condition_buffer_usage_get_domain_type(const struct lttng_condition *condition,
+                                            enum lttng_domain_type *type);
 
 /*
  * Set the domain type property of a buffer usage condition.
@@ -219,10 +209,8 @@ lttng_condition_buffer_usage_get_domain_type(
  * if invalid paramenters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_buffer_usage_set_domain_type(
-               struct lttng_condition *condition,
-               enum lttng_domain_type type);
-
+lttng_condition_buffer_usage_set_domain_type(struct lttng_condition *condition,
+                                            enum lttng_domain_type type);
 
 /**
  * lttng_evaluation_buffer_usage are specialised lttng_evaluations which
@@ -242,9 +230,8 @@ lttng_condition_buffer_usage_set_domain_type(
  * an invalid parameter is passed.
  */
 LTTNG_EXPORT extern enum lttng_evaluation_status
-lttng_evaluation_buffer_usage_get_usage_ratio(
-               const struct lttng_evaluation *evaluation,
-               double *usage_ratio);
+lttng_evaluation_buffer_usage_get_usage_ratio(const struct lttng_evaluation *evaluation,
+                                             double *usage_ratio);
 
 /*
  * Get the buffer usage property of a buffer usage evaluation.
@@ -253,9 +240,8 @@ lttng_evaluation_buffer_usage_get_usage_ratio(
  * bytes, or LTTNG_EVALUATION_STATUS_INVALID if an invalid parameter is passed.
  */
 LTTNG_EXPORT extern enum lttng_evaluation_status
-lttng_evaluation_buffer_usage_get_usage(
-               const struct lttng_evaluation *evaluation,
-               uint64_t *usage_bytes);
+lttng_evaluation_buffer_usage_get_usage(const struct lttng_evaluation *evaluation,
+                                       uint64_t *usage_bytes);
 
 #ifdef __cplusplus
 }
index 2fac62913101745440e36a39d2a142e6a35126fe..c69ae2a21c4aa65e7432741423b7c1469113358b 100644 (file)
 #include <common/macros.hpp>
 #include <common/payload-view.hpp>
 #include <common/payload.hpp>
+
 #include <lttng/condition/condition.h>
 #include <lttng/lttng-error.h>
+
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
@@ -53,27 +55,23 @@ void lttng_condition_get(struct lttng_condition *condition);
 
 void lttng_condition_put(struct lttng_condition *condition);
 
-void lttng_condition_init(struct lttng_condition *condition,
-               enum lttng_condition_type type);
+void lttng_condition_init(struct lttng_condition *condition, enum lttng_condition_type type);
 
 bool lttng_condition_validate(const struct lttng_condition *condition);
 
-ssize_t lttng_condition_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t lttng_condition_create_from_payload(struct lttng_payload_view *view,
+                                           struct lttng_condition **condition);
 
 int lttng_condition_serialize(const struct lttng_condition *condition,
-               struct lttng_payload *payload);
+                             struct lttng_payload *payload);
 
-bool lttng_condition_is_equal(const struct lttng_condition *a,
-               const struct lttng_condition *b);
+bool lttng_condition_is_equal(const struct lttng_condition *a, const struct lttng_condition *b);
 
-enum lttng_error_code lttng_condition_mi_serialize(
-               const struct lttng_trigger *trigger,
-               const struct lttng_condition *condition,
-               struct mi_writer *writer,
-               const struct mi_lttng_error_query_callbacks
-                               *error_query_callbacks);
+enum lttng_error_code
+lttng_condition_mi_serialize(const struct lttng_trigger *trigger,
+                            const struct lttng_condition *condition,
+                            struct mi_writer *writer,
+                            const struct mi_lttng_error_query_callbacks *error_query_callbacks);
 
 const char *lttng_condition_type_str(enum lttng_condition_type type);
 
index f0f5ffdd86cfc149035c6877612859c2a23a50dd..13a09c19a912e79d0cf3d817b689f2b3021f3610 100644 (file)
@@ -41,8 +41,8 @@ enum lttng_condition_status {
  * Returns the type of a condition on success, LTTNG_CONDITION_TYPE_UNKNOWN on
  * error.
  */
-LTTNG_EXPORT extern enum lttng_condition_type lttng_condition_get_type(
-               const struct lttng_condition *condition);
+LTTNG_EXPORT extern enum lttng_condition_type
+lttng_condition_get_type(const struct lttng_condition *condition);
 
 /*
  * Destroy (release) a condition object.
index ed2c5735f3de2fe73c2ab7a67fe41b3920f4375f..36dc3a544c5e789239a81c409ecf557847433c7b 100644 (file)
@@ -8,9 +8,11 @@
 #ifndef LTTNG_EVALUATION_INTERNAL_H
 #define LTTNG_EVALUATION_INTERNAL_H
 
-#include <lttng/condition/evaluation.h>
-#include <lttng/condition/condition.h>
 #include <common/macros.hpp>
+
+#include <lttng/condition/condition.h>
+#include <lttng/condition/evaluation.h>
+
 #include <stdbool.h>
 #include <sys/types.h>
 
@@ -32,15 +34,13 @@ struct lttng_evaluation {
        evaluation_destroy_cb destroy;
 };
 
-void lttng_evaluation_init(struct lttng_evaluation *evaluation,
-               enum lttng_condition_type type);
+void lttng_evaluation_init(struct lttng_evaluation *evaluation, enum lttng_condition_type type);
 
-ssize_t lttng_evaluation_create_from_payload(
-               const struct lttng_condition *condition,
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **evaluation);
+ssize_t lttng_evaluation_create_from_payload(const struct lttng_condition *condition,
+                                            struct lttng_payload_view *view,
+                                            struct lttng_evaluation **evaluation);
 
 int lttng_evaluation_serialize(const struct lttng_evaluation *evaluation,
-               struct lttng_payload *payload);
+                              struct lttng_payload *payload);
 
 #endif /* LTTNG_EVALUATION_INTERNAL_H */
index 494cb9739be77bdb1515d2188ddf17e439f7081e..599bc35b320e525ebcaab20751ecfd87d8f16084 100644 (file)
@@ -31,8 +31,8 @@ enum lttng_evaluation_status {
  * Returns the type of a condition on success, LTTNG_CONDITION_TYPE_UNKNOWN on
  * error.
  */
-LTTNG_EXPORT extern enum lttng_condition_type lttng_evaluation_get_type(
-               const struct lttng_evaluation *evaluation);
+LTTNG_EXPORT extern enum lttng_condition_type
+lttng_evaluation_get_type(const struct lttng_evaluation *evaluation);
 
 /*
  * Destroy (frees) an evaluation object.
index bb7e03e21b51259c19faf11a91712948e09ceafc..22bfb9557cb331acd2bd8e14d5a3ea0ac9729f46 100644 (file)
@@ -8,12 +8,13 @@
 #ifndef LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H
 #define LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H
 
-#include <lttng/condition/condition-internal.hpp>
 #include <common/buffer-view.hpp>
+#include <common/dynamic-array.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+
+#include <lttng/condition/condition-internal.hpp>
 #include <lttng/condition/evaluation-internal.hpp>
-#include <common/dynamic-array.hpp>
 #include <lttng/event-field-value.h>
 
 struct lttng_capture_descriptor {
@@ -51,39 +52,34 @@ struct lttng_evaluation_event_rule_matches {
        struct lttng_event_field_value *captured_values;
 };
 
-ssize_t lttng_condition_event_rule_matches_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t lttng_condition_event_rule_matches_create_from_payload(struct lttng_payload_view *view,
+                                                              struct lttng_condition **condition);
 
 enum lttng_condition_status
-lttng_condition_event_rule_matches_borrow_rule_mutable(
-               const struct lttng_condition *condition,
-               struct lttng_event_rule **rule);
+lttng_condition_event_rule_matches_borrow_rule_mutable(const struct lttng_condition *condition,
+                                                      struct lttng_event_rule **rule);
 
-void lttng_condition_event_rule_matches_set_error_counter_index(
-               struct lttng_condition *condition,
-               uint64_t error_counter_index);
+void lttng_condition_event_rule_matches_set_error_counter_index(struct lttng_condition *condition,
+                                                               uint64_t error_counter_index);
 
-uint64_t lttng_condition_event_rule_matches_get_error_counter_index(
-               const struct lttng_condition *condition);
+uint64_t
+lttng_condition_event_rule_matches_get_error_counter_index(const struct lttng_condition *condition);
 
 struct lttng_evaluation *lttng_evaluation_event_rule_matches_create(
-               const struct lttng_condition_event_rule_matches *condition,
-               const char *capture_payload,
-               size_t capture_payload_size,
-               bool decode_capture_payload);
+       const struct lttng_condition_event_rule_matches *condition,
+       const char *capture_payload,
+       size_t capture_payload_size,
+       bool decode_capture_payload);
 
 ssize_t lttng_evaluation_event_rule_matches_create_from_payload(
-               const struct lttng_condition_event_rule_matches *condition,
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **_evaluation);
+       const struct lttng_condition_event_rule_matches *condition,
+       struct lttng_payload_view *view,
+       struct lttng_evaluation **_evaluation);
 
-enum lttng_error_code
-lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
-               struct lttng_condition *condition);
+enum lttng_error_code lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
+       struct lttng_condition *condition);
 
-const struct lttng_bytecode *
-lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
-               const struct lttng_condition *condition, unsigned int index);
+const struct lttng_bytecode *lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
+       const struct lttng_condition *condition, unsigned int index);
 
 #endif /* LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H */
index b1bbe08f3321015728783d190e1be34f027f744e..c579a1864cd6f43d7304b1e5cff87f06d6e49c52 100644 (file)
@@ -8,9 +8,9 @@
 #ifndef LTTNG_CONDITION_EVENT_RULE_MATCHES_H
 #define LTTNG_CONDITION_EVENT_RULE_MATCHES_H
 
-#include <lttng/event-rule/event-rule.h>
 #include <lttng/condition/condition.h>
 #include <lttng/condition/evaluation.h>
+#include <lttng/event-rule/event-rule.h>
 #include <lttng/lttng-export.h>
 
 #ifdef __cplusplus
@@ -43,8 +43,8 @@ enum lttng_evaluation_event_rule_matches_status {
  * Returns a new condition on success, NULL on failure. This condition must be
  * destroyed using lttng_condition_destroy().
  */
-LTTNG_EXPORT extern struct lttng_condition *lttng_condition_event_rule_matches_create(
-               struct lttng_event_rule *rule);
+LTTNG_EXPORT extern struct lttng_condition *
+lttng_condition_event_rule_matches_create(struct lttng_event_rule *rule);
 
 /*
  * Get the rule property of an Event Rule Matches condition.
@@ -56,9 +56,9 @@ LTTNG_EXPORT extern struct lttng_condition *lttng_condition_event_rule_matches_c
  * Returns LTTNG_CONDITION_STATUS_OK and a pointer to the condition's rule
  * on success, LTTNG_CONDITION_STATUS_INVALID if an invalid
  * parameter is passed. */
-LTTNG_EXPORT extern enum lttng_condition_status lttng_condition_event_rule_matches_get_rule(
-               const struct lttng_condition *condition,
-               const struct lttng_event_rule **rule);
+LTTNG_EXPORT extern enum lttng_condition_status
+lttng_condition_event_rule_matches_get_rule(const struct lttng_condition *condition,
+                                           const struct lttng_event_rule **rule);
 
 /**
  * lttng_evaluation_event_rule_matches_hit are specialised lttng_evaluations
@@ -92,8 +92,8 @@ LTTNG_EXPORT extern enum lttng_condition_status lttng_condition_event_rule_match
  */
 LTTNG_EXPORT extern enum lttng_evaluation_event_rule_matches_status
 lttng_evaluation_event_rule_matches_get_captured_values(
-               const struct lttng_evaluation *evaluation,
-               const struct lttng_event_field_value **field_val);
+       const struct lttng_evaluation *evaluation,
+       const struct lttng_event_field_value **field_val);
 
 /*
  * Appends (transfering the ownership) the capture descriptor `expr` to
@@ -124,9 +124,8 @@ lttng_evaluation_event_rule_matches_get_captured_values(
  *     * The associated event-rule does not support runtime capture.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_event_rule_matches_append_capture_descriptor(
-               struct lttng_condition *condition,
-               struct lttng_event_expr *expr);
+lttng_condition_event_rule_matches_append_capture_descriptor(struct lttng_condition *condition,
+                                                            struct lttng_event_expr *expr);
 
 /*
  * Sets `*count` to the number of capture descriptors in the Event Rule Matches
@@ -145,7 +144,7 @@ lttng_condition_event_rule_matches_append_capture_descriptor(
  */
 LTTNG_EXPORT extern enum lttng_condition_status
 lttng_condition_event_rule_matches_get_capture_descriptor_count(
-               const struct lttng_condition *condition, unsigned int *count);
+       const struct lttng_condition *condition, unsigned int *count);
 
 /*
  * Returns the capture descriptor (borrowed) of the Event Rule Matches condition
@@ -160,7 +159,7 @@ lttng_condition_event_rule_matches_get_capture_descriptor_count(
  */
 LTTNG_EXPORT extern const struct lttng_event_expr *
 lttng_condition_event_rule_matches_get_capture_descriptor_at_index(
-               const struct lttng_condition *condition, unsigned int index);
+       const struct lttng_condition *condition, unsigned int index);
 
 #ifdef __cplusplus
 }
index cdfa100346c134f24800f6d2e3aa0bc04c0f61f0..e49a608143b1f9aaf640c4746a04fc984337417e 100644 (file)
@@ -8,12 +8,13 @@
 #ifndef LTTNG_CONDITION_SESSION_CONSUMED_SIZE_INTERNAL_H
 #define LTTNG_CONDITION_SESSION_CONSUMED_SIZE_INTERNAL_H
 
-#include <lttng/condition/session-consumed-size.h>
-#include <lttng/condition/condition-internal.hpp>
-#include <lttng/condition/evaluation-internal.hpp>
 #include <common/buffer-view.hpp>
 #include <common/macros.hpp>
 
+#include <lttng/condition/condition-internal.hpp>
+#include <lttng/condition/evaluation-internal.hpp>
+#include <lttng/condition/session-consumed-size.h>
+
 struct lttng_payload;
 struct lttng_payload_view;
 
@@ -42,15 +43,14 @@ struct lttng_evaluation_session_consumed_size_comm {
        uint64_t session_consumed;
 } LTTNG_PACKED;
 
-struct lttng_evaluation *lttng_evaluation_session_consumed_size_create(
-               uint64_t consumed);
+struct lttng_evaluation *lttng_evaluation_session_consumed_size_create(uint64_t consumed);
 
-ssize_t lttng_condition_session_consumed_size_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t
+lttng_condition_session_consumed_size_create_from_payload(struct lttng_payload_view *view,
+                                                         struct lttng_condition **condition);
 
-ssize_t lttng_evaluation_session_consumed_size_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **evaluation);
+ssize_t
+lttng_evaluation_session_consumed_size_create_from_payload(struct lttng_payload_view *view,
+                                                          struct lttng_evaluation **evaluation);
 
 #endif /* LTTNG_CONDITION_SESSION_CONSUMED_SIZE_INTERNAL_H */
index 4d52cb68936bae93513d4ed98879e9aa36834481..98284c748c841bba487fec8d7c558ba24243d796 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_CONDITION_SESSION_CONSUMED_SIZE_H
 #define LTTNG_CONDITION_SESSION_CONSUMED_SIZE_H
 
-#include <lttng/condition/evaluation.h>
 #include <lttng/condition/condition.h>
+#include <lttng/condition/evaluation.h>
 #include <lttng/lttng-export.h>
+
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -43,8 +44,7 @@ extern "C" {
  * Returns a new condition on success, NULL on failure. This condition must be
  * destroyed using lttng_condition_destroy().
  */
-LTTNG_EXPORT extern struct lttng_condition *
-lttng_condition_session_consumed_size_create(void);
+LTTNG_EXPORT extern struct lttng_condition *lttng_condition_session_consumed_size_create(void);
 
 /*
  * Get the threshold of a session consumed size condition.
@@ -58,9 +58,8 @@ lttng_condition_session_consumed_size_create(void);
  * bytes, was not set prior to this call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_session_consumed_size_get_threshold(
-               const struct lttng_condition *condition,
-               uint64_t *consumed_threshold_bytes);
+lttng_condition_session_consumed_size_get_threshold(const struct lttng_condition *condition,
+                                                   uint64_t *consumed_threshold_bytes);
 
 /*
  * Set the threshold of a session consumed size usage condition.
@@ -71,9 +70,8 @@ lttng_condition_session_consumed_size_get_threshold(
  * if invalid parameters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_session_consumed_size_set_threshold(
-               struct lttng_condition *condition,
-               uint64_t consumed_threshold_bytes);
+lttng_condition_session_consumed_size_set_threshold(struct lttng_condition *condition,
+                                                   uint64_t consumed_threshold_bytes);
 
 /*
  * Get the session name property of a session consumed size condition.
@@ -88,9 +86,8 @@ lttng_condition_session_consumed_size_set_threshold(
  * was not set prior to this call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_session_consumed_size_get_session_name(
-               const struct lttng_condition *condition,
-               const char **session_name);
+lttng_condition_session_consumed_size_get_session_name(const struct lttng_condition *condition,
+                                                      const char **session_name);
 
 /*
  * Set the session name property of a session consumed size condition.
@@ -101,9 +98,8 @@ lttng_condition_session_consumed_size_get_session_name(
  * if invalid parameters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_session_consumed_size_set_session_name(
-               struct lttng_condition *condition,
-               const char *session_name);
+lttng_condition_session_consumed_size_set_session_name(struct lttng_condition *condition,
+                                                      const char *session_name);
 
 /**
  * lttng_evaluation_session_consumed_size is specialised lttng_evaluations
@@ -118,9 +114,8 @@ lttng_condition_session_consumed_size_set_session_name(
  * bytes, or LTTNG_EVALUATION_STATUS_INVALID if an invalid parameter is passed.
  */
 LTTNG_EXPORT extern enum lttng_evaluation_status
-lttng_evaluation_session_consumed_size_get_consumed_size(
-               const struct lttng_evaluation *evaluation,
-               uint64_t *session_consumed);
+lttng_evaluation_session_consumed_size_get_consumed_size(const struct lttng_evaluation *evaluation,
+                                                        uint64_t *session_consumed);
 
 #ifdef __cplusplus
 }
index e9a2984450f4104bd18966f95bd1ba78b1c372c1..a3d14b493113921fdc248ae58af24c920613a87a 100644 (file)
@@ -8,12 +8,14 @@
 #ifndef LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H
 #define LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H
 
-#include <lttng/condition/session-rotation.h>
+#include "common/buffer-view.hpp"
+
+#include <common/macros.hpp>
+
 #include <lttng/condition/condition-internal.hpp>
 #include <lttng/condition/evaluation-internal.hpp>
-#include "common/buffer-view.hpp"
+#include <lttng/condition/session-rotation.h>
 #include <lttng/location.h>
-#include <common/macros.hpp>
 
 struct lttng_condition_session_rotation {
        struct lttng_condition parent;
@@ -37,28 +39,26 @@ struct lttng_evaluation_session_rotation_comm {
        uint8_t has_location;
 } LTTNG_PACKED;
 
-ssize_t lttng_condition_session_rotation_ongoing_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t
+lttng_condition_session_rotation_ongoing_create_from_payload(struct lttng_payload_view *view,
+                                                            struct lttng_condition **condition);
 
-ssize_t lttng_condition_session_rotation_completed_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_condition **condition);
+ssize_t
+lttng_condition_session_rotation_completed_create_from_payload(struct lttng_payload_view *view,
+                                                              struct lttng_condition **condition);
 
-struct lttng_evaluation *lttng_evaluation_session_rotation_ongoing_create(
-                uint64_t id);
+struct lttng_evaluation *lttng_evaluation_session_rotation_ongoing_create(uint64_t id);
 
 /* Ownership of location is transferred to the evaluation. */
-struct lttng_evaluation *lttng_evaluation_session_rotation_completed_create(
-               uint64_t id,
-               struct lttng_trace_archive_location *location);
+struct lttng_evaluation *
+lttng_evaluation_session_rotation_completed_create(uint64_t id,
+                                                  struct lttng_trace_archive_location *location);
 
-ssize_t lttng_evaluation_session_rotation_ongoing_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **evaluation);
+ssize_t
+lttng_evaluation_session_rotation_ongoing_create_from_payload(struct lttng_payload_view *view,
+                                                             struct lttng_evaluation **evaluation);
 
 ssize_t lttng_evaluation_session_rotation_completed_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_evaluation **evaluation);
+       struct lttng_payload_view *view, struct lttng_evaluation **evaluation);
 
 #endif /* LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H */
index 086fff915fd5ad0d225fd388afef403b81d7fcb9..6e6207fb28e0d689790bc19f1301278b1c91de73 100644 (file)
@@ -8,13 +8,14 @@
 #ifndef LTTNG_CONDITION_SESSION_ROTATION_H
 #define LTTNG_CONDITION_SESSION_ROTATION_H
 
-#include <lttng/condition/evaluation.h>
 #include <lttng/condition/condition.h>
-#include <stdint.h>
+#include <lttng/condition/evaluation.h>
 #include <lttng/domain.h>
 #include <lttng/location.h>
 #include <lttng/lttng-export.h>
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -39,8 +40,7 @@ extern "C" {
  * Returns a new condition on success, NULL on failure. This condition must be
  * destroyed using lttng_condition_destroy().
  */
-LTTNG_EXPORT extern struct lttng_condition *
-lttng_condition_session_rotation_ongoing_create(void);
+LTTNG_EXPORT extern struct lttng_condition *lttng_condition_session_rotation_ongoing_create(void);
 
 /*
  * Create a newly allocated session rotation completion condition.
@@ -54,8 +54,7 @@ lttng_condition_session_rotation_ongoing_create(void);
  * Returns a new condition on success, NULL on failure. This condition must be
  * destroyed using lttng_condition_destroy().
  */
-LTTNG_EXPORT extern struct lttng_condition *
-lttng_condition_session_rotation_completed_create(void);
+LTTNG_EXPORT extern struct lttng_condition *lttng_condition_session_rotation_completed_create(void);
 
 /*
  * Get the session name property of a session rotation condition.
@@ -70,9 +69,8 @@ lttng_condition_session_rotation_completed_create(void);
  * was not set prior to this call.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_session_rotation_get_session_name(
-               const struct lttng_condition *condition,
-               const char **session_name);
+lttng_condition_session_rotation_get_session_name(const struct lttng_condition *condition,
+                                                 const char **session_name);
 
 /*
  * Set the session name property of a session rotation condition.
@@ -83,9 +81,8 @@ lttng_condition_session_rotation_get_session_name(
  * if invalid paramenters are passed.
  */
 LTTNG_EXPORT extern enum lttng_condition_status
-lttng_condition_session_rotation_set_session_name(
-               struct lttng_condition *condition,
-               const char *session_name);
+lttng_condition_session_rotation_set_session_name(struct lttng_condition *condition,
+                                                 const char *session_name);
 
 /**
  * lttng_evaluation_session_rotation are specialised lttng_evaluations
@@ -101,8 +98,7 @@ lttng_condition_session_rotation_set_session_name(
  * passed.
  */
 LTTNG_EXPORT extern enum lttng_evaluation_status
-lttng_evaluation_session_rotation_get_id(
-               const struct lttng_evaluation *evaluation, uint64_t *id);
+lttng_evaluation_session_rotation_get_id(const struct lttng_evaluation *evaluation, uint64_t *id);
 
 /*
  * Get the session rotation location property of a session rotation completed
@@ -121,8 +117,8 @@ lttng_evaluation_session_rotation_get_id(
  */
 LTTNG_EXPORT extern enum lttng_evaluation_status
 lttng_evaluation_session_rotation_completed_get_location(
-               const struct lttng_evaluation *evaluation,
-               const struct lttng_trace_archive_location **location);
+       const struct lttng_evaluation *evaluation,
+       const struct lttng_trace_archive_location **location);
 
 #ifdef __cplusplus
 }
index 1b6f44d8bc95e5622019c7dfcec7b65dd7a52aef..2cbb4609566c174a7e5de91d3407608855ad4248 100644 (file)
@@ -9,9 +9,7 @@
 #define LTTNG_CONSTANT_H
 
 #ifndef LTTNG_DEPRECATED
-#if defined (__GNUC__) \
-       && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)  \
-                       || __GNUC__ >= 5)
+#if defined(__GNUC__) && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5) || __GNUC__ >= 5)
 #define LTTNG_DEPRECATED(msg) __attribute__((deprecated(msg)))
 #else
 #define LTTNG_DEPRECATED(msg) __attribute__((deprecated))
 /*
  * Event symbol length. Copied from LTTng kernel ABI.
  */
-#define LTTNG_SYMBOL_NAME_LEN                  256
+#define LTTNG_SYMBOL_NAME_LEN 256
 
 /*
  * PROC(5) mentions that PID_MAX_LIMIT may not exceed 2^22 on 64-bit HW.
  * We prefer to use 32-bits for simplicity's sake.
  */
-#define LTTNG_MAX_PID                          INT32_MAX
-#define LTTNG_MAX_PID_STR                      "2147483647"
+#define LTTNG_MAX_PID    INT32_MAX
+#define LTTNG_MAX_PID_STR "2147483647"
 
-#define LTTNG_NAME_MAX                         255
+#define LTTNG_NAME_MAX 255
 
 /*
  * POSIX guarantees that a host name will not exceed 255 characters.
@@ -53,8 +51,8 @@
  *
  * 256 is used to include a trailing NULL character.
  */
-#define LTTNG_HOST_NAME_MAX                    256
+#define LTTNG_HOST_NAME_MAX 256
 
-#define LTTNG_PATH_MAX                         4096
+#define LTTNG_PATH_MAX 4096
 
 #endif /* LTTNG_CONSTANT_H */
index 6fa4339ac921cb776864e1dd9fdf9a763012f494..d14bc16a883b0ad743ecb9fdc5b0c4015d7d25cc 100644 (file)
@@ -8,9 +8,9 @@
 #ifndef LTTNG_DESTRUCTION_HANDLE_H
 #define LTTNG_DESTRUCTION_HANDLE_H
 
-#include <lttng/rotation.h>
 #include <lttng/lttng-error.h>
 #include <lttng/lttng-export.h>
+#include <lttng/rotation.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -44,8 +44,7 @@ enum lttng_destruction_handle_status {
  * Destroy an lttng_destruction_session handle.
  * The handle should be discarded after this call.
  */
-LTTNG_EXPORT extern void lttng_destruction_handle_destroy(
-               struct lttng_destruction_handle *handle);
+LTTNG_EXPORT extern void lttng_destruction_handle_destroy(struct lttng_destruction_handle *handle);
 
 /*
  * Wait for the destruction of a session to complete.
@@ -62,8 +61,8 @@ LTTNG_EXPORT extern void lttng_destruction_handle_destroy(
  * operation completed successfully.
  */
 LTTNG_EXPORT extern enum lttng_destruction_handle_status
-lttng_destruction_handle_wait_for_completion(
-               struct lttng_destruction_handle *handle, int timeout_ms);
+lttng_destruction_handle_wait_for_completion(struct lttng_destruction_handle *handle,
+                                            int timeout_ms);
 
 /*
  * Get the result of a session destruction operation.
@@ -81,9 +80,8 @@ lttng_destruction_handle_wait_for_completion(
  * invalid (e.g. NULL).
  */
 LTTNG_EXPORT extern enum lttng_destruction_handle_status
-lttng_destruction_handle_get_result(
-               const struct lttng_destruction_handle *handle,
-               enum lttng_error_code *result);
+lttng_destruction_handle_get_result(const struct lttng_destruction_handle *handle,
+                                   enum lttng_error_code *result);
 
 /*
  * Get the status of the session rotation performed as part of the session's
@@ -109,9 +107,8 @@ lttng_destruction_handle_get_result(
  * LTTNG_ROTATION_STATE_NO_ROTATION.
  */
 LTTNG_EXPORT extern enum lttng_destruction_handle_status
-lttng_destruction_handle_get_rotation_state(
-               const struct lttng_destruction_handle *handle,
-               enum lttng_rotation_state *rotation_state);
+lttng_destruction_handle_get_rotation_state(const struct lttng_destruction_handle *handle,
+                                           enum lttng_rotation_state *rotation_state);
 
 /*
  * Get the location of the archive resulting from the rotation performed during
@@ -133,9 +130,8 @@ lttng_destruction_handle_get_rotation_state(
  * invalid (e.g. NULL).
  */
 LTTNG_EXPORT extern enum lttng_destruction_handle_status
-lttng_destruction_handle_get_archive_location(
-               const struct lttng_destruction_handle *handle,
-               const struct lttng_trace_archive_location **location);
+lttng_destruction_handle_get_archive_location(const struct lttng_destruction_handle *handle,
+                                             const struct lttng_trace_archive_location **location);
 
 #ifdef __cplusplus
 }
index 4439c7825e1945668676f589bc28f660cdce7605..f41d61e84d32ad257ee6b3cc16e4165c1e2f1183 100644 (file)
@@ -8,8 +8,8 @@
 #ifndef LTTNG_DOMAIN_INTERNAL_H
 #define LTTNG_DOMAIN_INTERNAL_H
 
-#include "lttng/domain.h"
 #include "common/macros.hpp"
+#include "lttng/domain.h"
 
 const char *lttng_domain_type_str(enum lttng_domain_type domain_type);
 
index 192c04bf239458c0621ae3ca9ae1dd9bfe8267f7..90c949721831c67906ecf568013b7a442f6f4800 100644 (file)
@@ -19,26 +19,26 @@ extern "C" {
  * Domain types: the different possible tracers.
  */
 enum lttng_domain_type {
-       LTTNG_DOMAIN_NONE                     = 0,      /* No associated domain. */
-       LTTNG_DOMAIN_KERNEL                   = 1,      /* Linux Kernel tracer. */
-       LTTNG_DOMAIN_UST                      = 2,      /* Global Userspace tracer. */
-       LTTNG_DOMAIN_JUL                      = 3,      /* Java Util Logging. */
-       LTTNG_DOMAIN_LOG4J                    = 4,      /* Java Log4j Framework. */
-       LTTNG_DOMAIN_PYTHON                   = 5,      /* Python logging Framework. */
+       LTTNG_DOMAIN_NONE = 0, /* No associated domain. */
+       LTTNG_DOMAIN_KERNEL = 1, /* Linux Kernel tracer. */
+       LTTNG_DOMAIN_UST = 2, /* Global Userspace tracer. */
+       LTTNG_DOMAIN_JUL = 3, /* Java Util Logging. */
+       LTTNG_DOMAIN_LOG4J = 4, /* Java Log4j Framework. */
+       LTTNG_DOMAIN_PYTHON = 5, /* Python logging Framework. */
 };
 
 /* Buffer type for a specific domain. */
 enum lttng_buffer_type {
-       LTTNG_BUFFER_PER_PID,   /* Only supported by UST being the default. */
-       LTTNG_BUFFER_PER_UID,   /* Only supported by UST. */
-       LTTNG_BUFFER_GLOBAL,    /* Only supported by the Kernel. */
+       LTTNG_BUFFER_PER_PID, /* Only supported by UST being the default. */
+       LTTNG_BUFFER_PER_UID, /* Only supported by UST. */
+       LTTNG_BUFFER_GLOBAL, /* Only supported by the Kernel. */
 };
 
 /*
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_DOMAIN_PADDING1              12
-#define LTTNG_DOMAIN_PADDING2              LTTNG_SYMBOL_NAME_LEN + 32
+#define LTTNG_DOMAIN_PADDING1 12
+#define LTTNG_DOMAIN_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32
 struct lttng_domain {
        enum lttng_domain_type type;
        enum lttng_buffer_type buf_type;
@@ -59,8 +59,7 @@ struct lttng_domain {
  * Return the size (number of entries) of the "lttng_domain" array. Caller
  * must free domains. On error, a negative LTTng error code is returned.
  */
-LTTNG_EXPORT extern int lttng_list_domains(const char *session_name,
-               struct lttng_domain **domains);
+LTTNG_EXPORT extern int lttng_list_domains(const char *session_name, struct lttng_domain **domains);
 
 #ifdef __cplusplus
 }
index 5317f7ff5a5d2a0defede813dd8952bf86e45d5c..306a96a4723d27da2d0d172bb13086b32ab7a3e5 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_ENDPOINT_INTERNAL_H
 #define LTTNG_ENDPOINT_INTERNAL_H
 
-#include <lttng/endpoint.h>
 #include <common/macros.hpp>
 
+#include <lttng/endpoint.h>
+
 enum lttng_endpoint_type {
        LTTNG_ENDPOINT_TYPE_DEFAULT_SESSIOND_NOTIFICATION = 0,
        LTTNG_ENDPOINT_TYPE_DEFAULT_SESSIOND_COMMAND = 1,
index ece2b0ce9021b63c096be41c4fc51dd417cfffa2..4564b1070b753b59477424e920bc84f7c12a9887 100644 (file)
 #ifndef LTTNG_ERROR_QUERY_INTERNAL_H
 #define LTTNG_ERROR_QUERY_INTERNAL_H
 
-#include <lttng/lttng.h>
 #include <common/macros.hpp>
-#include <common/payload.hpp>
 #include <common/payload-view.hpp>
+#include <common/payload.hpp>
+
+#include <lttng/lttng.h>
 
 struct mi_writer;
 
@@ -23,59 +24,53 @@ enum lttng_error_query_target_type {
        LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION,
 };
 
-enum lttng_error_query_target_type lttng_error_query_get_target_type(
-               const struct lttng_error_query *query);
+enum lttng_error_query_target_type
+lttng_error_query_get_target_type(const struct lttng_error_query *query);
 
-const struct lttng_trigger *lttng_error_query_trigger_borrow_target(
-               const struct lttng_error_query *query);
+const struct lttng_trigger *
+lttng_error_query_trigger_borrow_target(const struct lttng_error_query *query);
 
-const struct lttng_trigger *lttng_error_query_condition_borrow_target(
-               const struct lttng_error_query *query);
+const struct lttng_trigger *
+lttng_error_query_condition_borrow_target(const struct lttng_error_query *query);
 
-const struct lttng_trigger *lttng_error_query_action_borrow_trigger_target(
-               const struct lttng_error_query *query);
+const struct lttng_trigger *
+lttng_error_query_action_borrow_trigger_target(const struct lttng_error_query *query);
 
-struct lttng_action *lttng_error_query_action_borrow_action_target(
-               const struct lttng_error_query *query,
-               struct lttng_trigger *trigger);
+struct lttng_action *
+lttng_error_query_action_borrow_action_target(const struct lttng_error_query *query,
+                                             struct lttng_trigger *trigger);
 
 int lttng_error_query_serialize(const struct lttng_error_query *query,
-               struct lttng_payload *payload);
+                               struct lttng_payload *payload);
 
 ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view,
-               struct lttng_error_query **query);
+                                             struct lttng_error_query **query);
 
-int lttng_error_query_result_serialize(
-               const struct lttng_error_query_result *result,
-               struct lttng_payload *payload);
+int lttng_error_query_result_serialize(const struct lttng_error_query_result *result,
+                                      struct lttng_payload *payload);
 
-ssize_t lttng_error_query_result_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_error_query_result **result);
+ssize_t lttng_error_query_result_create_from_payload(struct lttng_payload_view *view,
+                                                    struct lttng_error_query_result **result);
 
-int lttng_error_query_results_serialize(
-               const struct lttng_error_query_results *results,
-               struct lttng_payload *payload);
+int lttng_error_query_results_serialize(const struct lttng_error_query_results *results,
+                                       struct lttng_payload *payload);
 
-ssize_t lttng_error_query_results_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_error_query_results **results);
+ssize_t lttng_error_query_results_create_from_payload(struct lttng_payload_view *view,
+                                                     struct lttng_error_query_results **results);
 
 struct lttng_error_query_result *
-lttng_error_query_result_counter_create(
-               const char *name, const char *description, uint64_t value);
+lttng_error_query_result_counter_create(const char *name, const char *description, uint64_t value);
 
 void lttng_error_query_result_destroy(struct lttng_error_query_result *result);
 
 struct lttng_error_query_results *lttng_error_query_results_create();
 
 /* Ownership of `result` is transferred on success. */
-int lttng_error_query_results_add_result(
-               struct lttng_error_query_results *results,
-               struct lttng_error_query_result *result);
+int lttng_error_query_results_add_result(struct lttng_error_query_results *results,
+                                        struct lttng_error_query_result *result);
 
-enum lttng_error_code lttng_error_query_results_mi_serialize(
-               const struct lttng_error_query_results *results,
-               struct mi_writer *writer);
+enum lttng_error_code
+lttng_error_query_results_mi_serialize(const struct lttng_error_query_results *results,
+                                      struct mi_writer *writer);
 
 #endif /* LTTNG_ERROR_QUERY_INTERNAL_H */
index a7cbae4210cb253e071e6fc0881bd0bce85357e8..0eb0addc8a161273290bb58412b00efab8e3d67f 100644 (file)
 #ifndef LTTNG_ERROR_QUERY_H
 #define LTTNG_ERROR_QUERY_H
 
-#include <lttng/lttng.h>
 #include <lttng/lttng-export.h>
+#include <lttng/lttng.h>
 #include <lttng/trigger/trigger.h>
+
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -59,12 +60,12 @@ enum lttng_error_query_results_status {
 };
 
 /* Create an error query targetting a trigger object. */
-LTTNG_EXPORT extern struct lttng_error_query *lttng_error_query_trigger_create(
-               const struct lttng_trigger *trigger);
+LTTNG_EXPORT extern struct lttng_error_query *
+lttng_error_query_trigger_create(const struct lttng_trigger *trigger);
 
 /* Create an error query targetting a trigger's condition object. */
-LTTNG_EXPORT extern struct lttng_error_query *lttng_error_query_condition_create(
-               const struct lttng_trigger *trigger);
+LTTNG_EXPORT extern struct lttng_error_query *
+lttng_error_query_condition_create(const struct lttng_trigger *trigger);
 
 /*
  * Create an error query targetting an action object.
@@ -72,9 +73,9 @@ LTTNG_EXPORT extern struct lttng_error_query *lttng_error_query_condition_create
  * `action_path` is copied internally. The root of the `action_path` is the
  * action of `trigger`.
  */
-LTTNG_EXPORT extern struct lttng_error_query *lttng_error_query_action_create(
-               const struct lttng_trigger *trigger,
-               const struct lttng_action_path *action_path);
+LTTNG_EXPORT extern struct lttng_error_query *
+lttng_error_query_action_create(const struct lttng_trigger *trigger,
+                               const struct lttng_action_path *action_path);
 
 /* Destroy an error query. */
 LTTNG_EXPORT extern void lttng_error_query_destroy(struct lttng_error_query *query);
@@ -85,47 +86,43 @@ LTTNG_EXPORT extern void lttng_error_query_destroy(struct lttng_error_query *que
  * Currently, only the `lttng_session_daemon_command_endpoint` is supported,
  * see `lttng/endpoint.h`.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_error_query_execute(
-               const struct lttng_error_query *query,
-               const struct lttng_endpoint *endpoint,
-               struct lttng_error_query_results **results);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_error_query_execute(const struct lttng_error_query *query,
+                         const struct lttng_endpoint *endpoint,
+                         struct lttng_error_query_results **results);
 
 /* Get the number of results in a result set. */
 LTTNG_EXPORT LTTNG_EXPORT extern enum lttng_error_query_results_status
-lttng_error_query_results_get_count(
-               const struct lttng_error_query_results *results,
-               unsigned int *count);
+lttng_error_query_results_get_count(const struct lttng_error_query_results *results,
+                                   unsigned int *count);
 
 /* Get a result from a result set by index. */
 LTTNG_EXPORT extern enum lttng_error_query_results_status
-lttng_error_query_results_get_result(
-               const struct lttng_error_query_results *results,
-               const struct lttng_error_query_result **result,
-               unsigned int index);
+lttng_error_query_results_get_result(const struct lttng_error_query_results *results,
+                                    const struct lttng_error_query_result **result,
+                                    unsigned int index);
 
 /* Destroy an error query result set. */
-LTTNG_EXPORT extern void lttng_error_query_results_destroy(
-               struct lttng_error_query_results *results);
+LTTNG_EXPORT extern void
+lttng_error_query_results_destroy(struct lttng_error_query_results *results);
 
 /* Get the type of an error query result. */
-LTTNG_EXPORT extern enum lttng_error_query_result_type lttng_error_query_result_get_type(
-               const struct lttng_error_query_result *result);
+LTTNG_EXPORT extern enum lttng_error_query_result_type
+lttng_error_query_result_get_type(const struct lttng_error_query_result *result);
 
 /* Get the name of result. */
-LTTNG_EXPORT extern enum lttng_error_query_result_status lttng_error_query_result_get_name(
-               const struct lttng_error_query_result *result,
-               const char **name);
+LTTNG_EXPORT extern enum lttng_error_query_result_status
+lttng_error_query_result_get_name(const struct lttng_error_query_result *result, const char **name);
 
 /* Get the description of a result. */
 LTTNG_EXPORT extern enum lttng_error_query_result_status
-lttng_error_query_result_get_description(
-               const struct lttng_error_query_result *result,
-               const char **description);
+lttng_error_query_result_get_description(const struct lttng_error_query_result *result,
+                                        const char **description);
 
 /* Get the value of an error counter. */
 LTTNG_EXPORT extern enum lttng_error_query_result_status
-lttng_error_query_result_counter_get_value(
-               const struct lttng_error_query_result *result, uint64_t *value);
+lttng_error_query_result_counter_get_value(const struct lttng_error_query_result *result,
+                                          uint64_t *value);
 
 #ifdef __cplusplus
 }
index 07547e587275db2b31769ee33b13e7d4f4589bd8..c44e63e4a6ef92f78791980fe55c57a1190f55c1 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_EVENT_EXPR_INTERNAL_H
 
 #include <common/macros.hpp>
+
 #include <lttng/event-expr.h>
 
 struct lttng_bytecode;
@@ -47,21 +48,19 @@ struct lttng_event_expr_array_field_element {
 /*
  * Returns whether or not `expr` is an l-value (locator value).
  */
-static inline
-bool lttng_event_expr_is_lvalue(const struct lttng_event_expr *expr)
+static inline bool lttng_event_expr_is_lvalue(const struct lttng_event_expr *expr)
 {
        LTTNG_ASSERT(expr);
        return expr->type == LTTNG_EVENT_EXPR_TYPE_EVENT_PAYLOAD_FIELD ||
-                       expr->type == LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD ||
-                       expr->type == LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD ||
-                       expr->type == LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT;
+               expr->type == LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD ||
+               expr->type == LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD ||
+               expr->type == LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT;
 }
 
 int lttng_event_expr_to_bytecode(const struct lttng_event_expr *expr,
-               struct lttng_bytecode **bytecode_out);
+                                struct lttng_bytecode **bytecode_out);
 
-enum lttng_error_code lttng_event_expr_mi_serialize(
-               const struct lttng_event_expr *expression,
-               struct mi_writer *writer);
+enum lttng_error_code lttng_event_expr_mi_serialize(const struct lttng_event_expr *expression,
+                                                   struct mi_writer *writer);
 
 #endif /* LTTNG_EVENT_EXPR_INTERNAL_H */
index cab22c97e96d40b7cd67700503f1ff7fab3ca77b..7b42785cad4763363dd97a9414a281d904cfd867 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_EVENT_EXPR_H
 
 #include <lttng/lttng-export.h>
+
 #include <stdbool.h>
 
 struct lttng_event_expr;
@@ -84,8 +85,8 @@ enum lttng_event_expr_status {
  * Returns the type of the event expression `expr`, or
  * `LTTNG_EVENT_EXPR_TYPE_INVALID` if `expr` is `NULL`.
  */
-LTTNG_EXPORT extern enum lttng_event_expr_type lttng_event_expr_get_type(
-               const struct lttng_event_expr *expr);
+LTTNG_EXPORT extern enum lttng_event_expr_type
+lttng_event_expr_get_type(const struct lttng_event_expr *expr);
 
 /*
  * Creates an event payload field expression for the payload field named
@@ -96,8 +97,8 @@ LTTNG_EXPORT extern enum lttng_event_expr_type lttng_event_expr_get_type(
  * * There's a memory error.
  * * `field_name` is `NULL`.
  */
-LTTNG_EXPORT extern struct lttng_event_expr *lttng_event_expr_event_payload_field_create(
-               const char *field_name);
+LTTNG_EXPORT extern struct lttng_event_expr *
+lttng_event_expr_event_payload_field_create(const char *field_name);
 
 /*
  * Returns the field name of the event payload field expression `expr`,
@@ -107,8 +108,8 @@ LTTNG_EXPORT extern struct lttng_event_expr *lttng_event_expr_event_payload_fiel
  * * The type of `expr` is not
  *   `LTTNG_EVENT_EXPR_TYPE_EVENT_PAYLOAD_FIELD`.
  */
-LTTNG_EXPORT extern const char *lttng_event_expr_event_payload_field_get_name(
-               const struct lttng_event_expr *expr);
+LTTNG_EXPORT extern const char *
+lttng_event_expr_event_payload_field_get_name(const struct lttng_event_expr *expr);
 
 /*
  * Creates a per-channel context field expression for the per-channel
@@ -130,8 +131,8 @@ lttng_event_expr_channel_context_field_create(const char *field_name);
  * * The type of `expr` is not
  *   `LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD`.
  */
-LTTNG_EXPORT extern const char *lttng_event_expr_channel_context_field_get_name(
-               const struct lttng_event_expr *expr);
+LTTNG_EXPORT extern const char *
+lttng_event_expr_channel_context_field_get_name(const struct lttng_event_expr *expr);
 
 /*
  * Creates an application-specific context field expression for the
@@ -145,8 +146,8 @@ LTTNG_EXPORT extern const char *lttng_event_expr_channel_context_field_get_name(
  * * `type_name` is `NULL`.
  */
 LTTNG_EXPORT extern struct lttng_event_expr *
-lttng_event_expr_app_specific_context_field_create(
-               const char *provider_name, const char *type_name);
+lttng_event_expr_app_specific_context_field_create(const char *provider_name,
+                                                  const char *type_name);
 
 /*
  * Returns the provider name of the application-specific context field
@@ -157,8 +158,7 @@ lttng_event_expr_app_specific_context_field_create(
  *   `LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD`.
  */
 LTTNG_EXPORT extern const char *
-lttng_event_expr_app_specific_context_field_get_provider_name(
-               const struct lttng_event_expr *expr);
+lttng_event_expr_app_specific_context_field_get_provider_name(const struct lttng_event_expr *expr);
 
 /*
  * Returns the type name of the application-specific context field
@@ -169,8 +169,7 @@ lttng_event_expr_app_specific_context_field_get_provider_name(
  *   `LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD`.
  */
 LTTNG_EXPORT extern const char *
-lttng_event_expr_app_specific_context_field_get_type_name(
-               const struct lttng_event_expr *expr);
+lttng_event_expr_app_specific_context_field_get_type_name(const struct lttng_event_expr *expr);
 
 /*
  * Creates an array field element expression for the parent array field
@@ -188,9 +187,9 @@ lttng_event_expr_app_specific_context_field_get_type_name(
  *    * `LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD`
  *    * `LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT`
  */
-LTTNG_EXPORT extern struct lttng_event_expr *lttng_event_expr_array_field_element_create(
-               struct lttng_event_expr *array_field_expr,
-               unsigned int index);
+LTTNG_EXPORT extern struct lttng_event_expr *
+lttng_event_expr_array_field_element_create(struct lttng_event_expr *array_field_expr,
+                                           unsigned int index);
 
 /*
  * Returns the parent array field expression of the array field element
@@ -201,8 +200,7 @@ LTTNG_EXPORT extern struct lttng_event_expr *lttng_event_expr_array_field_elemen
  *   `LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT`.
  */
 LTTNG_EXPORT extern const struct lttng_event_expr *
-lttng_event_expr_array_field_element_get_parent_expr(
-               const struct lttng_event_expr *expr);
+lttng_event_expr_array_field_element_get_parent_expr(const struct lttng_event_expr *expr);
 
 /*
  * Sets `*index` to the index of the array field element expression
@@ -220,8 +218,8 @@ lttng_event_expr_array_field_element_get_parent_expr(
  *     * `index` is `NULL`.
  */
 LTTNG_EXPORT extern enum lttng_event_expr_status
-lttng_event_expr_array_field_element_get_index(
-               const struct lttng_event_expr *expr, unsigned int *index);
+lttng_event_expr_array_field_element_get_index(const struct lttng_event_expr *expr,
+                                              unsigned int *index);
 
 /*
  * Returns whether or not the event expressions `expr_a` and `expr_b`
@@ -230,7 +228,7 @@ lttng_event_expr_array_field_element_get_index(
  * `expr_a` and `expr_b` can be `NULL`.
  */
 LTTNG_EXPORT extern bool lttng_event_expr_is_equal(const struct lttng_event_expr *expr_a,
-               const struct lttng_event_expr *expr_b);
+                                                  const struct lttng_event_expr *expr_b);
 
 /*
  * Destroys the event expression `expr` if not `NULL`.
index 96196db873af0fd6ccb2b866caa5b749641f88d3..57a6a3e1c537fa00ee7e1c63d2d672aa0fcdc84b 100644 (file)
@@ -8,10 +8,12 @@
 #ifndef LTTNG_EVENT_FIELD_VALUE_INTERNAL_H
 #define LTTNG_EVENT_FIELD_VALUE_INTERNAL_H
 
-#include <stdint.h>
-#include <lttng/event-field-value.h>
 #include <common/dynamic-array.hpp>
 
+#include <lttng/event-field-value.h>
+
+#include <stdint.h>
+
 struct lttng_event_field_value {
        enum lttng_event_field_value_type type;
 };
@@ -114,9 +116,8 @@ struct lttng_event_field_value_array {
  *     * `count` is `NULL`.
  */
 enum lttng_event_field_value_status
-lttng_event_field_value_enum_get_label_count(
-               const struct lttng_event_field_value *field_val,
-               unsigned int *count);
+lttng_event_field_value_enum_get_label_count(const struct lttng_event_field_value *field_val,
+                                            unsigned int *count);
 
 /*
  * Returns the label at index `index` of the enumeration event field
@@ -129,45 +130,39 @@ lttng_event_field_value_enum_get_label_count(
  * * `index` is greater than or equal to the label count of `field_val`,
  *   as returned by lttng_event_field_value_enum_get_label_count().
  */
-const char *lttng_event_field_value_enum_get_label_at_index(
-               const struct lttng_event_field_value *field_val,
-               unsigned int index);
+const char *
+lttng_event_field_value_enum_get_label_at_index(const struct lttng_event_field_value *field_val,
+                                               unsigned int index);
 
-struct lttng_event_field_value *lttng_event_field_value_uint_create(
-               uint64_t val);
+struct lttng_event_field_value *lttng_event_field_value_uint_create(uint64_t val);
 
-struct lttng_event_field_value *lttng_event_field_value_int_create(
-               int64_t val);
+struct lttng_event_field_value *lttng_event_field_value_int_create(int64_t val);
 
-struct lttng_event_field_value *lttng_event_field_value_enum_uint_create(
-               uint64_t val);
+struct lttng_event_field_value *lttng_event_field_value_enum_uint_create(uint64_t val);
 
-struct lttng_event_field_value *lttng_event_field_value_enum_int_create(
-               int64_t val);
+struct lttng_event_field_value *lttng_event_field_value_enum_int_create(int64_t val);
 
 struct lttng_event_field_value *lttng_event_field_value_real_create(double val);
 
-struct lttng_event_field_value *lttng_event_field_value_string_create(
-               const char *val);
+struct lttng_event_field_value *lttng_event_field_value_string_create(const char *val);
 
-struct lttng_event_field_value *lttng_event_field_value_string_create_with_size(
-               const char *val, size_t size);
+struct lttng_event_field_value *lttng_event_field_value_string_create_with_size(const char *val,
+                                                                               size_t size);
 
 struct lttng_event_field_value *lttng_event_field_value_array_create();
 
-int lttng_event_field_value_enum_append_label(
-               struct lttng_event_field_value *field_val, const char *label);
+int lttng_event_field_value_enum_append_label(struct lttng_event_field_value *field_val,
+                                             const char *label);
 
-int lttng_event_field_value_enum_append_label_with_size(
-               struct lttng_event_field_value *field_val, const char *label,
-               size_t size);
+int lttng_event_field_value_enum_append_label_with_size(struct lttng_event_field_value *field_val,
+                                                       const char *label,
+                                                       size_t size);
 
-int lttng_event_field_value_array_append(
-               struct lttng_event_field_value *array_field_val,
-               struct lttng_event_field_value *field_val);
+int lttng_event_field_value_array_append(struct lttng_event_field_value *array_field_val,
+                                        struct lttng_event_field_value *field_val);
 
 int lttng_event_field_value_array_append_unavailable(
-               struct lttng_event_field_value *array_field_val);
+       struct lttng_event_field_value *array_field_val);
 
 void lttng_event_field_value_destroy(struct lttng_event_field_value *field_val);
 
index 02d93c66109d5cb834d27a0f2f9f0e14de3cab47..7f10deec31c544e6bb47366f05bcaaa5dd23f9a7 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_EVENT_FIELD_VALUE_H
 
 #include <lttng/lttng-export.h>
+
 #include <stdint.h>
 
 struct lttng_event_field_value;
@@ -104,8 +105,8 @@ enum lttng_event_field_value_status {
  * `LTTNG_EVENT_FIELD_VALUE_TYPE_INVALID`:
  *     `field_val` is `NULL`.
  */
-LTTNG_EXPORT extern enum lttng_event_field_value_type lttng_event_field_value_get_type(
-               const struct lttng_event_field_value *field_val);
+LTTNG_EXPORT extern enum lttng_event_field_value_type
+lttng_event_field_value_get_type(const struct lttng_event_field_value *field_val);
 
 /*
  * Sets `*val` to the raw value of the unsigned integer/enumeration
@@ -124,8 +125,8 @@ LTTNG_EXPORT extern enum lttng_event_field_value_type lttng_event_field_value_ge
  *     * `val` is `NULL`.
  */
 LTTNG_EXPORT extern enum lttng_event_field_value_status
-lttng_event_field_value_unsigned_int_get_value(
-               const struct lttng_event_field_value *field_val, uint64_t *val);
+lttng_event_field_value_unsigned_int_get_value(const struct lttng_event_field_value *field_val,
+                                              uint64_t *val);
 
 /*
  * Sets `*val` to the raw value of the signed integer/enumeration event
@@ -144,8 +145,8 @@ lttng_event_field_value_unsigned_int_get_value(
  *     * `val` is `NULL`.
  */
 LTTNG_EXPORT extern enum lttng_event_field_value_status
-lttng_event_field_value_signed_int_get_value(
-               const struct lttng_event_field_value *field_val, int64_t *val);
+lttng_event_field_value_signed_int_get_value(const struct lttng_event_field_value *field_val,
+                                            int64_t *val);
 
 /*
  * Sets `*val` to the raw value of the real event field value
@@ -163,8 +164,8 @@ lttng_event_field_value_signed_int_get_value(
  *     * `val` is `NULL`.
  */
 LTTNG_EXPORT extern enum lttng_event_field_value_status
-lttng_event_field_value_real_get_value(
-               const struct lttng_event_field_value *field_val, double *val);
+lttng_event_field_value_real_get_value(const struct lttng_event_field_value *field_val,
+                                      double *val);
 
 /*
  * Returns the raw value (an UTF-8 C string) of the string event field
@@ -179,9 +180,8 @@ lttng_event_field_value_real_get_value(
  *       `LTTNG_EVENT_FIELD_VALUE_TYPE_STRING`.
  */
 LTTNG_EXPORT extern enum lttng_event_field_value_status
-lttng_event_field_value_string_get_value(
-               const struct lttng_event_field_value *field_val,
-               const char **value);
+lttng_event_field_value_string_get_value(const struct lttng_event_field_value *field_val,
+                                        const char **value);
 
 /*
  * Sets `*length` to the length (the number of contained elements) of
@@ -199,9 +199,8 @@ lttng_event_field_value_string_get_value(
  *     * `length` is `NULL`.
  */
 LTTNG_EXPORT extern enum lttng_event_field_value_status
-lttng_event_field_value_array_get_length(
-               const struct lttng_event_field_value *field_val,
-               unsigned int *length);
+lttng_event_field_value_array_get_length(const struct lttng_event_field_value *field_val,
+                                        unsigned int *length);
 
 /*
  * Sets `*elem_field_val` to the event field value at index `index` in
@@ -225,9 +224,9 @@ lttng_event_field_value_array_get_length(
  */
 LTTNG_EXPORT extern enum lttng_event_field_value_status
 lttng_event_field_value_array_get_element_at_index(
-               const struct lttng_event_field_value *field_val,
-               unsigned int index,
-               const struct lttng_event_field_value **elem_field_val);
+       const struct lttng_event_field_value *field_val,
+       unsigned int index,
+       const struct lttng_event_field_value **elem_field_val);
 
 #ifdef __cplusplus
 }
index daa8fa68e74a5167fe7e8caf4911c98c56d5d596..df5a9fd45224ecff0b6d13035770187cb983f806 100644 (file)
@@ -13,6 +13,7 @@
 #define LTTNG_EVENT_INTERNAL_H
 
 #include <common/macros.hpp>
+
 #include <lttng/event.h>
 #include <lttng/lttng-error.h>
 
@@ -58,7 +59,7 @@ struct lttng_event_comm {
 struct lttng_event_exclusion_comm {
        /* Includes terminator `\0`. */
        uint32_t len;
-       char payload [];
+       char payload[];
 } LTTNG_PACKED;
 
 struct lttng_event_probe_attr_comm {
@@ -154,43 +155,38 @@ struct lttng_event_extended {
 struct lttng_event *lttng_event_copy(const struct lttng_event *event);
 
 ssize_t lttng_event_create_from_payload(struct lttng_payload_view *view,
-               struct lttng_event **out_event,
-               struct lttng_event_exclusion **out_exclusion,
-               char **out_filter_expression,
-               struct lttng_bytecode **out_bytecode);
+                                       struct lttng_event **out_event,
+                                       struct lttng_event_exclusion **out_exclusion,
+                                       char **out_filter_expression,
+                                       struct lttng_bytecode **out_bytecode);
 
 int lttng_event_serialize(const struct lttng_event *event,
-               unsigned int exclusion_count,
-               char **exclusion_list,
-               char *filter_expression,
-               size_t bytecode_len,
-               struct lttng_bytecode *bytecode,
-               struct lttng_payload *payload);
+                         unsigned int exclusion_count,
+                         char **exclusion_list,
+                         char *filter_expression,
+                         size_t bytecode_len,
+                         struct lttng_bytecode *bytecode,
+                         struct lttng_payload *payload);
 
-ssize_t lttng_event_context_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_context **event_ctx);
+ssize_t lttng_event_context_create_from_payload(struct lttng_payload_view *view,
+                                               struct lttng_event_context **event_ctx);
 
 int lttng_event_context_serialize(struct lttng_event_context *context,
-               struct lttng_payload *payload);
+                                 struct lttng_payload *payload);
 
 void lttng_event_context_destroy(struct lttng_event_context *context);
 
-enum lttng_error_code lttng_events_create_and_flatten_from_payload(
-               struct lttng_payload_view *view,
-               unsigned int count,
-               struct lttng_event **events);
+enum lttng_error_code lttng_events_create_and_flatten_from_payload(struct lttng_payload_view *view,
+                                                                  unsigned int count,
+                                                                  struct lttng_event **events);
 
-ssize_t lttng_event_field_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_field **field);
+ssize_t lttng_event_field_create_from_payload(struct lttng_payload_view *view,
+                                             struct lttng_event_field **field);
 
 int lttng_event_field_serialize(const struct lttng_event_field *field,
-               struct lttng_payload *payload);
+                               struct lttng_payload *payload);
 
 enum lttng_error_code lttng_event_fields_create_and_flatten_from_payload(
-               struct lttng_payload_view *view,
-               unsigned int count,
-               struct lttng_event_field **fields);
+       struct lttng_payload_view *view, unsigned int count, struct lttng_event_field **fields);
 
 #endif /* LTTNG_EVENT_INTERNAL_H */
index b1415cac780bc8876da633be268a5f3dd7da70d0..1b73b06094c775a4234023b1debfa13683786ccd 100644 (file)
@@ -8,13 +8,15 @@
 #ifndef LTTNG_EVENT_RULE_INTERNAL_H
 #define LTTNG_EVENT_RULE_INTERNAL_H
 
-#include <common/macros.hpp>
 #include <common/credentials.hpp>
+#include <common/macros.hpp>
 #include <common/sessiond-comm/sessiond-comm.hpp>
+
 #include <lttng/domain.h>
-#include <lttng/event.h>
 #include <lttng/event-rule/event-rule.h>
+#include <lttng/event.h>
 #include <lttng/lttng-error.h>
+
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
@@ -72,31 +74,27 @@ struct lttng_event_rule_comm {
        char payload[];
 };
 
-void lttng_event_rule_init(struct lttng_event_rule *event_rule,
-               enum lttng_event_rule_type type);
+void lttng_event_rule_init(struct lttng_event_rule *event_rule, enum lttng_event_rule_type type);
 
 bool lttng_event_rule_validate(const struct lttng_event_rule *event_rule);
 
-ssize_t lttng_event_rule_create_from_payload(
-               struct lttng_payload_view *payload,
-               struct lttng_event_rule **event_rule);
+ssize_t lttng_event_rule_create_from_payload(struct lttng_payload_view *payload,
+                                            struct lttng_event_rule **event_rule);
 
 int lttng_event_rule_serialize(const struct lttng_event_rule *event_rule,
-               struct lttng_payload *payload);
+                              struct lttng_payload *payload);
 
-bool lttng_event_rule_is_equal(const struct lttng_event_rule *a,
-               const struct lttng_event_rule *b);
+bool lttng_event_rule_is_equal(const struct lttng_event_rule *a, const struct lttng_event_rule *b);
 
 bool lttng_event_rule_get(struct lttng_event_rule *rule);
 
 void lttng_event_rule_put(struct lttng_event_rule *rule);
 
-enum lttng_domain_type lttng_event_rule_get_domain_type(
-               const struct lttng_event_rule *rule);
+enum lttng_domain_type lttng_event_rule_get_domain_type(const struct lttng_event_rule *rule);
 
-enum lttng_error_code lttng_event_rule_generate_filter_bytecode(
-               struct lttng_event_rule *rule,
-               const struct lttng_credentials *creds);
+enum lttng_error_code
+lttng_event_rule_generate_filter_bytecode(struct lttng_event_rule *rule,
+                                         const struct lttng_credentials *creds);
 
 /*
  * If not present/implemented returns NULL.
@@ -108,8 +106,8 @@ const char *lttng_event_rule_get_filter(const struct lttng_event_rule *rule);
  * If not present/implemented returns NULL.
  * Caller DOES NOT own the returned object.
  */
-const struct lttng_bytecode *lttng_event_rule_get_filter_bytecode(
-               const struct lttng_event_rule *rule);
+const struct lttng_bytecode *
+lttng_event_rule_get_filter_bytecode(const struct lttng_event_rule *rule);
 
 /*
  * If not present/implemented return NULL.
@@ -117,7 +115,7 @@ const struct lttng_bytecode *lttng_event_rule_get_filter_bytecode(
  */
 enum lttng_event_rule_generate_exclusions_status
 lttng_event_rule_generate_exclusions(const struct lttng_event_rule *rule,
-               struct lttng_event_exclusion **exclusions);
+                                    struct lttng_event_exclusion **exclusions);
 
 const char *lttng_event_rule_type_str(enum lttng_event_rule_type type);
 
@@ -132,13 +130,12 @@ unsigned long lttng_event_rule_hash(const struct lttng_event_rule *rule);
  *
  * The caller owns the returned object.
  */
-struct lttng_event *lttng_event_rule_generate_lttng_event(
-               const struct lttng_event_rule *rule);
+struct lttng_event *lttng_event_rule_generate_lttng_event(const struct lttng_event_rule *rule);
 
 /* Test if an event rule targets an agent domain. */
 bool lttng_event_rule_targets_agent_domain(const struct lttng_event_rule *rule);
 
-enum lttng_error_code lttng_event_rule_mi_serialize(
-               const struct lttng_event_rule *rule, struct mi_writer *writer);
+enum lttng_error_code lttng_event_rule_mi_serialize(const struct lttng_event_rule *rule,
+                                                   struct mi_writer *writer);
 
 #endif /* LTTNG_EVENT_RULE_INTERNAL_H */
index 0c2453ccfd772c13aab52d0c041ef4c8729ebcf7..a75db771e9e2155e20ef7de2f2fd7609256e998b 100644 (file)
@@ -48,8 +48,8 @@ enum lttng_event_rule_status {
  * Returns the type of an event rule on success, LTTNG_EVENT_RULE_UNKNOWN on
  * error.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_type lttng_event_rule_get_type(
-               const struct lttng_event_rule *event_rule);
+LTTNG_EXPORT extern enum lttng_event_rule_type
+lttng_event_rule_get_type(const struct lttng_event_rule *event_rule);
 
 /*
  * Destroy an event rule object.
index b769f0f8094215e3d309fd6b26765c28eab96ecc..c84ab7a7f86e39281577e526d4f4a5c319014e32 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H
 #define LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/jul-logging.h>
 #include <lttng/event.h>
@@ -51,8 +52,7 @@ struct lttng_event_rule_jul_logging_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_jul_logging_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_jul_logging_create_from_payload(struct lttng_payload_view *view,
+                                                        struct lttng_event_rule **rule);
 
 #endif /* LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H */
index 833e6adff7b84f101a545d74b2c2c03ada9c61dd..7960c1c7e517086f6dd3ad0f726e633c2cebe7bf 100644 (file)
@@ -9,9 +9,9 @@
 #define LTTNG_EVENT_RULE_JUL_LOGGING_H
 
 #include <lttng/event-rule/event-rule.h>
+#include <lttng/event.h>
 #include <lttng/log-level-rule.h>
 #include <lttng/lttng-export.h>
-#include <lttng/event.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,8 +35,8 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_jul_logging_create
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_set_name_pattern(
-               struct lttng_event_rule *rule, const char *pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_jul_logging_set_name_pattern(struct lttng_event_rule *rule, const char *pattern);
 
 /*
  * Get the name pattern of a jul logging event rule.
@@ -50,8 +50,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_se
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_get_name_pattern(
-               const struct lttng_event_rule *rule, const char **pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_jul_logging_get_name_pattern(const struct lttng_event_rule *rule,
+                                             const char **pattern);
 
 /*
  * Set the filter expression of a jul logging event rule.
@@ -61,8 +62,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_ge
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_set_filter(
-               struct lttng_event_rule *rule, const char *expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_jul_logging_set_filter(struct lttng_event_rule *rule, const char *expression);
 
 /*
  * Get the filter expression of a jul logging event rule.
@@ -76,8 +77,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_se
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_get_filter(
-               const struct lttng_event_rule *rule, const char **expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_jul_logging_get_filter(const struct lttng_event_rule *rule,
+                                       const char **expression);
 
 /*
  * Set the log level rule of a jul logging event rule.
@@ -89,7 +91,7 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_jul_logging_ge
  */
 LTTNG_EXPORT extern enum lttng_event_rule_status
 lttng_event_rule_jul_logging_set_log_level_rule(struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule *log_level_rule);
+                                               const struct lttng_log_level_rule *log_level_rule);
 
 /*
  * Get the log level rule of a jul logging event rule.
@@ -104,9 +106,8 @@ lttng_event_rule_jul_logging_set_log_level_rule(struct lttng_event_rule *rule,
  * to this call.
  */
 LTTNG_EXPORT extern enum lttng_event_rule_status
-lttng_event_rule_jul_logging_get_log_level_rule(
-               const struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule **log_level_rule);
+lttng_event_rule_jul_logging_get_log_level_rule(const struct lttng_event_rule *rule,
+                                               const struct lttng_log_level_rule **log_level_rule);
 
 #ifdef __cplusplus
 }
index 5b4997987c9c27a80e38b8b744052b7b9170a0c5..f92fc10c4b2d8d7d8556582eb9298fcfbff64f25 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef LTTNG_EVENT_RULE_KERNEL_KPROBE_INTERNAL_H
 #define LTTNG_EVENT_RULE_KERNEL_KPROBE_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/kernel-kprobe.h>
 
@@ -31,8 +32,7 @@ struct lttng_event_rule_kernel_kprobe_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_kernel_kprobe_create_from_payload(
-               struct lttng_payload_view *payload,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_kernel_kprobe_create_from_payload(struct lttng_payload_view *payload,
+                                                          struct lttng_event_rule **rule);
 
 #endif /* LTTNG_EVENT_RULE_KERNEL_KPROBE_INTERNAL_H */
index c970116afebd19fa059e02066fe10c70711dee4e..6e292f0d1a1112e0920645c9bd053be5d95b69cf 100644 (file)
@@ -25,8 +25,8 @@ struct lttng_kernel_probe_location;
  * Returns a new event rule on success, NULL on failure. The returned event rule
  * must be destroyed using lttng_event_rule_destroy().
  */
-LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_kprobe_create(
-               const struct lttng_kernel_probe_location *location);
+LTTNG_EXPORT extern struct lttng_event_rule *
+lttng_event_rule_kernel_kprobe_create(const struct lttng_kernel_probe_location *location);
 
 /*
  * Get the kernel probe location of a kernel kprobe event rule.
@@ -40,9 +40,9 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_kprobe_crea
  * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a location was not set prior to
  * this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_get_location(
-               const struct lttng_event_rule *rule,
-               const struct lttng_kernel_probe_location **location);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_kprobe_get_location(const struct lttng_event_rule *rule,
+                                           const struct lttng_kernel_probe_location **location);
 
 /*
  * Set the name of a kernel kprobe event rule.
@@ -52,8 +52,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_
  * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_set_event_name(
-               struct lttng_event_rule *rule, const char *name);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_kprobe_set_event_name(struct lttng_event_rule *rule, const char *name);
 
 /*
  * Get the name of a kernel kprobe event rule.
@@ -66,8 +66,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_
  * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed,
  * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_get_event_name(
-               const struct lttng_event_rule *rule, const char **name);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_kprobe_get_event_name(const struct lttng_event_rule *rule,
+                                             const char **name);
 
 #ifdef __cplusplus
 }
index 2ca1823eca4aa1a4c1e209b692a131922c052110..9cef606bbe9807e2a232f7efab45b81ef81fa5f7 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef LTTNG_EVENT_RULE_KERNEL_SYSCALL_INTERNAL_H
 #define LTTNG_EVENT_RULE_KERNEL_SYSCALL_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/kernel-syscall.h>
 
@@ -40,11 +41,10 @@ struct lttng_event_rule_kernel_syscall_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_kernel_syscall_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_kernel_syscall_create_from_payload(struct lttng_payload_view *view,
+                                                           struct lttng_event_rule **rule);
 
 const char *lttng_event_rule_kernel_syscall_emission_site_str(
-               enum lttng_event_rule_kernel_syscall_emission_site emission_site);
+       enum lttng_event_rule_kernel_syscall_emission_site emission_site);
 
 #endif /* LTTNG_EVENT_RULE_KERNEL_SYSCALL_INTERNAL_H */
index ce8be6a5dd420b22fb73952e3cab3c36a4eae208..4ae104ff622ffd34a558441fa6e13c82ce4fb662 100644 (file)
@@ -31,8 +31,8 @@ enum lttng_event_rule_kernel_syscall_emission_site {
  * Returns a new event rule on success, NULL on failure. This event rule must be
  * destroyed using lttng_event_rule_destroy().
  */
-LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_syscall_create(enum
-               lttng_event_rule_kernel_syscall_emission_site emission_site);
+LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_syscall_create(
+       enum lttng_event_rule_kernel_syscall_emission_site emission_site);
 
 /*
  * Set the name pattern of a kernel syscall event rule.
@@ -44,8 +44,9 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_syscall_cre
  * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall_set_name_pattern(
-               struct lttng_event_rule *rule, const char *pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_syscall_set_name_pattern(struct lttng_event_rule *rule,
+                                                const char *pattern);
 
 /*
  * Get the name pattern of a kernel syscall event rule.
@@ -59,8 +60,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall_get_name_pattern(
-               const struct lttng_event_rule *rule, const char **pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_syscall_get_name_pattern(const struct lttng_event_rule *rule,
+                                                const char **pattern);
 
 /*
  * Set the filter expression of a kernel syscall event rule.
@@ -70,8 +72,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall
  * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall_set_filter(
-               struct lttng_event_rule *rule, const char *expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_syscall_set_filter(struct lttng_event_rule *rule, const char *expression);
 
 /*
  * Get the filter expression of a kernel syscall event rule.
@@ -85,8 +87,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall_get_filter(
-               const struct lttng_event_rule *rule, const char **expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_syscall_get_filter(const struct lttng_event_rule *rule,
+                                          const char **expression);
 
 /*
  * Get the emission site of a kernel syscall event rule.
@@ -94,8 +97,7 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_syscall
  * Returns a enum lttng_event_rule_kernel_syscall_emission_site.
  */
 LTTNG_EXPORT extern enum lttng_event_rule_kernel_syscall_emission_site
-lttng_event_rule_kernel_syscall_get_emission_site(
-               const struct lttng_event_rule *rule);
+lttng_event_rule_kernel_syscall_get_emission_site(const struct lttng_event_rule *rule);
 
 #ifdef __cplusplus
 }
index d800eef9177830ff69d530fd6465173eec016916..1a0e50abd8c90f40f7f9177cdde5cc5646167899 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_EVENT_RULE_KERNEL_TRACEPOINT_INTERNAL_H
 #define LTTNG_EVENT_RULE_KERNEL_TRACEPOINT_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/kernel-tracepoint.h>
 #include <lttng/event.h>
@@ -44,8 +45,7 @@ struct lttng_event_rule_kernel_tracepoint_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_kernel_tracepoint_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_kernel_tracepoint_create_from_payload(struct lttng_payload_view *view,
+                                                              struct lttng_event_rule **rule);
 
 #endif /* LTTNG_EVENT_RULE_KERNEL_TRACEPOINT_INTERNAL_H */
index 550a04ac492701dd9385f547900adad394ddda42..6c566e1596a0f502b16efbe09eeef9059f1d5ae3 100644 (file)
@@ -34,8 +34,9 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_tracepoint_
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepoint_set_name_pattern(
-               struct lttng_event_rule *rule, const char *pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_tracepoint_set_name_pattern(struct lttng_event_rule *rule,
+                                                   const char *pattern);
 
 /*
  * Get the name pattern of a kernel tracepoint event rule.
@@ -49,8 +50,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepo
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepoint_get_name_pattern(
-               const struct lttng_event_rule *rule, const char **pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_tracepoint_get_name_pattern(const struct lttng_event_rule *rule,
+                                                   const char **pattern);
 
 /*
  * Set the filter expression of a kernel tracepoint event rule.
@@ -60,8 +62,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepo
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepoint_set_filter(
-               struct lttng_event_rule *rule, const char *expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_tracepoint_set_filter(struct lttng_event_rule *rule,
+                                             const char *expression);
 
 /*
  * Get the filter expression of a kernel tracepoint event rule.
@@ -75,8 +78,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepo
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_tracepoint_get_filter(
-               const struct lttng_event_rule *rule, const char **expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_tracepoint_get_filter(const struct lttng_event_rule *rule,
+                                             const char **expression);
 
 #ifdef __cplusplus
 }
index f9a1931004f293c5136120e73b12d4a32c628509..61dfd4f3f4f74b5293b4f4e38a10efadcd534901 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef LTTNG_EVENT_RULE_KERNEL_UPROBE_INTERNAL_H
 #define LTTNG_EVENT_RULE_KERNEL_UPROBE_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/kernel-uprobe.h>
 
@@ -32,12 +33,10 @@ struct lttng_event_rule_kernel_uprobe_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_kernel_uprobe_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_kernel_uprobe_create_from_payload(struct lttng_payload_view *view,
+                                                          struct lttng_event_rule **rule);
 
 struct lttng_userspace_probe_location *
-lttng_event_rule_kernel_uprobe_get_location_mutable(
-               const struct lttng_event_rule *rule);
+lttng_event_rule_kernel_uprobe_get_location_mutable(const struct lttng_event_rule *rule);
 
 #endif /* LTTNG_EVENT_RULE_KERNEL_UPROBE_INTERNAL_H */
index 6b29b695d4291f2b22677de33b4088959fa0b58b..cfb0ccaa78aee60075f2f471b34ce44210cccfa3 100644 (file)
@@ -24,8 +24,8 @@ extern "C" {
  * Returns a new event rule on success, NULL on failure. This event rule must be
  * destroyed using lttng_event_rule_destroy().
  */
-LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_uprobe_create(
-               const struct lttng_userspace_probe_location *location);
+LTTNG_EXPORT extern struct lttng_event_rule *
+lttng_event_rule_kernel_uprobe_create(const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the location of a kernel uprobe event rule.
@@ -39,9 +39,9 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_uprobe_crea
  * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a location was not set prior to
  * this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_uprobe_get_location(
-               const struct lttng_event_rule *rule,
-               const struct lttng_userspace_probe_location **location);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_uprobe_get_location(const struct lttng_event_rule *rule,
+                                           const struct lttng_userspace_probe_location **location);
 
 /*
  * Set the name of a kernel uprobe event rule.
@@ -51,8 +51,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_uprobe_
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_uprobe_set_event_name(
-               struct lttng_event_rule *rule, const char *name);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_uprobe_set_event_name(struct lttng_event_rule *rule, const char *name);
 
 /*
  * Get the name of a kernel uprobe event rule.
@@ -65,8 +65,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_uprobe_
  * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed,
  * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_uprobe_get_event_name(
-               const struct lttng_event_rule *rule, const char **name);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_kernel_uprobe_get_event_name(const struct lttng_event_rule *rule,
+                                             const char **name);
 
 #ifdef __cplusplus
 }
index a65e74b6d1c50d29459ffea72d8406a7e59db1c5..239bf98ee41e0769d0c481e572e11f33760c0974 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_EVENT_RULE_LOG4J_LOGGING_INTERNAL_H
 #define LTTNG_EVENT_RULE_LOG4J_LOGGING_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/log4j-logging.h>
 #include <lttng/event.h>
@@ -51,8 +52,7 @@ struct lttng_event_rule_log4j_logging_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_log4j_logging_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_log4j_logging_create_from_payload(struct lttng_payload_view *view,
+                                                          struct lttng_event_rule **rule);
 
 #endif /* LTTNG_EVENT_RULE_LOG4J_LOGGING_INTERNAL_H */
index 277e7d95019059b9723f009d875757e8ab17ed02..9128b4d690804bc03089da154499f4d5acae59f1 100644 (file)
@@ -9,9 +9,9 @@
 #define LTTNG_EVENT_RULE_LOG4J_LOGGING_H
 
 #include <lttng/event-rule/event-rule.h>
+#include <lttng/event.h>
 #include <lttng/log-level-rule.h>
 #include <lttng/lttng-export.h>
-#include <lttng/event.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,8 +35,8 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_log4j_logging_crea
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_set_name_pattern(
-               struct lttng_event_rule *rule, const char *pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_log4j_logging_set_name_pattern(struct lttng_event_rule *rule, const char *pattern);
 
 /*
  * Get the name pattern of a log4j logging event rule.
@@ -50,8 +50,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_get_name_pattern(
-               const struct lttng_event_rule *rule, const char **pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_log4j_logging_get_name_pattern(const struct lttng_event_rule *rule,
+                                               const char **pattern);
 
 /*
  * Set the filter expression of a log4j logging event rule.
@@ -61,8 +62,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_set_filter(
-               struct lttng_event_rule *rule, const char *expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_log4j_logging_set_filter(struct lttng_event_rule *rule, const char *expression);
 
 /*
  * Get the filter expression of a log4j logging event rule.
@@ -76,8 +77,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_get_filter(
-               const struct lttng_event_rule *rule, const char **expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_log4j_logging_get_filter(const struct lttng_event_rule *rule,
+                                         const char **expression);
 
 /*
  * Set the log level rule of a log4j logging event rule.
@@ -87,9 +89,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status
-lttng_event_rule_log4j_logging_set_log_level_rule(struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule *log_level_rule);
+LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_set_log_level_rule(
+       struct lttng_event_rule *rule, const struct lttng_log_level_rule *log_level_rule);
 
 /*
  * Get the log level rule of a log4j logging event rule.
@@ -103,10 +104,8 @@ lttng_event_rule_log4j_logging_set_log_level_rule(struct lttng_event_rule *rule,
  * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
  * to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status
-lttng_event_rule_log4j_logging_get_log_level_rule(
-               const struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule **log_level_rule);
+LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_log4j_logging_get_log_level_rule(
+       const struct lttng_event_rule *rule, const struct lttng_log_level_rule **log_level_rule);
 
 #ifdef __cplusplus
 }
index d23f4e2a541048c217d42203c73228e2ca9948f6..f7513f420c15e07f16b1709d4816bf938f52fb95 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_EVENT_RULE_PYTHON_LOGGING_INTERNAL_H
 #define LTTNG_EVENT_RULE_PYTHON_LOGGING_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/python-logging.h>
 #include <lttng/event.h>
@@ -51,8 +52,7 @@ struct lttng_event_rule_python_logging_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_python_logging_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_python_logging_create_from_payload(struct lttng_payload_view *view,
+                                                           struct lttng_event_rule **rule);
 
 #endif /* LTTNG_EVENT_RULE_PYTHON_LOGGING_INTERNAL_H */
index d4a6ada472b28d1a6ed012ac89bdaba9ca506632..d77be2e50d0e015b465be2bf39b8b28053f06f57 100644 (file)
@@ -9,9 +9,9 @@
 #define LTTNG_EVENT_RULE_PYTHON_LOGGING_H
 
 #include <lttng/event-rule/event-rule.h>
+#include <lttng/event.h>
 #include <lttng/log-level-rule.h>
 #include <lttng/lttng-export.h>
-#include <lttng/event.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,8 +35,9 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_python_logging_cre
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging_set_name_pattern(
-               struct lttng_event_rule *rule, const char *pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_python_logging_set_name_pattern(struct lttng_event_rule *rule,
+                                                const char *pattern);
 
 /*
  * Get the name pattern of a python logging event rule.
@@ -50,8 +51,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging_get_name_pattern(
-               const struct lttng_event_rule *rule, const char **pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_python_logging_get_name_pattern(const struct lttng_event_rule *rule,
+                                                const char **pattern);
 
 /*
  * Set the filter expression of a python logging event rule.
@@ -61,8 +63,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging_set_filter(
-               struct lttng_event_rule *rule, const char *expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_python_logging_set_filter(struct lttng_event_rule *rule, const char *expression);
 
 /*
  * Get the filter expression of a python logging event rule.
@@ -76,8 +78,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging_get_filter(
-               const struct lttng_event_rule *rule, const char **expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_python_logging_get_filter(const struct lttng_event_rule *rule,
+                                          const char **expression);
 
 /*
  * Set the log level rule of a python logging event rule.
@@ -87,9 +90,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status
-lttng_event_rule_python_logging_set_log_level_rule(struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule *log_level_rule);
+LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging_set_log_level_rule(
+       struct lttng_event_rule *rule, const struct lttng_log_level_rule *log_level_rule);
 
 /*
  * Get the log level rule of a python logging event rule.
@@ -103,10 +105,8 @@ lttng_event_rule_python_logging_set_log_level_rule(struct lttng_event_rule *rule
  * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
  * to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status
-lttng_event_rule_python_logging_get_log_level_rule(
-               const struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule **log_level_rule);
+LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_python_logging_get_log_level_rule(
+       const struct lttng_event_rule *rule, const struct lttng_log_level_rule **log_level_rule);
 
 #ifdef __cplusplus
 }
index 1960a8a4d38ca2e0b4d79ed267c3139ea8f6f5df..65199bbbc2167faa207f63c26cc11d15fd9f15e0 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_EVENT_RULE_USER_TRACEPOINT_INTERNAL_H
 #define LTTNG_EVENT_RULE_USER_TRACEPOINT_INTERNAL_H
 
-#include <common/payload-view.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+#include <common/payload-view.hpp>
+
 #include <lttng/domain.h>
 #include <lttng/event-rule/event-rule-internal.hpp>
 #include <lttng/event-rule/user-tracepoint.h>
@@ -58,8 +59,7 @@ struct lttng_event_rule_user_tracepoint_comm {
        char payload[];
 } LTTNG_PACKED;
 
-ssize_t lttng_event_rule_user_tracepoint_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_event_rule **rule);
+ssize_t lttng_event_rule_user_tracepoint_create_from_payload(struct lttng_payload_view *view,
+                                                            struct lttng_event_rule **rule);
 
 #endif /* LTTNG_EVENT_RULE_USER_TRACEPOINT_INTERNAL_H */
index 7ee91ce79c15c5bdcfb2305a2689e108d676e24c..8f227b77815e336cbd03afa645cd39b943720e8b 100644 (file)
@@ -10,9 +10,9 @@
 
 #include <lttng/domain.h>
 #include <lttng/event-rule/event-rule.h>
+#include <lttng/event.h>
 #include <lttng/log-level-rule.h>
 #include <lttng/lttng-export.h>
-#include <lttng/event.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,8 +36,9 @@ LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_user_tracepoint_cr
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoint_set_name_pattern(
-               struct lttng_event_rule *rule, const char *pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_user_tracepoint_set_name_pattern(struct lttng_event_rule *rule,
+                                                 const char *pattern);
 
 /*
  * Get the name pattern of a user tracepoint event rule.
@@ -51,8 +52,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoin
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoint_get_name_pattern(
-               const struct lttng_event_rule *rule, const char **pattern);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_user_tracepoint_get_name_pattern(const struct lttng_event_rule *rule,
+                                                 const char **pattern);
 
 /*
  * Set the filter expression of a user tracepoint event rule.
@@ -62,8 +64,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoin
  * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
  * if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoint_set_filter(
-               struct lttng_event_rule *rule, const char *expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_user_tracepoint_set_filter(struct lttng_event_rule *rule, const char *expression);
 
 /*
  * Get the filter expression of a user tracepoint event rule.
@@ -77,8 +79,9 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoin
  * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
  * was not set prior to this call.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoint_get_filter(
-               const struct lttng_event_rule *rule, const char **expression);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_user_tracepoint_get_filter(const struct lttng_event_rule *rule,
+                                           const char **expression);
 
 /*
  * Set the log level rule of a user tracepoint event rule.
@@ -89,8 +92,8 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoin
  * if invalid parameters are passed.
  */
 LTTNG_EXPORT extern enum lttng_event_rule_status
-lttng_event_rule_user_tracepoint_set_log_level_rule(struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule *log_level_rule);
+lttng_event_rule_user_tracepoint_set_log_level_rule(
+       struct lttng_event_rule *rule, const struct lttng_log_level_rule *log_level_rule);
 
 /*
  * Get the log level rule of a user tracepoint event rule.
@@ -106,8 +109,7 @@ lttng_event_rule_user_tracepoint_set_log_level_rule(struct lttng_event_rule *rul
  */
 LTTNG_EXPORT extern enum lttng_event_rule_status
 lttng_event_rule_user_tracepoint_get_log_level_rule(
-               const struct lttng_event_rule *rule,
-               const struct lttng_log_level_rule **log_level_rule);
+       const struct lttng_event_rule *rule, const struct lttng_log_level_rule **log_level_rule);
 
 /*
  * Add a name pattern exclusion to the set of name pattern exclusion of an event rule.
@@ -117,9 +119,9 @@ lttng_event_rule_user_tracepoint_get_log_level_rule(
  * Returns LTTNG_EVENT_RULE_STATUS_OK on success,
  * LTTNG_EVENT_RULE_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoint_add_name_pattern_exclusion(
-               struct lttng_event_rule *rule,
-               const char *exclusion);
+LTTNG_EXPORT extern enum lttng_event_rule_status
+lttng_event_rule_user_tracepoint_add_name_pattern_exclusion(struct lttng_event_rule *rule,
+                                                           const char *exclusion);
 
 /*
  * Get the name pattern exclusions property count of an event rule.
@@ -130,7 +132,7 @@ LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_user_tracepoin
  */
 LTTNG_EXPORT extern enum lttng_event_rule_status
 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_count(
-               const struct lttng_event_rule *rule, unsigned int *count);
+       const struct lttng_event_rule *rule, unsigned int *count);
 
 /*
  * Get the pattern name exclusion at the given index.
@@ -141,9 +143,7 @@ lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_count(
  */
 LTTNG_EXPORT extern enum lttng_event_rule_status
 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_at_index(
-               const struct lttng_event_rule *rule,
-               unsigned int index,
-               const char **exclusion);
+       const struct lttng_event_rule *rule, unsigned int index, const char **exclusion);
 
 #ifdef __cplusplus
 }
index 5915db6d6738632d126ad2b0369f78d84256e215..202fd8992deb47eb4ab501bae9ce505afd8cb518 100644 (file)
@@ -21,44 +21,44 @@ extern "C" {
  * Instrumentation type of tracing event.
  */
 enum lttng_event_type {
-       LTTNG_EVENT_ALL                       = -1,
-       LTTNG_EVENT_TRACEPOINT                = 0,
-       LTTNG_EVENT_PROBE                     = 1,
-       LTTNG_EVENT_FUNCTION                  = 2,
-       LTTNG_EVENT_FUNCTION_ENTRY            = 3,
-       LTTNG_EVENT_NOOP                      = 4,
-       LTTNG_EVENT_SYSCALL                   = 5,
-       LTTNG_EVENT_USERSPACE_PROBE           = 6,
+       LTTNG_EVENT_ALL = -1,
+       LTTNG_EVENT_TRACEPOINT = 0,
+       LTTNG_EVENT_PROBE = 1,
+       LTTNG_EVENT_FUNCTION = 2,
+       LTTNG_EVENT_FUNCTION_ENTRY = 3,
+       LTTNG_EVENT_NOOP = 4,
+       LTTNG_EVENT_SYSCALL = 5,
+       LTTNG_EVENT_USERSPACE_PROBE = 6,
 };
 
 /*
  * Loglevel information.
  */
 enum lttng_loglevel_type {
-       LTTNG_EVENT_LOGLEVEL_ALL              = 0,
-       LTTNG_EVENT_LOGLEVEL_RANGE            = 1,
-       LTTNG_EVENT_LOGLEVEL_SINGLE           = 2,
+       LTTNG_EVENT_LOGLEVEL_ALL = 0,
+       LTTNG_EVENT_LOGLEVEL_RANGE = 1,
+       LTTNG_EVENT_LOGLEVEL_SINGLE = 2,
 };
 
 /*
  * Available loglevels.
  */
 enum lttng_loglevel {
-       LTTNG_LOGLEVEL_EMERG                  = 0,
-       LTTNG_LOGLEVEL_ALERT                  = 1,
-       LTTNG_LOGLEVEL_CRIT                   = 2,
-       LTTNG_LOGLEVEL_ERR                    = 3,
-       LTTNG_LOGLEVEL_WARNING                = 4,
-       LTTNG_LOGLEVEL_NOTICE                 = 5,
-       LTTNG_LOGLEVEL_INFO                   = 6,
-       LTTNG_LOGLEVEL_DEBUG_SYSTEM           = 7,
-       LTTNG_LOGLEVEL_DEBUG_PROGRAM          = 8,
-       LTTNG_LOGLEVEL_DEBUG_PROCESS          = 9,
-       LTTNG_LOGLEVEL_DEBUG_MODULE           = 10,
-       LTTNG_LOGLEVEL_DEBUG_UNIT             = 11,
-       LTTNG_LOGLEVEL_DEBUG_FUNCTION         = 12,
-       LTTNG_LOGLEVEL_DEBUG_LINE             = 13,
-       LTTNG_LOGLEVEL_DEBUG                  = 14,
+       LTTNG_LOGLEVEL_EMERG = 0,
+       LTTNG_LOGLEVEL_ALERT = 1,
+       LTTNG_LOGLEVEL_CRIT = 2,
+       LTTNG_LOGLEVEL_ERR = 3,
+       LTTNG_LOGLEVEL_WARNING = 4,
+       LTTNG_LOGLEVEL_NOTICE = 5,
+       LTTNG_LOGLEVEL_INFO = 6,
+       LTTNG_LOGLEVEL_DEBUG_SYSTEM = 7,
+       LTTNG_LOGLEVEL_DEBUG_PROGRAM = 8,
+       LTTNG_LOGLEVEL_DEBUG_PROCESS = 9,
+       LTTNG_LOGLEVEL_DEBUG_MODULE = 10,
+       LTTNG_LOGLEVEL_DEBUG_UNIT = 11,
+       LTTNG_LOGLEVEL_DEBUG_FUNCTION = 12,
+       LTTNG_LOGLEVEL_DEBUG_LINE = 13,
+       LTTNG_LOGLEVEL_DEBUG = 14,
 };
 
 /*
@@ -66,15 +66,15 @@ enum lttng_loglevel {
  * class java.util.logging.Level.
  */
 enum lttng_loglevel_jul {
-       LTTNG_LOGLEVEL_JUL_OFF                = INT32_MAX,
-       LTTNG_LOGLEVEL_JUL_SEVERE             = 1000,
-       LTTNG_LOGLEVEL_JUL_WARNING            = 900,
-       LTTNG_LOGLEVEL_JUL_INFO               = 800,
-       LTTNG_LOGLEVEL_JUL_CONFIG             = 700,
-       LTTNG_LOGLEVEL_JUL_FINE               = 500,
-       LTTNG_LOGLEVEL_JUL_FINER              = 400,
-       LTTNG_LOGLEVEL_JUL_FINEST             = 300,
-       LTTNG_LOGLEVEL_JUL_ALL                = INT32_MIN,
+       LTTNG_LOGLEVEL_JUL_OFF = INT32_MAX,
+       LTTNG_LOGLEVEL_JUL_SEVERE = 1000,
+       LTTNG_LOGLEVEL_JUL_WARNING = 900,
+       LTTNG_LOGLEVEL_JUL_INFO = 800,
+       LTTNG_LOGLEVEL_JUL_CONFIG = 700,
+       LTTNG_LOGLEVEL_JUL_FINE = 500,
+       LTTNG_LOGLEVEL_JUL_FINER = 400,
+       LTTNG_LOGLEVEL_JUL_FINEST = 300,
+       LTTNG_LOGLEVEL_JUL_ALL = INT32_MIN,
 };
 
 /*
@@ -82,14 +82,14 @@ enum lttng_loglevel_jul {
  * class org.apache.log4j.Level.
  */
 enum lttng_loglevel_log4j {
-       LTTNG_LOGLEVEL_LOG4J_OFF              = INT32_MAX,
-       LTTNG_LOGLEVEL_LOG4J_FATAL            = 50000,
-       LTTNG_LOGLEVEL_LOG4J_ERROR            = 40000,
-       LTTNG_LOGLEVEL_LOG4J_WARN             = 30000,
-       LTTNG_LOGLEVEL_LOG4J_INFO             = 20000,
-       LTTNG_LOGLEVEL_LOG4J_DEBUG            = 10000,
-       LTTNG_LOGLEVEL_LOG4J_TRACE            = 5000,
-       LTTNG_LOGLEVEL_LOG4J_ALL              = INT32_MIN,
+       LTTNG_LOGLEVEL_LOG4J_OFF = INT32_MAX,
+       LTTNG_LOGLEVEL_LOG4J_FATAL = 50000,
+       LTTNG_LOGLEVEL_LOG4J_ERROR = 40000,
+       LTTNG_LOGLEVEL_LOG4J_WARN = 30000,
+       LTTNG_LOGLEVEL_LOG4J_INFO = 20000,
+       LTTNG_LOGLEVEL_LOG4J_DEBUG = 10000,
+       LTTNG_LOGLEVEL_LOG4J_TRACE = 5000,
+       LTTNG_LOGLEVEL_LOG4J_ALL = INT32_MIN,
 };
 
 /*
@@ -97,79 +97,79 @@ enum lttng_loglevel_log4j {
  * Level class.
  */
 enum lttng_loglevel_python {
-       LTTNG_LOGLEVEL_PYTHON_CRITICAL        = 50,
-       LTTNG_LOGLEVEL_PYTHON_ERROR           = 40,
-       LTTNG_LOGLEVEL_PYTHON_WARNING         = 30,
-       LTTNG_LOGLEVEL_PYTHON_INFO            = 20,
-       LTTNG_LOGLEVEL_PYTHON_DEBUG           = 10,
-       LTTNG_LOGLEVEL_PYTHON_NOTSET          = 0,
+       LTTNG_LOGLEVEL_PYTHON_CRITICAL = 50,
+       LTTNG_LOGLEVEL_PYTHON_ERROR = 40,
+       LTTNG_LOGLEVEL_PYTHON_WARNING = 30,
+       LTTNG_LOGLEVEL_PYTHON_INFO = 20,
+       LTTNG_LOGLEVEL_PYTHON_DEBUG = 10,
+       LTTNG_LOGLEVEL_PYTHON_NOTSET = 0,
 };
 
 /*
  * LTTng consumer mode
  */
 enum lttng_event_output {
-       LTTNG_EVENT_SPLICE                    = 0,
-       LTTNG_EVENT_MMAP                      = 1,
+       LTTNG_EVENT_SPLICE = 0,
+       LTTNG_EVENT_MMAP = 1,
 };
 
 /* Event context possible type */
 enum lttng_event_context_type {
-       LTTNG_EVENT_CONTEXT_PID                 = 0,
-       LTTNG_EVENT_CONTEXT_PERF_COUNTER        = 1,    /* Backward compat. */
-       LTTNG_EVENT_CONTEXT_PROCNAME            = 2,
-       LTTNG_EVENT_CONTEXT_PRIO                = 3,
-       LTTNG_EVENT_CONTEXT_NICE                = 4,
-       LTTNG_EVENT_CONTEXT_VPID                = 5,
-       LTTNG_EVENT_CONTEXT_TID                 = 6,
-       LTTNG_EVENT_CONTEXT_VTID                = 7,
-       LTTNG_EVENT_CONTEXT_PPID                = 8,
-       LTTNG_EVENT_CONTEXT_VPPID               = 9,
-       LTTNG_EVENT_CONTEXT_PTHREAD_ID          = 10,
-       LTTNG_EVENT_CONTEXT_HOSTNAME            = 11,
-       LTTNG_EVENT_CONTEXT_IP                  = 12,
-       LTTNG_EVENT_CONTEXT_PERF_CPU_COUNTER    = 13,
+       LTTNG_EVENT_CONTEXT_PID = 0,
+       LTTNG_EVENT_CONTEXT_PERF_COUNTER = 1, /* Backward compat. */
+       LTTNG_EVENT_CONTEXT_PROCNAME = 2,
+       LTTNG_EVENT_CONTEXT_PRIO = 3,
+       LTTNG_EVENT_CONTEXT_NICE = 4,
+       LTTNG_EVENT_CONTEXT_VPID = 5,
+       LTTNG_EVENT_CONTEXT_TID = 6,
+       LTTNG_EVENT_CONTEXT_VTID = 7,
+       LTTNG_EVENT_CONTEXT_PPID = 8,
+       LTTNG_EVENT_CONTEXT_VPPID = 9,
+       LTTNG_EVENT_CONTEXT_PTHREAD_ID = 10,
+       LTTNG_EVENT_CONTEXT_HOSTNAME = 11,
+       LTTNG_EVENT_CONTEXT_IP = 12,
+       LTTNG_EVENT_CONTEXT_PERF_CPU_COUNTER = 13,
        LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER = 14,
-       LTTNG_EVENT_CONTEXT_APP_CONTEXT         = 15,
-       LTTNG_EVENT_CONTEXT_INTERRUPTIBLE       = 16,
-       LTTNG_EVENT_CONTEXT_PREEMPTIBLE         = 17,
-       LTTNG_EVENT_CONTEXT_NEED_RESCHEDULE     = 18,
-       LTTNG_EVENT_CONTEXT_MIGRATABLE          = 19,
-       LTTNG_EVENT_CONTEXT_CALLSTACK_KERNEL    = 20,
-       LTTNG_EVENT_CONTEXT_CALLSTACK_USER      = 21, /* Supported on x86_32 and x86_64 only. */
-       LTTNG_EVENT_CONTEXT_CGROUP_NS           = 22,
-       LTTNG_EVENT_CONTEXT_IPC_NS              = 23,
-       LTTNG_EVENT_CONTEXT_MNT_NS              = 24,
-       LTTNG_EVENT_CONTEXT_NET_NS              = 25,
-       LTTNG_EVENT_CONTEXT_PID_NS              = 26,
-       LTTNG_EVENT_CONTEXT_USER_NS             = 27,
-       LTTNG_EVENT_CONTEXT_UTS_NS              = 28,
-       LTTNG_EVENT_CONTEXT_UID                 = 29,
-       LTTNG_EVENT_CONTEXT_EUID                = 30,
-       LTTNG_EVENT_CONTEXT_SUID                = 31,
-       LTTNG_EVENT_CONTEXT_GID                 = 32,
-       LTTNG_EVENT_CONTEXT_EGID                = 33,
-       LTTNG_EVENT_CONTEXT_SGID                = 34,
-       LTTNG_EVENT_CONTEXT_VUID                = 35,
-       LTTNG_EVENT_CONTEXT_VEUID               = 36,
-       LTTNG_EVENT_CONTEXT_VSUID               = 37,
-       LTTNG_EVENT_CONTEXT_VGID                = 38,
-       LTTNG_EVENT_CONTEXT_VEGID               = 39,
-       LTTNG_EVENT_CONTEXT_VSGID               = 40,
-       LTTNG_EVENT_CONTEXT_TIME_NS             = 41,
+       LTTNG_EVENT_CONTEXT_APP_CONTEXT = 15,
+       LTTNG_EVENT_CONTEXT_INTERRUPTIBLE = 16,
+       LTTNG_EVENT_CONTEXT_PREEMPTIBLE = 17,
+       LTTNG_EVENT_CONTEXT_NEED_RESCHEDULE = 18,
+       LTTNG_EVENT_CONTEXT_MIGRATABLE = 19,
+       LTTNG_EVENT_CONTEXT_CALLSTACK_KERNEL = 20,
+       LTTNG_EVENT_CONTEXT_CALLSTACK_USER = 21, /* Supported on x86_32 and x86_64 only. */
+       LTTNG_EVENT_CONTEXT_CGROUP_NS = 22,
+       LTTNG_EVENT_CONTEXT_IPC_NS = 23,
+       LTTNG_EVENT_CONTEXT_MNT_NS = 24,
+       LTTNG_EVENT_CONTEXT_NET_NS = 25,
+       LTTNG_EVENT_CONTEXT_PID_NS = 26,
+       LTTNG_EVENT_CONTEXT_USER_NS = 27,
+       LTTNG_EVENT_CONTEXT_UTS_NS = 28,
+       LTTNG_EVENT_CONTEXT_UID = 29,
+       LTTNG_EVENT_CONTEXT_EUID = 30,
+       LTTNG_EVENT_CONTEXT_SUID = 31,
+       LTTNG_EVENT_CONTEXT_GID = 32,
+       LTTNG_EVENT_CONTEXT_EGID = 33,
+       LTTNG_EVENT_CONTEXT_SGID = 34,
+       LTTNG_EVENT_CONTEXT_VUID = 35,
+       LTTNG_EVENT_CONTEXT_VEUID = 36,
+       LTTNG_EVENT_CONTEXT_VSUID = 37,
+       LTTNG_EVENT_CONTEXT_VGID = 38,
+       LTTNG_EVENT_CONTEXT_VEGID = 39,
+       LTTNG_EVENT_CONTEXT_VSGID = 40,
+       LTTNG_EVENT_CONTEXT_TIME_NS = 41,
 };
 
 enum lttng_event_field_type {
-       LTTNG_EVENT_FIELD_OTHER               = 0,
-       LTTNG_EVENT_FIELD_INTEGER             = 1,
-       LTTNG_EVENT_FIELD_ENUM                = 2,
-       LTTNG_EVENT_FIELD_FLOAT               = 3,
-       LTTNG_EVENT_FIELD_STRING              = 4,
+       LTTNG_EVENT_FIELD_OTHER = 0,
+       LTTNG_EVENT_FIELD_INTEGER = 1,
+       LTTNG_EVENT_FIELD_ENUM = 2,
+       LTTNG_EVENT_FIELD_FLOAT = 3,
+       LTTNG_EVENT_FIELD_STRING = 4,
 };
 
 enum lttng_event_flag {
-       LTTNG_EVENT_FLAG_SYSCALL_32           = (1U << 0),
-       LTTNG_EVENT_FLAG_SYSCALL_64           = (1U << 1),
+       LTTNG_EVENT_FLAG_SYSCALL_32 = (1U << 0),
+       LTTNG_EVENT_FLAG_SYSCALL_64 = (1U << 1),
 };
 
 /*
@@ -177,7 +177,7 @@ enum lttng_event_flag {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_PERF_EVENT_PADDING1          16
+#define LTTNG_PERF_EVENT_PADDING1 16
 struct lttng_event_perf_counter_ctx {
        uint32_t type;
        uint64_t config;
@@ -191,8 +191,8 @@ struct lttng_event_perf_counter_ctx {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_EVENT_CONTEXT_PADDING1       16
-#define LTTNG_EVENT_CONTEXT_PADDING2       LTTNG_SYMBOL_NAME_LEN + 32
+#define LTTNG_EVENT_CONTEXT_PADDING1 16
+#define LTTNG_EVENT_CONTEXT_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32
 struct lttng_event_context {
        enum lttng_event_context_type ctx;
        char padding[LTTNG_EVENT_CONTEXT_PADDING1];
@@ -214,7 +214,7 @@ struct lttng_event_context {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_EVENT_PROBE_PADDING1         16
+#define LTTNG_EVENT_PROBE_PADDING1 16
 struct lttng_event_probe_attr {
        uint64_t addr;
 
@@ -229,7 +229,7 @@ struct lttng_event_probe_attr {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_EVENT_FUNCTION_PADDING1      16
+#define LTTNG_EVENT_FUNCTION_PADDING1 16
 struct lttng_event_function_attr {
        char symbol_name[LTTNG_SYMBOL_NAME_LEN];
 
@@ -241,8 +241,8 @@ struct lttng_event_function_attr {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_EVENT_PADDING1               12
-#define LTTNG_EVENT_PADDING2               LTTNG_SYMBOL_NAME_LEN + 32
+#define LTTNG_EVENT_PADDING1 12
+#define LTTNG_EVENT_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32
 struct lttng_event {
        /* Offset 0 */
        enum lttng_event_type type;
@@ -257,13 +257,13 @@ struct lttng_event {
        int loglevel;
 
        /* Offset 268 */
-       int32_t enabled;        /* Does not apply: -1 */
+       int32_t enabled; /* Does not apply: -1 */
 
        /* Offset 272 */
        pid_t pid;
 
        /* Offset 276 */
-       unsigned char filter;   /* filter enabled ? */
+       unsigned char filter; /* filter enabled ? */
 
        /* Offset 277 */
        unsigned char exclusion; /* exclusions added ? */
@@ -294,7 +294,7 @@ struct lttng_event {
        } attr;
 };
 
-#define LTTNG_EVENT_FIELD_PADDING      LTTNG_SYMBOL_NAME_LEN + 32
+#define LTTNG_EVENT_FIELD_PADDING LTTNG_SYMBOL_NAME_LEN + 32
 struct lttng_event_field {
        char field_name[LTTNG_SYMBOL_NAME_LEN];
        enum lttng_event_field_type type;
@@ -312,7 +312,8 @@ struct lttng_event_field {
  * free events. On error a negative LTTng error code is returned.
  */
 LTTNG_EXPORT extern int lttng_list_events(struct lttng_handle *handle,
-               const char *channel_name, struct lttng_event **events);
+                                         const char *channel_name,
+                                         struct lttng_event **events);
 
 /*
  * Create an lttng_event.
@@ -337,7 +338,7 @@ LTTNG_EXPORT extern struct lttng_event *lttng_event_create(void);
  *
  * This destruction function, introduced in LTTng 2.11, should only
  * be used with events created by lttng_event_create().
 */
+ */
 LTTNG_EXPORT extern void lttng_event_destroy(struct lttng_event *event);
 
 /*
@@ -351,7 +352,7 @@ LTTNG_EXPORT extern void lttng_event_destroy(struct lttng_event *event);
  * Returns 0 on success, or a negative LTTng error code on error.
  */
 LTTNG_EXPORT extern int lttng_event_get_filter_expression(struct lttng_event *event,
-               const char **filter_string);
+                                                         const char **filter_string);
 
 /*
  * Get the number of exclusion names of a specific LTTng event.
@@ -370,7 +371,8 @@ LTTNG_EXPORT extern int lttng_event_get_exclusion_name_count(struct lttng_event
  * Returns 0 on success, or a negative LTTng error code on error.
  */
 LTTNG_EXPORT extern int lttng_event_get_exclusion_name(struct lttng_event *event,
-               size_t index, const char **exclusion_name);
+                                                      size_t index,
+                                                      const char **exclusion_name);
 
 /*
  * Get the userspace probe location of a specific LTTng event.
@@ -392,8 +394,9 @@ lttng_event_get_userspace_probe_location(const struct lttng_event *event);
  *
  * Returns 0 on success, or a negative LTTng error code on error.
  */
-LTTNG_EXPORT extern int lttng_event_set_userspace_probe_location(struct lttng_event *event,
-               struct lttng_userspace_probe_location *probe_location);
+LTTNG_EXPORT extern int
+lttng_event_set_userspace_probe_location(struct lttng_event *event,
+                                        struct lttng_userspace_probe_location *probe_location);
 
 /*
  * List the available tracepoints of a specific lttng domain.
@@ -404,7 +407,7 @@ LTTNG_EXPORT extern int lttng_event_set_userspace_probe_location(struct lttng_ev
  * free events. On error a negative LTTng error code is returned.
  */
 LTTNG_EXPORT extern int lttng_list_tracepoints(struct lttng_handle *handle,
-               struct lttng_event **events);
+                                              struct lttng_event **events);
 
 /*
  * List the available tracepoints fields of a specific lttng domain.
@@ -416,7 +419,7 @@ LTTNG_EXPORT extern int lttng_list_tracepoints(struct lttng_handle *handle,
  * returned.
  */
 LTTNG_EXPORT extern int lttng_list_tracepoint_fields(struct lttng_handle *handle,
-               struct lttng_event_field **fields);
+                                                    struct lttng_event_field **fields);
 
 /*
  * List the available kernel syscall.
@@ -440,8 +443,9 @@ LTTNG_EXPORT extern int lttng_list_syscalls(struct lttng_event **events);
  * Return 0 on success else a negative LTTng error code.
  */
 LTTNG_EXPORT extern int lttng_add_context(struct lttng_handle *handle,
-               struct lttng_event_context *ctx, const char *event_name,
-               const char *channel_name);
+                                         struct lttng_event_context *ctx,
+                                         const char *event_name,
+                                         const char *channel_name);
 
 /*
  * Create or enable an event (or events) for a channel.
@@ -454,8 +458,8 @@ LTTNG_EXPORT extern int lttng_add_context(struct lttng_handle *handle,
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_enable_event(struct lttng_handle *handle,
-               struct lttng_event *ev, const char *channel_name);
+LTTNG_EXPORT extern int
+lttng_enable_event(struct lttng_handle *handle, struct lttng_event *ev, const char *channel_name);
 
 /*
  * Create or enable an event with a specific filter.
@@ -471,8 +475,9 @@ LTTNG_EXPORT extern int lttng_enable_event(struct lttng_handle *handle,
  * Return 0 on success else a negative LTTng error code.
  */
 LTTNG_EXPORT extern int lttng_enable_event_with_filter(struct lttng_handle *handle,
-               struct lttng_event *event, const char *channel_name,
-               const char *filter_expression);
+                                                      struct lttng_event *event,
+                                                      const char *channel_name,
+                                                      const char *filter_expression);
 
 /*
  * Create or enable an event with a filter and/or exclusions.
@@ -489,9 +494,11 @@ LTTNG_EXPORT extern int lttng_enable_event_with_filter(struct lttng_handle *hand
  * Return 0 on success else a negative LTTng error code.
  */
 LTTNG_EXPORT extern int lttng_enable_event_with_exclusions(struct lttng_handle *handle,
-               struct lttng_event *event, const char *channel_name,
-               const char *filter_expression,
-               int exclusion_count, char **exclusion_names);
+                                                          struct lttng_event *event,
+                                                          const char *channel_name,
+                                                          const char *filter_expression,
+                                                          int exclusion_count,
+                                                          char **exclusion_names);
 
 /*
  * Disable event(s) of a channel and domain.
@@ -501,8 +508,8 @@ LTTNG_EXPORT extern int lttng_enable_event_with_exclusions(struct lttng_handle *
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_disable_event(struct lttng_handle *handle,
-               const char *name, const char *channel_name);
+LTTNG_EXPORT extern int
+lttng_disable_event(struct lttng_handle *handle, const char *name, const char *channel_name);
 
 /*
  * Disable event(s) of a channel and domain.
@@ -518,8 +525,9 @@ LTTNG_EXPORT extern int lttng_disable_event(struct lttng_handle *handle,
  * Return 0 on success else a negative LTTng error code.
  */
 LTTNG_EXPORT extern int lttng_disable_event_ext(struct lttng_handle *handle,
-               struct lttng_event *ev, const char *channel_name,
-               const char *filter_expression);
+                                               struct lttng_event *ev,
+                                               const char *channel_name,
+                                               const char *filter_expression);
 
 #ifdef __cplusplus
 }
index efc889f1d62ba89b2b6785113d562b6e1d9e6415..14a0e54072a0fb570a7c61ad5cd1f01a056f5c14 100644 (file)
@@ -20,7 +20,7 @@ extern "C" {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_HANDLE_PADDING1              16
+#define LTTNG_HANDLE_PADDING1 16
 struct lttng_handle {
        char session_name[LTTNG_NAME_MAX];
        struct lttng_domain domain;
@@ -42,7 +42,7 @@ struct lttng_handle {
  * lttng_destroy_handle. On error, NULL is returned.
  */
 LTTNG_EXPORT extern struct lttng_handle *lttng_create_handle(const char *session_name,
-               struct lttng_domain *domain);
+                                                            struct lttng_domain *domain);
 
 /*
  * Destroy an handle that has been previously created with lttng_create_handle.
@@ -51,7 +51,6 @@ LTTNG_EXPORT extern struct lttng_handle *lttng_create_handle(const char *session
  */
 LTTNG_EXPORT extern void lttng_destroy_handle(struct lttng_handle *handle);
 
-
 #ifdef __cplusplus
 }
 #endif
index b1dc33047db713aec10181496d8edd83c4dbd6fa..a3bf001ce757879c8eb728286c1961b720da18a5 100644 (file)
  */
 
 #include <common/compat/time.hpp>
+#include <common/macros.hpp>
+
+#include <lttng/health.h>
+
 #include <pthread.h>
+#include <urcu/list.h>
 #include <urcu/tls-compat.h>
 #include <urcu/uatomic.h>
-#include <urcu/list.h>
-#include <lttng/health.h>
-#include <common/macros.hpp>
 
 /*
  * These are the value added to the current state depending of the position in
  * the thread where is either waiting on a poll() or running in the code.
  */
-#define HEALTH_POLL_VALUE      (1UL << 0)
-#define HEALTH_CODE_VALUE      (1UL << 1)
+#define HEALTH_POLL_VALUE (1UL << 0)
+#define HEALTH_CODE_VALUE (1UL << 1)
 
-#define HEALTH_IS_IN_POLL(x)   ((x) & HEALTH_POLL_VALUE)
+#define HEALTH_IS_IN_POLL(x) ((x) &HEALTH_POLL_VALUE)
 
 struct health_app;
 
 enum health_flags {
-       HEALTH_ERROR                     = (1U << 0),
+       HEALTH_ERROR = (1U << 0),
 };
 
 struct health_state {
@@ -43,23 +45,23 @@ struct health_state {
        /*
         * current and flags are updated by multiple threads concurrently.
         */
-       unsigned long current;          /* progress counter, updated atomically */
-       enum health_flags flags;        /* other flags, updated atomically */
-       int type;                       /* Indicates the nature of the thread. */
+       unsigned long current; /* progress counter, updated atomically */
+       enum health_flags flags; /* other flags, updated atomically */
+       int type; /* Indicates the nature of the thread. */
        /* Node of the global TLS state list. */
        struct cds_list_head node;
 };
 
 enum health_cmd {
-       HEALTH_CMD_CHECK                = 0,
+       HEALTH_CMD_CHECK = 0,
 };
 
 struct health_comm_msg {
-       uint32_t cmd;           /* enum health_cmd */
+       uint32_t cmd; /* enum health_cmd */
 } LTTNG_PACKED;
 
 struct health_comm_reply {
-       uint64_t ret_code;      /* bitmask of threads in bad health */
+       uint64_t ret_code; /* bitmask of threads in bad health */
 } LTTNG_PACKED;
 
 /* Declare TLS health state. */
@@ -73,8 +75,7 @@ extern DECLARE_URCU_TLS(struct health_state, health_state);
 static inline void health_poll_entry()
 {
        /* Code MUST be in code execution state which is an even number. */
-       LTTNG_ASSERT(!(uatomic_read(&URCU_TLS(health_state).current)
-                               & HEALTH_POLL_VALUE));
+       LTTNG_ASSERT(!(uatomic_read(&URCU_TLS(health_state).current) & HEALTH_POLL_VALUE));
 
        uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE);
 }
@@ -87,8 +88,7 @@ static inline void health_poll_entry()
 static inline void health_poll_exit()
 {
        /* Code MUST be in poll execution state which is an odd number. */
-       LTTNG_ASSERT(uatomic_read(&URCU_TLS(health_state).current)
-                               & HEALTH_POLL_VALUE);
+       LTTNG_ASSERT(uatomic_read(&URCU_TLS(health_state).current) & HEALTH_POLL_VALUE);
 
        uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE);
 }
index 26e88570542777ea16deae79f46bdd0041fbd316..4e82c7be13ad8c4d9a1c8569a461761d867f0ceb 100644 (file)
@@ -40,7 +40,7 @@ LTTNG_EXPORT extern struct lttng_health *lttng_health_create_sessiond(void);
  * Return a newly allocated health object, or NULL on error.
  */
 LTTNG_EXPORT extern struct lttng_health *
-       lttng_health_create_consumerd(enum lttng_health_consumerd consumerd);
+lttng_health_create_consumerd(enum lttng_health_consumerd consumerd);
 
 /**
  * lttng_health_create_relayd - Create relayd health object
@@ -101,8 +101,7 @@ LTTNG_EXPORT extern int lttng_health_get_nr_threads(const struct lttng_health *h
  * lttng_health_destroy() is called on @health.
  */
 LTTNG_EXPORT extern const struct lttng_health_thread *
-       lttng_health_get_thread(const struct lttng_health *health,
-               unsigned int nth_thread);
+lttng_health_get_thread(const struct lttng_health *health, unsigned int nth_thread);
 
 /**
  * lttng_health_thread_state - Get thread health state
index ec8740a62534dafb5f1099269ddb2b0253317954..bdafb4d0a56a865cdd024534c1af562ebd4e6d0f 100644 (file)
 
 #include <common/fd-handle.hpp>
 #include <common/macros.hpp>
-#include <lttng/lttng-error.h>
+
 #include <lttng/kernel-probe.h>
 #include <lttng/lttng-error.h>
+
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
@@ -80,26 +81,22 @@ struct lttng_kernel_probe_location_address {
        uint64_t address;
 };
 
-int lttng_kernel_probe_location_serialize(
-               const struct lttng_kernel_probe_location *location,
-               struct lttng_payload *payload);
+int lttng_kernel_probe_location_serialize(const struct lttng_kernel_probe_location *location,
+                                         struct lttng_payload *payload);
 
 ssize_t lttng_kernel_probe_location_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_kernel_probe_location **probe_location);
+       struct lttng_payload_view *view, struct lttng_kernel_probe_location **probe_location);
 
-bool lttng_kernel_probe_location_is_equal(
-               const struct lttng_kernel_probe_location *a,
-               const struct lttng_kernel_probe_location *b);
+bool lttng_kernel_probe_location_is_equal(const struct lttng_kernel_probe_location *a,
+                                         const struct lttng_kernel_probe_location *b);
 
-struct lttng_kernel_probe_location *lttng_kernel_probe_location_copy(
-               const struct lttng_kernel_probe_location *location);
+struct lttng_kernel_probe_location *
+lttng_kernel_probe_location_copy(const struct lttng_kernel_probe_location *location);
 
-unsigned long lttng_kernel_probe_location_hash(
-               const struct lttng_kernel_probe_location *location);
+unsigned long lttng_kernel_probe_location_hash(const struct lttng_kernel_probe_location *location);
 
-enum lttng_error_code lttng_kernel_probe_location_mi_serialize(
-               const struct lttng_kernel_probe_location *location,
-               struct mi_writer *writer);
+enum lttng_error_code
+lttng_kernel_probe_location_mi_serialize(const struct lttng_kernel_probe_location *location,
+                                        struct mi_writer *writer);
 
 #endif /* LTTNG_KERNEL_PROBE_INTERNAL_H */
index cdd617dea12625296435615fa72f778f3ff84938..8e894fae8714564cfa0d71108f65b35cae30dedc 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_KERNEL_PROBE_H
 
 #include <lttng/lttng-export.h>
+
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -18,53 +19,50 @@ extern "C" {
 struct lttng_kernel_probe_location;
 
 enum lttng_kernel_probe_location_status {
-       LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK           = 0,
+       LTTNG_KERNEL_PROBE_LOCATION_STATUS_OK = 0,
        /* Invalid parameters provided. */
-       LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID      = -1,
+       LTTNG_KERNEL_PROBE_LOCATION_STATUS_INVALID = -1,
 };
 
 enum lttng_kernel_probe_location_type {
-       LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN        = -1,
+       LTTNG_KERNEL_PROBE_LOCATION_TYPE_UNKNOWN = -1,
        /* Location derived from a symbol and an offset. */
-       LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET  = 0,
+       LTTNG_KERNEL_PROBE_LOCATION_TYPE_SYMBOL_OFFSET = 0,
        /* Location derived from an address. */
-       LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS        = 1,
+       LTTNG_KERNEL_PROBE_LOCATION_TYPE_ADDRESS = 1,
 };
 
 /*
  * Get the type of the kernel probe location.
  */
 LTTNG_EXPORT extern enum lttng_kernel_probe_location_type
-lttng_kernel_probe_location_get_type(
-               const struct lttng_kernel_probe_location *location);
+lttng_kernel_probe_location_get_type(const struct lttng_kernel_probe_location *location);
 
 /*
  * Destroy the kernel probe location.
  */
-LTTNG_EXPORT extern void lttng_kernel_probe_location_destroy(
-               struct lttng_kernel_probe_location *location);
+LTTNG_EXPORT extern void
+lttng_kernel_probe_location_destroy(struct lttng_kernel_probe_location *location);
 
 /*
  * Create a symbol derived probe location.
  * On failure, NULL is returned.
  */
 LTTNG_EXPORT extern struct lttng_kernel_probe_location *
-lttng_kernel_probe_location_symbol_create(const char *symbol_name,
-               uint64_t offset);
+lttng_kernel_probe_location_symbol_create(const char *symbol_name, uint64_t offset);
 
 /*
  * Get the symbol name of a symbol derived probe location.
  */
-LTTNG_EXPORT extern const char *lttng_kernel_probe_location_symbol_get_name(
-               const struct lttng_kernel_probe_location *location);
+LTTNG_EXPORT extern const char *
+lttng_kernel_probe_location_symbol_get_name(const struct lttng_kernel_probe_location *location);
 
 /*
  * Get the offset of a symbol derived location.
  */
 LTTNG_EXPORT extern enum lttng_kernel_probe_location_status
-lttng_kernel_probe_location_symbol_get_offset(
-               const struct lttng_kernel_probe_location *location,
-               uint64_t *offset);
+lttng_kernel_probe_location_symbol_get_offset(const struct lttng_kernel_probe_location *location,
+                                             uint64_t *offset);
 
 /*
  * Create an address derived probe location.
@@ -77,9 +75,8 @@ lttng_kernel_probe_location_address_create(uint64_t address);
  * Get the address of an address derived probe location.
  */
 LTTNG_EXPORT extern enum lttng_kernel_probe_location_status
-lttng_kernel_probe_location_address_get_address(
-               const struct lttng_kernel_probe_location *location,
-               uint64_t *offset);
+lttng_kernel_probe_location_address_get_address(const struct lttng_kernel_probe_location *location,
+                                               uint64_t *offset);
 
 #ifdef __cplusplus
 }
index ef09ffd9cebb40dfa76f5002a5fda317e95f8870..78f38e47e9d5811f180c93ae8eab5a665cec1a4e 100644 (file)
@@ -9,12 +9,13 @@
 #ifndef LTTNG_LOAD_INTERNAL_ABI_H
 #define LTTNG_LOAD_INTERNAL_ABI_H
 
-#include <limits.h>
-#include <stdint.h>
+#include <common/config/session-config.hpp>
+#include <common/macros.hpp>
 
 #include <lttng/constant.h>
-#include <common/macros.hpp>
-#include <common/config/session-config.hpp>
+
+#include <limits.h>
+#include <stdint.h>
 
 /*
  * Object used by the load_session API. This is opaque to the public library.
index 0395bb4145acfea3923abeca700eaf3c062aa527..5f7b4ec4473da82f2bc7e3a003f123f2b8b665c8 100644 (file)
@@ -31,21 +31,20 @@ LTTNG_EXPORT extern struct lttng_load_session_attr *lttng_load_session_attr_crea
  */
 LTTNG_EXPORT extern void lttng_load_session_attr_destroy(struct lttng_load_session_attr *attr);
 
-
 /*
  * Load session attribute getter family of functions.
  */
 
 /* Return session name. NULL indicates all sessions must be loaded. */
-LTTNG_EXPORT extern const char *lttng_load_session_attr_get_session_name(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_load_session_attr_get_session_name(struct lttng_load_session_attr *attr);
 /*
  * Return input URL. A NULL value indicates the default session
  * configuration location. The URL format used is documented in lttng-create(1).
  * NULL indicates that the default session configuration path is used.
  */
-LTTNG_EXPORT extern const char *lttng_load_session_attr_get_input_url(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_load_session_attr_get_input_url(struct lttng_load_session_attr *attr);
 
 /*
  * Return the configuration overwrite attribute. This attribute indicates
@@ -53,8 +52,7 @@ LTTNG_EXPORT extern const char *lttng_load_session_attr_get_input_url(
  * same name already exists. If such a session exists, it is destroyed before
  * the replacement is loaded.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_get_overwrite(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern int lttng_load_session_attr_get_overwrite(struct lttng_load_session_attr *attr);
 
 /*
  * Return the destination URL configuration override attribute. This attribute
@@ -63,8 +61,8 @@ LTTNG_EXPORT extern int lttng_load_session_attr_get_overwrite(
  *
  * NULL indicates no override will be applied on configuration load.
  */
-LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_url(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_load_session_attr_get_override_url(struct lttng_load_session_attr *attr);
 
 /*
  * Return the configuration override control URL attribute. This attribute
@@ -73,8 +71,8 @@ LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_url(
  *
  * NULL indicates no control URL override will be applied on configuration load.
  */
-LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_ctrl_url(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_load_session_attr_get_override_ctrl_url(struct lttng_load_session_attr *attr);
 
 /*
  * Return the configuration override data URL attribute. This attribute
@@ -83,8 +81,8 @@ LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_ctrl_url(
  *
  * NULL indicates no data URL override will be applied on configuration load.
  */
-LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_data_url(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_load_session_attr_get_override_data_url(struct lttng_load_session_attr *attr);
 
 /*
  * Return the configuration override session name attribute.
@@ -94,8 +92,8 @@ LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_data_url(
  * NULL indicates no session name override will be applied on configuration
  * load.
  */
-LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_session_name(
-       struct lttng_load_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_load_session_attr_get_override_session_name(struct lttng_load_session_attr *attr);
 
 /*
  * Load session attribute setter family of functions.
@@ -108,8 +106,9 @@ LTTNG_EXPORT extern const char *lttng_load_session_attr_get_override_session_nam
  * Set the name of the session to load. A NULL name means all sessions
  * found at the input URL will be loaded.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_session_name(
-       struct lttng_load_session_attr *attr, const char *session_name);
+LTTNG_EXPORT extern int
+lttng_load_session_attr_set_session_name(struct lttng_load_session_attr *attr,
+                                        const char *session_name);
 
 /*
  * Set the URL of the session configuration to load. A NULL value indicates the
@@ -117,16 +116,16 @@ LTTNG_EXPORT extern int lttng_load_session_attr_set_session_name(
  *
  * Note that file:// is the only supported URL format.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_input_url(
-       struct lttng_load_session_attr *attr, const char *url);
+LTTNG_EXPORT extern int lttng_load_session_attr_set_input_url(struct lttng_load_session_attr *attr,
+                                                             const char *url);
 
 /*
  * Set the overwrite attribute. If set to true, current sessions matching the
  * loaded sessions will be destroyed and be replaced by the session(s) being
  * loaded.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_overwrite(
-       struct lttng_load_session_attr *attr, int overwrite);
+LTTNG_EXPORT extern int lttng_load_session_attr_set_overwrite(struct lttng_load_session_attr *attr,
+                                                             int overwrite);
 
 /*
  * The following setter are for overriding sessions attributes during the
@@ -145,8 +144,8 @@ LTTNG_EXPORT extern int lttng_load_session_attr_set_overwrite(
  *
  * See lttng-create(1) for more detail.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_override_url(
-       struct lttng_load_session_attr *attr, const char *url);
+LTTNG_EXPORT extern int
+lttng_load_session_attr_set_override_url(struct lttng_load_session_attr *attr, const char *url);
 
 /*
  * Set the control url override attribute.
@@ -158,8 +157,9 @@ LTTNG_EXPORT extern int lttng_load_session_attr_set_override_url(
  *
  * See lttng-create(1) for more detail.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_override_ctrl_url(
-       struct lttng_load_session_attr *attr, const char *url);
+LTTNG_EXPORT extern int
+lttng_load_session_attr_set_override_ctrl_url(struct lttng_load_session_attr *attr,
+                                             const char *url);
 
 /*
  * Set the data url override attribute.
@@ -171,8 +171,9 @@ LTTNG_EXPORT extern int lttng_load_session_attr_set_override_ctrl_url(
  *
  * See lttng-create(1) for more detail.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_override_data_url(
-       struct lttng_load_session_attr *attr, const char *url);
+LTTNG_EXPORT extern int
+lttng_load_session_attr_set_override_data_url(struct lttng_load_session_attr *attr,
+                                             const char *url);
 
 /*
  * Set the session name override attribute.
@@ -180,8 +181,9 @@ LTTNG_EXPORT extern int lttng_load_session_attr_set_override_data_url(
  * Loading a configuration file defining multiple sessions will fail if a
  * session name is provided.
  */
-LTTNG_EXPORT extern int lttng_load_session_attr_set_override_session_name(
-       struct lttng_load_session_attr *attr, const char *session_name);
+LTTNG_EXPORT extern int
+lttng_load_session_attr_set_override_session_name(struct lttng_load_session_attr *attr,
+                                                 const char *session_name);
 
 /*
  * Load session configuration(s).
index 4daeed061b06d8e2916f6ce141ef6c3bee0e3d65..669347e2ebbca28f18b6c82a463d2f2aa992a493 100644 (file)
@@ -8,10 +8,12 @@
 #ifndef LTTNG_LOCATION_INTERNAL_H
 #define LTTNG_LOCATION_INTERNAL_H
 
-#include <lttng/location.h>
-#include <common/dynamic-buffer.hpp>
 #include <common/buffer-view.hpp>
+#include <common/dynamic-buffer.hpp>
 #include <common/macros.hpp>
+
+#include <lttng/location.h>
+
 #include <sys/types.h>
 #include <urcu/ref.h>
 
@@ -73,28 +75,24 @@ struct lttng_trace_archive_location_comm {
        char payload[];
 } LTTNG_PACKED;
 
-
-struct lttng_trace_archive_location *lttng_trace_archive_location_local_create(
-               const char *path);
+struct lttng_trace_archive_location *lttng_trace_archive_location_local_create(const char *path);
 
 struct lttng_trace_archive_location *lttng_trace_archive_location_relay_create(
-               const char *host,
-               enum lttng_trace_archive_location_relay_protocol_type protocol,
-               uint16_t control_port, uint16_t data_port,
-               const char *relative_path);
+       const char *host,
+       enum lttng_trace_archive_location_relay_protocol_type protocol,
+       uint16_t control_port,
+       uint16_t data_port,
+       const char *relative_path);
 
-ssize_t lttng_trace_archive_location_create_from_buffer(
-               const struct lttng_buffer_view *buffer,
-               struct lttng_trace_archive_location **location);
+ssize_t
+lttng_trace_archive_location_create_from_buffer(const struct lttng_buffer_view *buffer,
+                                               struct lttng_trace_archive_location **location);
 
-ssize_t lttng_trace_archive_location_serialize(
-               const struct lttng_trace_archive_location *location,
-               struct lttng_dynamic_buffer *buffer);
+ssize_t lttng_trace_archive_location_serialize(const struct lttng_trace_archive_location *location,
+                                              struct lttng_dynamic_buffer *buffer);
 
-void lttng_trace_archive_location_get(
-               struct lttng_trace_archive_location *location);
+void lttng_trace_archive_location_get(struct lttng_trace_archive_location *location);
 
-void lttng_trace_archive_location_put(
-               struct lttng_trace_archive_location *location);
+void lttng_trace_archive_location_put(struct lttng_trace_archive_location *location);
 
 #endif /* LTTNG_LOCATION_INTERNAL_H */
index ce686315effe4ffa1149d7344cb85c4dcfca60fd..a1ea16f23a60cd75cf2f09b61e8eee8e28395c7d 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_LOCATION_H
 
 #include <lttng/lttng-export.h>
+
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -40,8 +41,7 @@ struct lttng_trace_archive_location;
  * Get a trace archive location's type.
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_type
-lttng_trace_archive_location_get_type(
-               const struct lttng_trace_archive_location *location);
+lttng_trace_archive_location_get_type(const struct lttng_trace_archive_location *location);
 
 /*
  * Get the absolute path of a local trace archive location.
@@ -50,8 +50,7 @@ lttng_trace_archive_location_get_type(
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_status
 lttng_trace_archive_location_local_get_absolute_path(
-               const struct lttng_trace_archive_location *location,
-               const char **absolute_path);
+       const struct lttng_trace_archive_location *location, const char **absolute_path);
 
 /*
  * Get the host address of the relay daemon associated to this trace archive
@@ -60,9 +59,8 @@ lttng_trace_archive_location_local_get_absolute_path(
  * The trace archive location maintains ownership of relay_host.
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_status
-lttng_trace_archive_location_relay_get_host(
-               const struct lttng_trace_archive_location *location,
-               const char **relay_host);
+lttng_trace_archive_location_relay_get_host(const struct lttng_trace_archive_location *location,
+                                           const char **relay_host);
 
 /*
  * Get the control port of the relay daemon associated to this trace archive
@@ -70,8 +68,7 @@ lttng_trace_archive_location_relay_get_host(
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_status
 lttng_trace_archive_location_relay_get_control_port(
-               const struct lttng_trace_archive_location *location,
-               uint16_t *control_port);
+       const struct lttng_trace_archive_location *location, uint16_t *control_port);
 
 /*
  * Get the data port of the relay daemon associated to this trace archive
@@ -79,8 +76,7 @@ lttng_trace_archive_location_relay_get_control_port(
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_status
 lttng_trace_archive_location_relay_get_data_port(
-               const struct lttng_trace_archive_location *location,
-               uint16_t *data_port);
+       const struct lttng_trace_archive_location *location, uint16_t *data_port);
 
 /*
  * Get the protocol used to communicate with the relay daemon associated to this
@@ -88,8 +84,8 @@ lttng_trace_archive_location_relay_get_data_port(
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_status
 lttng_trace_archive_location_relay_get_protocol_type(
-               const struct lttng_trace_archive_location *location,
-               enum lttng_trace_archive_location_relay_protocol_type *protocol);
+       const struct lttng_trace_archive_location *location,
+       enum lttng_trace_archive_location_relay_protocol_type *protocol);
 
 /*
  * Get path relative to the relay daemon's current output path.
@@ -98,8 +94,7 @@ lttng_trace_archive_location_relay_get_protocol_type(
  */
 LTTNG_EXPORT extern enum lttng_trace_archive_location_status
 lttng_trace_archive_location_relay_get_relative_path(
-               const struct lttng_trace_archive_location *location,
-               const char **relative_path);
+       const struct lttng_trace_archive_location *location, const char **relative_path);
 
 #ifdef __cplusplus
 }
index 71447cfe35ff6f5b49fadbd974d4e34251e02cdb..6b08e8a5ff517cbe47ec7d032dff43a47d465c4b 100644 (file)
@@ -8,17 +8,18 @@
 #ifndef LTTNG_LOG_LEVEL_RULE_INTERNAL_H
 #define LTTNG_LOG_LEVEL_RULE_INTERNAL_H
 
-#include <stdint.h>
-
 #include <common/buffer-view.hpp>
 #include <common/dynamic-array.hpp>
 #include <common/macros.hpp>
 #include <common/payload-view.hpp>
 #include <common/payload.hpp>
+
 #include <lttng/event.h>
 #include <lttng/log-level-rule.h>
 #include <lttng/lttng-error.h>
 
+#include <stdint.h>
+
 struct mi_writer;
 
 /*
@@ -36,29 +37,24 @@ struct lttng_log_level_rule_comm {
        int32_t level;
 };
 
-ssize_t lttng_log_level_rule_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_log_level_rule **rule);
+ssize_t lttng_log_level_rule_create_from_payload(struct lttng_payload_view *view,
+                                                struct lttng_log_level_rule **rule);
 
 int lttng_log_level_rule_serialize(const struct lttng_log_level_rule *rule,
-               struct lttng_payload *payload);
+                                  struct lttng_payload *payload);
 
 bool lttng_log_level_rule_is_equal(const struct lttng_log_level_rule *a,
-               const struct lttng_log_level_rule *b);
+                                  const struct lttng_log_level_rule *b);
 
-struct lttng_log_level_rule *lttng_log_level_rule_copy(
-               const struct lttng_log_level_rule *source);
+struct lttng_log_level_rule *lttng_log_level_rule_copy(const struct lttng_log_level_rule *source);
 
-void lttng_log_level_rule_to_loglevel(
-               const struct lttng_log_level_rule *log_level_rule,
-               enum lttng_loglevel_type *loglevel_type,
-               int *loglevel_value);
+void lttng_log_level_rule_to_loglevel(const struct lttng_log_level_rule *log_level_rule,
+                                     enum lttng_loglevel_type *loglevel_type,
+                                     int *loglevel_value);
 
-unsigned long lttng_log_level_rule_hash(
-               const struct lttng_log_level_rule *log_level_rule);
+unsigned long lttng_log_level_rule_hash(const struct lttng_log_level_rule *log_level_rule);
 
-enum lttng_error_code lttng_log_level_rule_mi_serialize(
-               const struct lttng_log_level_rule *rule,
-               struct mi_writer *writer);
+enum lttng_error_code lttng_log_level_rule_mi_serialize(const struct lttng_log_level_rule *rule,
+                                                       struct mi_writer *writer);
 
 #endif /* LTTNG_LOG_LEVEL_RULE_INTERNAL_H */
index ddb3501a1a66f4e2bfe49577ef32c9f298f7f4da..a73b26ae3e514d8904ddc2b035640e4a1b733ae8 100644 (file)
@@ -34,8 +34,8 @@ enum lttng_log_level_rule_status {
  * `LTTNG_LOG_LEVEL_RULE_TYPE_UNKNOWN`:
  *     `rule` is `NULL`.
  */
-LTTNG_EXPORT extern enum lttng_log_level_rule_type lttng_log_level_rule_get_type(
-               const struct lttng_log_level_rule *rule);
+LTTNG_EXPORT extern enum lttng_log_level_rule_type
+lttng_log_level_rule_get_type(const struct lttng_log_level_rule *rule);
 
 /*
  * Creates a log level rule for which a log level must match exactly `level` to
@@ -48,8 +48,7 @@ LTTNG_EXPORT extern enum lttng_log_level_rule_type lttng_log_level_rule_get_type
  * The returned log level rule must be destroyed using
  * lttng_log_level_rule_destroy().
  */
-LTTNG_EXPORT extern struct lttng_log_level_rule *lttng_log_level_rule_exactly_create(
-               int level);
+LTTNG_EXPORT extern struct lttng_log_level_rule *lttng_log_level_rule_exactly_create(int level);
 
 /*
  * Sets `level` to the level of the "exactly" log level rule `rule`.
@@ -64,8 +63,8 @@ LTTNG_EXPORT extern struct lttng_log_level_rule *lttng_log_level_rule_exactly_cr
  *     * `level` is NULL.
  *     * The type of `rule` is not `LTTNG_LOG_LEVEL_RULE_TYPE_EXACTLY`.
  */
-LTTNG_EXPORT extern enum lttng_log_level_rule_status lttng_log_level_rule_exactly_get_level(
-               const struct lttng_log_level_rule *rule, int *level);
+LTTNG_EXPORT extern enum lttng_log_level_rule_status
+lttng_log_level_rule_exactly_get_level(const struct lttng_log_level_rule *rule, int *level);
 
 /*
  * Creates a log level rule for which a log level must be at least as severe as
@@ -97,14 +96,13 @@ lttng_log_level_rule_at_least_as_severe_as_create(int level);
  *       `LTTNG_LOG_LEVEL_RULE_TYPE_AT_LEAST_AS_SEVERE_AS`.
  */
 LTTNG_EXPORT extern enum lttng_log_level_rule_status
-lttng_log_level_rule_at_least_as_severe_as_get_level(
-               const struct lttng_log_level_rule *rule, int *level);
+lttng_log_level_rule_at_least_as_severe_as_get_level(const struct lttng_log_level_rule *rule,
+                                                    int *level);
 
 /*
  * Destroy the log level rule `log_level_rule` if not `NULL`.
  */
-LTTNG_EXPORT extern void lttng_log_level_rule_destroy(
-               struct lttng_log_level_rule *log_level_rule);
+LTTNG_EXPORT extern void lttng_log_level_rule_destroy(struct lttng_log_level_rule *log_level_rule);
 
 #ifdef __cplusplus
 }
index 790a78a0b60e88188486fc230b84c01ba031f347..df23a67bb82a790c5f766671df9afbe0dc3e987a 100644 (file)
@@ -22,174 +22,198 @@ extern "C" {
 #endif
 
 enum lttng_error_code {
-       LTTNG_OK                         = 10,  /* Ok */
-       LTTNG_ERR_UNK                    = 11,  /* Unknown Error */
-       LTTNG_ERR_UND                    = 12,  /* Undefined command */
-       LTTNG_ERR_SESSION_STARTED        = 13,  /* Session is running */
-       LTTNG_ERR_UNKNOWN_DOMAIN         = 14,  /* Tracing domain not known */
-       LTTNG_ERR_NOT_SUPPORTED          = 15,  /* Operation not supported */
-       LTTNG_ERR_NO_SESSION             = 16,  /* No session found */
-       LTTNG_ERR_CREATE_DIR_FAIL        = 17,  /* Create directory fail */
-       LTTNG_ERR_SESSION_FAIL           = 18,  /* Create session fail */
-       LTTNG_ERR_NO_SESSIOND            = 19,  /* No session daemon available */
-       LTTNG_ERR_SET_URL                = 20,  /* Error setting URL */
-       LTTNG_ERR_URL_EXIST              = 21,  /* URL already exists. */
-       LTTNG_ERR_BUFFER_NOT_SUPPORTED   = 22,  /* Buffer type not supported. */
-       LTTNG_ERR_SESS_NOT_FOUND         = 23,  /* Session by name not found */
-       LTTNG_ERR_BUFFER_TYPE_MISMATCH   = 24,  /* Buffer type mismatched. */
-       LTTNG_ERR_FATAL                  = 25,  /* Fatal error */
-       LTTNG_ERR_NOMEM                  = 26,  /* Not enough memory. */
-       LTTNG_ERR_SELECT_SESS            = 27,  /* Must select a session */
-       LTTNG_ERR_EXIST_SESS             = 28,  /* Session name already exist */
-       LTTNG_ERR_NO_EVENT               = 29,  /* No event found */
-       LTTNG_ERR_CONNECT_FAIL           = 30,  /* Unable to connect to unix socket */
-       LTTNG_ERR_SNAPSHOT_OUTPUT_EXIST  = 31,  /* Snapshot output already exists */
-       LTTNG_ERR_EPERM                  = 32,  /* Permission denied */
-       LTTNG_ERR_KERN_NA                = 33,  /* Kernel tracer unavailable */
-       LTTNG_ERR_KERN_VERSION           = 34,  /* Kernel tracer not compatible */
-       LTTNG_ERR_KERN_EVENT_EXIST       = 35,  /* Kernel event already exists */
-       LTTNG_ERR_KERN_SESS_FAIL         = 36,  /* Kernel create session failed */
-       LTTNG_ERR_KERN_CHAN_EXIST        = 37,  /* Kernel channel already exists */
-       LTTNG_ERR_KERN_CHAN_FAIL         = 38,  /* Kernel create channel failed */
-       LTTNG_ERR_KERN_CHAN_NOT_FOUND    = 39,  /* Kernel channel not found */
-       LTTNG_ERR_KERN_CHAN_DISABLE_FAIL = 40,  /* Kernel disable channel failed */
-       LTTNG_ERR_KERN_CHAN_ENABLE_FAIL  = 41,  /* Kernel enable channel failed */
-       LTTNG_ERR_KERN_CONTEXT_FAIL      = 42,  /* Kernel add context failed */
-       LTTNG_ERR_KERN_ENABLE_FAIL       = 43,  /* Kernel enable event failed */
-       LTTNG_ERR_KERN_DISABLE_FAIL      = 44,  /* Kernel disable event failed */
-       LTTNG_ERR_KERN_META_FAIL         = 45,  /* Kernel open metadata failed */
-       LTTNG_ERR_KERN_START_FAIL        = 46,  /* Kernel start trace failed */
-       LTTNG_ERR_KERN_STOP_FAIL         = 47,  /* Kernel stop trace failed */
-       LTTNG_ERR_KERN_CONSUMER_FAIL     = 48,  /* Kernel consumer start failed */
-       LTTNG_ERR_KERN_STREAM_FAIL       = 49,  /* Kernel create stream failed */
-       LTTNG_ERR_START_SESSION_ONCE     = 50,  /* Session needs to be started once. */
-       LTTNG_ERR_SNAPSHOT_FAIL          = 51,  /* Snapshot record failed. */
-       LTTNG_ERR_NO_STREAM              = 52,  /* Index without stream on relay. */
-       LTTNG_ERR_KERN_LIST_FAIL         = 53,  /* Kernel listing events failed */
-       LTTNG_ERR_UST_CALIBRATE_FAIL     = 54,  /* UST calibration failed */
-       LTTNG_ERR_UST_EVENT_ENABLED      = 55,  /* UST event already enabled. */
-       LTTNG_ERR_UST_SESS_FAIL          = 56,  /* UST create session failed */
-       LTTNG_ERR_UST_CHAN_EXIST         = 57,  /* UST channel already exist */
-       LTTNG_ERR_UST_CHAN_FAIL          = 58,  /* UST create channel failed */
-       LTTNG_ERR_UST_CHAN_NOT_FOUND     = 59,  /* UST channel not found */
-       LTTNG_ERR_UST_CHAN_DISABLE_FAIL  = 60,  /* UST disable channel failed */
-       LTTNG_ERR_UST_CHAN_ENABLE_FAIL   = 61,  /* UST enable channel failed */
-       LTTNG_ERR_CHAN_EXIST             = 62,  /* Channel already exists. */
-       LTTNG_ERR_UST_ENABLE_FAIL        = 63,  /* UST enable event failed */
-       LTTNG_ERR_UST_DISABLE_FAIL       = 64,  /* UST disable event failed */
-       LTTNG_ERR_UST_META_FAIL          = 65,  /* UST open metadata failed */
-       LTTNG_ERR_UST_START_FAIL         = 66,  /* UST start trace failed */
-       LTTNG_ERR_UST_STOP_FAIL          = 67,  /* UST stop trace failed */
-       LTTNG_ERR_UST_CONSUMER64_FAIL    = 68,  /* 64-bit UST consumer start failed */
-       LTTNG_ERR_UST_CONSUMER32_FAIL    = 69,  /* 32-bit UST consumer start failed */
-       LTTNG_ERR_UST_STREAM_FAIL        = 70,  /* UST create stream failed */
-       LTTNG_ERR_SNAPSHOT_NODATA        = 71,  /* No data in snapshot. */
-       LTTNG_ERR_NO_CHANNEL             = 72,  /* No channel found in the session. */
-       LTTNG_ERR_SESSION_INVALID_CHAR   = 73,  /* Invalid characters found in session name. */
-       LTTNG_ERR_UST_LIST_FAIL          = 74,  /* UST listing events failed */
-       LTTNG_ERR_UST_EVENT_EXIST        = 75,  /* UST event exist */
-       LTTNG_ERR_UST_EVENT_NOT_FOUND    = 76,  /* UST event not found */
-       LTTNG_ERR_UST_CONTEXT_EXIST      = 77,  /* UST context exist */
-       LTTNG_ERR_UST_CONTEXT_INVAL      = 78,  /* UST context invalid */
-       LTTNG_ERR_NEED_ROOT_SESSIOND     = 79,  /* root sessiond is needed */
-       LTTNG_ERR_TRACE_ALREADY_STARTED  = 80,  /* Tracing already started */
-       LTTNG_ERR_TRACE_ALREADY_STOPPED  = 81,  /* Tracing already stopped */
-       LTTNG_ERR_KERN_EVENT_ENOSYS      = 82,  /* Kernel event type not supported */
-       LTTNG_ERR_NEED_CHANNEL_NAME      = 83,  /* Non-default channel exists within session: channel name needs to be specified with '-c name' */
-       LTTNG_ERR_NO_UST                 = 84,  /* LTTng-UST tracer is not supported. Please rebuild lttng-tools with lttng-ust support enabled. */
-       LTTNG_ERR_SAVE_FILE_EXIST        = 85,  /* Session file already exists. */
-       LTTNG_ERR_SAVE_IO_FAIL           = 86,  /* IO error while writing session configuration */
-       LTTNG_ERR_LOAD_INVALID_CONFIG    = 87,  /* Invalid session configuration */
-       LTTNG_ERR_LOAD_IO_FAIL           = 88,  /* IO error while reading a session configuration */
-       LTTNG_ERR_LOAD_SESSION_NOENT     = 89,  /* Session file not found */
-       LTTNG_ERR_MAX_SIZE_INVALID       = 90,  /* Snapshot max size is invalid. */
-       LTTNG_ERR_MI_OUTPUT_TYPE         = 91,  /* Invalid MI output format */
-       LTTNG_ERR_MI_IO_FAIL             = 92,  /* IO error while writing machine interface output */
-       LTTNG_ERR_MI_NOT_IMPLEMENTED     = 93,  /* Mi feature not implemented */
+       LTTNG_OK = 10, /* Ok */
+       LTTNG_ERR_UNK = 11, /* Unknown Error */
+       LTTNG_ERR_UND = 12, /* Undefined command */
+       LTTNG_ERR_SESSION_STARTED = 13, /* Session is running */
+       LTTNG_ERR_UNKNOWN_DOMAIN = 14, /* Tracing domain not known */
+       LTTNG_ERR_NOT_SUPPORTED = 15, /* Operation not supported */
+       LTTNG_ERR_NO_SESSION = 16, /* No session found */
+       LTTNG_ERR_CREATE_DIR_FAIL = 17, /* Create directory fail */
+       LTTNG_ERR_SESSION_FAIL = 18, /* Create session fail */
+       LTTNG_ERR_NO_SESSIOND = 19, /* No session daemon available */
+       LTTNG_ERR_SET_URL = 20, /* Error setting URL */
+       LTTNG_ERR_URL_EXIST = 21, /* URL already exists. */
+       LTTNG_ERR_BUFFER_NOT_SUPPORTED = 22, /* Buffer type not supported. */
+       LTTNG_ERR_SESS_NOT_FOUND = 23, /* Session by name not found */
+       LTTNG_ERR_BUFFER_TYPE_MISMATCH = 24, /* Buffer type mismatched. */
+       LTTNG_ERR_FATAL = 25, /* Fatal error */
+       LTTNG_ERR_NOMEM = 26, /* Not enough memory. */
+       LTTNG_ERR_SELECT_SESS = 27, /* Must select a session */
+       LTTNG_ERR_EXIST_SESS = 28, /* Session name already exist */
+       LTTNG_ERR_NO_EVENT = 29, /* No event found */
+       LTTNG_ERR_CONNECT_FAIL = 30, /* Unable to connect to unix socket */
+       LTTNG_ERR_SNAPSHOT_OUTPUT_EXIST = 31, /* Snapshot output already exists */
+       LTTNG_ERR_EPERM = 32, /* Permission denied */
+       LTTNG_ERR_KERN_NA = 33, /* Kernel tracer unavailable */
+       LTTNG_ERR_KERN_VERSION = 34, /* Kernel tracer not compatible */
+       LTTNG_ERR_KERN_EVENT_EXIST = 35, /* Kernel event already exists */
+       LTTNG_ERR_KERN_SESS_FAIL = 36, /* Kernel create session failed */
+       LTTNG_ERR_KERN_CHAN_EXIST = 37, /* Kernel channel already exists */
+       LTTNG_ERR_KERN_CHAN_FAIL = 38, /* Kernel create channel failed */
+       LTTNG_ERR_KERN_CHAN_NOT_FOUND = 39, /* Kernel channel not found */
+       LTTNG_ERR_KERN_CHAN_DISABLE_FAIL = 40, /* Kernel disable channel failed */
+       LTTNG_ERR_KERN_CHAN_ENABLE_FAIL = 41, /* Kernel enable channel failed */
+       LTTNG_ERR_KERN_CONTEXT_FAIL = 42, /* Kernel add context failed */
+       LTTNG_ERR_KERN_ENABLE_FAIL = 43, /* Kernel enable event failed */
+       LTTNG_ERR_KERN_DISABLE_FAIL = 44, /* Kernel disable event failed */
+       LTTNG_ERR_KERN_META_FAIL = 45, /* Kernel open metadata failed */
+       LTTNG_ERR_KERN_START_FAIL = 46, /* Kernel start trace failed */
+       LTTNG_ERR_KERN_STOP_FAIL = 47, /* Kernel stop trace failed */
+       LTTNG_ERR_KERN_CONSUMER_FAIL = 48, /* Kernel consumer start failed */
+       LTTNG_ERR_KERN_STREAM_FAIL = 49, /* Kernel create stream failed */
+       LTTNG_ERR_START_SESSION_ONCE = 50, /* Session needs to be started once. */
+       LTTNG_ERR_SNAPSHOT_FAIL = 51, /* Snapshot record failed. */
+       LTTNG_ERR_NO_STREAM = 52, /* Index without stream on relay. */
+       LTTNG_ERR_KERN_LIST_FAIL = 53, /* Kernel listing events failed */
+       LTTNG_ERR_UST_CALIBRATE_FAIL = 54, /* UST calibration failed */
+       LTTNG_ERR_UST_EVENT_ENABLED = 55, /* UST event already enabled. */
+       LTTNG_ERR_UST_SESS_FAIL = 56, /* UST create session failed */
+       LTTNG_ERR_UST_CHAN_EXIST = 57, /* UST channel already exist */
+       LTTNG_ERR_UST_CHAN_FAIL = 58, /* UST create channel failed */
+       LTTNG_ERR_UST_CHAN_NOT_FOUND = 59, /* UST channel not found */
+       LTTNG_ERR_UST_CHAN_DISABLE_FAIL = 60, /* UST disable channel failed */
+       LTTNG_ERR_UST_CHAN_ENABLE_FAIL = 61, /* UST enable channel failed */
+       LTTNG_ERR_CHAN_EXIST = 62, /* Channel already exists. */
+       LTTNG_ERR_UST_ENABLE_FAIL = 63, /* UST enable event failed */
+       LTTNG_ERR_UST_DISABLE_FAIL = 64, /* UST disable event failed */
+       LTTNG_ERR_UST_META_FAIL = 65, /* UST open metadata failed */
+       LTTNG_ERR_UST_START_FAIL = 66, /* UST start trace failed */
+       LTTNG_ERR_UST_STOP_FAIL = 67, /* UST stop trace failed */
+       LTTNG_ERR_UST_CONSUMER64_FAIL = 68, /* 64-bit UST consumer start failed */
+       LTTNG_ERR_UST_CONSUMER32_FAIL = 69, /* 32-bit UST consumer start failed */
+       LTTNG_ERR_UST_STREAM_FAIL = 70, /* UST create stream failed */
+       LTTNG_ERR_SNAPSHOT_NODATA = 71, /* No data in snapshot. */
+       LTTNG_ERR_NO_CHANNEL = 72, /* No channel found in the session. */
+       LTTNG_ERR_SESSION_INVALID_CHAR = 73, /* Invalid characters found in session name. */
+       LTTNG_ERR_UST_LIST_FAIL = 74, /* UST listing events failed */
+       LTTNG_ERR_UST_EVENT_EXIST = 75, /* UST event exist */
+       LTTNG_ERR_UST_EVENT_NOT_FOUND = 76, /* UST event not found */
+       LTTNG_ERR_UST_CONTEXT_EXIST = 77, /* UST context exist */
+       LTTNG_ERR_UST_CONTEXT_INVAL = 78, /* UST context invalid */
+       LTTNG_ERR_NEED_ROOT_SESSIOND = 79, /* root sessiond is needed */
+       LTTNG_ERR_TRACE_ALREADY_STARTED = 80, /* Tracing already started */
+       LTTNG_ERR_TRACE_ALREADY_STOPPED = 81, /* Tracing already stopped */
+       LTTNG_ERR_KERN_EVENT_ENOSYS = 82, /* Kernel event type not supported */
+       LTTNG_ERR_NEED_CHANNEL_NAME = 83, /* Non-default channel exists within session: channel name
+                                            needs to be specified with '-c name' */
+       LTTNG_ERR_NO_UST = 84, /* LTTng-UST tracer is not supported. Please rebuild lttng-tools with
+                                 lttng-ust support enabled. */
+       LTTNG_ERR_SAVE_FILE_EXIST = 85, /* Session file already exists. */
+       LTTNG_ERR_SAVE_IO_FAIL = 86, /* IO error while writing session configuration */
+       LTTNG_ERR_LOAD_INVALID_CONFIG = 87, /* Invalid session configuration */
+       LTTNG_ERR_LOAD_IO_FAIL = 88, /* IO error while reading a session configuration */
+       LTTNG_ERR_LOAD_SESSION_NOENT = 89, /* Session file not found */
+       LTTNG_ERR_MAX_SIZE_INVALID = 90, /* Snapshot max size is invalid. */
+       LTTNG_ERR_MI_OUTPUT_TYPE = 91, /* Invalid MI output format */
+       LTTNG_ERR_MI_IO_FAIL = 92, /* IO error while writing machine interface output */
+       LTTNG_ERR_MI_NOT_IMPLEMENTED = 93, /* Mi feature not implemented */
        /* 94 */
        /* 95 */
        /* 96 */
-       LTTNG_ERR_INVALID                = 97,  /* Invalid parameter */
-       LTTNG_ERR_NO_USTCONSUMERD        = 98,  /* No UST consumer detected */
-       LTTNG_ERR_NO_KERNCONSUMERD       = 99,  /* No Kernel consumer detected */
-       LTTNG_ERR_EVENT_EXIST_LOGLEVEL   = 100, /* Event enabled with different loglevel */
-       LTTNG_ERR_URL_DATA_MISS          = 101, /* Missing network data URL */
-       LTTNG_ERR_URL_CTRL_MISS          = 102, /* Missing network control URL */
-       LTTNG_ERR_ENABLE_CONSUMER_FAIL   = 103, /* Enabling consumer failed */
-       LTTNG_ERR_RELAYD_CONNECT_FAIL    = 104, /* lttng-relayd create session failed */
-       LTTNG_ERR_RELAYD_VERSION_FAIL    = 105, /* lttng-relayd not compatible */
-       LTTNG_ERR_FILTER_INVAL           = 106, /* Invalid filter bytecode */
-       LTTNG_ERR_FILTER_NOMEM           = 107, /* Lack of memory for filter bytecode */
-       LTTNG_ERR_FILTER_EXIST           = 108, /* Filter already exist */
-       LTTNG_ERR_NO_CONSUMER            = 109, /* No consumer exist for the session */
-       LTTNG_ERR_EXCLUSION_INVAL        = 110, /* Invalid event exclusion data */
-       LTTNG_ERR_EXCLUSION_NOMEM        = 111, /* Lack of memory while processing event exclusions */
-       LTTNG_ERR_INVALID_EVENT_NAME     = 112, /* Invalid event name */
-       LTTNG_ERR_INVALID_CHANNEL_NAME   = 113, /* Invalid channel name */
-       LTTNG_ERR_PROCESS_ATTR_EXISTS  = 114, /* Process attribute is already tracked */
+       LTTNG_ERR_INVALID = 97, /* Invalid parameter */
+       LTTNG_ERR_NO_USTCONSUMERD = 98, /* No UST consumer detected */
+       LTTNG_ERR_NO_KERNCONSUMERD = 99, /* No Kernel consumer detected */
+       LTTNG_ERR_EVENT_EXIST_LOGLEVEL = 100, /* Event enabled with different loglevel */
+       LTTNG_ERR_URL_DATA_MISS = 101, /* Missing network data URL */
+       LTTNG_ERR_URL_CTRL_MISS = 102, /* Missing network control URL */
+       LTTNG_ERR_ENABLE_CONSUMER_FAIL = 103, /* Enabling consumer failed */
+       LTTNG_ERR_RELAYD_CONNECT_FAIL = 104, /* lttng-relayd create session failed */
+       LTTNG_ERR_RELAYD_VERSION_FAIL = 105, /* lttng-relayd not compatible */
+       LTTNG_ERR_FILTER_INVAL = 106, /* Invalid filter bytecode */
+       LTTNG_ERR_FILTER_NOMEM = 107, /* Lack of memory for filter bytecode */
+       LTTNG_ERR_FILTER_EXIST = 108, /* Filter already exist */
+       LTTNG_ERR_NO_CONSUMER = 109, /* No consumer exist for the session */
+       LTTNG_ERR_EXCLUSION_INVAL = 110, /* Invalid event exclusion data */
+       LTTNG_ERR_EXCLUSION_NOMEM = 111, /* Lack of memory while processing event exclusions */
+       LTTNG_ERR_INVALID_EVENT_NAME = 112, /* Invalid event name */
+       LTTNG_ERR_INVALID_CHANNEL_NAME = 113, /* Invalid channel name */
+       LTTNG_ERR_PROCESS_ATTR_EXISTS = 114, /* Process attribute is already tracked */
        LTTNG_ERR_PROCESS_ATTR_MISSING = 115, /* Process attribute was not tracked */
        LTTNG_ERR_INVALID_CHANNEL_DOMAIN = 116, /* Invalid channel domain */
-       LTTNG_ERR_OVERFLOW               = 117, /* Overflow occurred. */
-       LTTNG_ERR_SESSION_NOT_STARTED    = 118, /* Session not started */
-       LTTNG_ERR_LIVE_SESSION           = 119, /* Live session unsupported */
-       LTTNG_ERR_PER_PID_SESSION        = 120, /* Per-PID sessions unsupported */
+       LTTNG_ERR_OVERFLOW = 117, /* Overflow occurred. */
+       LTTNG_ERR_SESSION_NOT_STARTED = 118, /* Session not started */
+       LTTNG_ERR_LIVE_SESSION = 119, /* Live session unsupported */
+       LTTNG_ERR_PER_PID_SESSION = 120, /* Per-PID sessions unsupported */
        LTTNG_ERR_KERN_CONTEXT_UNAVAILABLE = 121, /* Context unavailable on this kernel */
-       LTTNG_ERR_REGEN_STATEDUMP_FAIL   = 122, /* Failed to regenerate the state dump */
-       LTTNG_ERR_REGEN_STATEDUMP_NOMEM  = 123, /* Failed to regenerate the state dump, not enough memory */
-       LTTNG_ERR_NOT_SNAPSHOT_SESSION   = 124, /* Session is not in snapshot mode. */
-       LTTNG_ERR_INVALID_TRIGGER        = 125, /* Invalid trigger provided. */
-       LTTNG_ERR_TRIGGER_EXISTS         = 126, /* Trigger already registered. */
-       LTTNG_ERR_TRIGGER_NOT_FOUND      = 127, /* Trigger not found. */
-       LTTNG_ERR_COMMAND_CANCELLED      = 128, /* Command cancelled. */
-       LTTNG_ERR_ROTATION_PENDING       = 129, /* Rotation already pending for this session. */
-       LTTNG_ERR_ROTATION_NOT_AVAILABLE = 130, /* Rotate feature not available for this type of session (e.g: live) */
-       LTTNG_ERR_ROTATION_SCHEDULE_SET  = 131, /* Schedule type already set for this session. */
-       LTTNG_ERR_ROTATION_SCHEDULE_NOT_SET = 132, /* No schedule of this type set for this session. */
+       LTTNG_ERR_REGEN_STATEDUMP_FAIL = 122, /* Failed to regenerate the state dump */
+       LTTNG_ERR_REGEN_STATEDUMP_NOMEM = 123, /* Failed to regenerate the state dump, not enough
+                                                 memory */
+       LTTNG_ERR_NOT_SNAPSHOT_SESSION = 124, /* Session is not in snapshot mode. */
+       LTTNG_ERR_INVALID_TRIGGER = 125, /* Invalid trigger provided. */
+       LTTNG_ERR_TRIGGER_EXISTS = 126, /* Trigger already registered. */
+       LTTNG_ERR_TRIGGER_NOT_FOUND = 127, /* Trigger not found. */
+       LTTNG_ERR_COMMAND_CANCELLED = 128, /* Command cancelled. */
+       LTTNG_ERR_ROTATION_PENDING = 129, /* Rotation already pending for this session. */
+       LTTNG_ERR_ROTATION_NOT_AVAILABLE = 130, /* Rotate feature not available for this type of
+                                                  session (e.g: live) */
+       LTTNG_ERR_ROTATION_SCHEDULE_SET = 131, /* Schedule type already set for this session. */
+       LTTNG_ERR_ROTATION_SCHEDULE_NOT_SET = 132, /* No schedule of this type set for this session.
+                                                   */
        LTTNG_ERR_ROTATION_MULTIPLE_AFTER_STOP = 133, /* Already rotated once after a stop. */
-       LTTNG_ERR_ROTATION_WRONG_VERSION   = 134, /* Session rotation not supported by this kernel tracer version */
-       LTTNG_ERR_NO_SESSION_OUTPUT        = 135, /* Session has no output configured. */
-       LTTNG_ERR_ROTATION_NOT_AVAILABLE_RELAY = 136, /* Rotate feature not available on the relay. */
+       LTTNG_ERR_ROTATION_WRONG_VERSION = 134, /* Session rotation not supported by this kernel
+                                                  tracer version */
+       LTTNG_ERR_NO_SESSION_OUTPUT = 135, /* Session has no output configured. */
+       LTTNG_ERR_ROTATION_NOT_AVAILABLE_RELAY = 136, /* Rotate feature not available on the relay.
+                                                      */
        LTTNG_ERR_AGENT_TRACING_DISABLED = 137, /* Agent tracing disabled. */
-       LTTNG_ERR_PROBE_LOCATION_INVAL   = 138, /* Invalid userspace probe location. */
-       LTTNG_ERR_ELF_PARSING            = 139, /* ELF parsing error. */
-       LTTNG_ERR_SDT_PROBE_SEMAPHORE    = 140, /* SDT probe guarded by a semaphore. */
+       LTTNG_ERR_PROBE_LOCATION_INVAL = 138, /* Invalid userspace probe location. */
+       LTTNG_ERR_ELF_PARSING = 139, /* ELF parsing error. */
+       LTTNG_ERR_SDT_PROBE_SEMAPHORE = 140, /* SDT probe guarded by a semaphore. */
        LTTNG_ERR_ROTATION_FAIL_CONSUMER = 141, /* Rotation failure on consumer */
        LTTNG_ERR_ROTATE_RENAME_FAIL_CONSUMER = 142, /* Rotation rename failure on consumer */
-       LTTNG_ERR_ROTATION_PENDING_LOCAL_FAIL_CONSUMER = 143, /* Rotation pending check (local) failure on consumer */
-       LTTNG_ERR_ROTATION_PENDING_RELAY_FAIL_CONSUMER = 144, /* Rotation pending check (relay) failure on consumer */
-       LTTNG_ERR_MKDIR_FAIL_CONSUMER    = 145, /* mkdir failure on consumer */
-       LTTNG_ERR_CHAN_NOT_FOUND         = 146, /* Channel not found */
-       LTTNG_ERR_SNAPSHOT_UNSUPPORTED   = 147, /* Session configuration does not allow the use of snapshots */
-       LTTNG_ERR_SESSION_NOT_EXIST      = 148, /* The session does not exist on the session daemon */
-       LTTNG_ERR_CREATE_TRACE_CHUNK_FAIL_CONSUMER     = 149, /* trace chunk creation failure on consumer */
-       LTTNG_ERR_CLOSE_TRACE_CHUNK_FAIL_CONSUMER      = 150, /* trace chunk close failure on consumer */
-       LTTNG_ERR_TRACE_CHUNK_EXISTS_FAIL_CONSUMER     = 151, /* failed to query consumer for trace chunk existence */
-       LTTNG_ERR_INVALID_PROTOCOL                     = 152, /* a protocol error occurred */
-       LTTNG_ERR_FILE_CREATION_ERROR                  = 153, /* failed to create a file */
-       LTTNG_ERR_TIMER_STOP_ERROR                     = 154, /* failed to stop timer. */
-       LTTNG_ERR_ROTATION_NOT_AVAILABLE_KERNEL = 155, /* Rotation feature not supported by the kernel tracer. */
-       LTTNG_ERR_CLEAR_RELAY_DISALLOWED   = 156, /* LTTng-relayd peer does not allow lttng clear command. */
-       LTTNG_ERR_CLEAR_NOT_AVAILABLE_RELAY = 157, /* Clearing a session is not supported by the relay daemon. */
-       LTTNG_ERR_CLEAR_FAIL_CONSUMER    = 158, /* Clear failure on consumer */
-       LTTNG_ERR_ROTATION_AFTER_STOP_CLEAR = 159, /* Session was already cleared since it became inactive. */
-       LTTNG_ERR_USER_NOT_FOUND         = 160, /* User not found. */
-       LTTNG_ERR_GROUP_NOT_FOUND        = 161, /* Group not found. */
-       LTTNG_ERR_UNSUPPORTED_DOMAIN     = 162,  /* Unsupported domain used. */
-       LTTNG_ERR_PROCESS_ATTR_TRACKER_INVALID_TRACKING_POLICY = 163, /* Operation does not apply to the process attribute tracker's tracking policy */
-       LTTNG_ERR_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD = 164, /* Error initializing event notifier group notification file descriptor */
+       LTTNG_ERR_ROTATION_PENDING_LOCAL_FAIL_CONSUMER = 143, /* Rotation pending check (local)
+                                                                failure on consumer */
+       LTTNG_ERR_ROTATION_PENDING_RELAY_FAIL_CONSUMER = 144, /* Rotation pending check (relay)
+                                                                failure on consumer */
+       LTTNG_ERR_MKDIR_FAIL_CONSUMER = 145, /* mkdir failure on consumer */
+       LTTNG_ERR_CHAN_NOT_FOUND = 146, /* Channel not found */
+       LTTNG_ERR_SNAPSHOT_UNSUPPORTED = 147, /* Session configuration does not allow the use of
+                                                snapshots */
+       LTTNG_ERR_SESSION_NOT_EXIST = 148, /* The session does not exist on the session daemon */
+       LTTNG_ERR_CREATE_TRACE_CHUNK_FAIL_CONSUMER = 149, /* trace chunk creation failure on
+                                                            consumer */
+       LTTNG_ERR_CLOSE_TRACE_CHUNK_FAIL_CONSUMER = 150, /* trace chunk close failure on consumer */
+       LTTNG_ERR_TRACE_CHUNK_EXISTS_FAIL_CONSUMER = 151, /* failed to query consumer for trace
+                                                            chunk existence */
+       LTTNG_ERR_INVALID_PROTOCOL = 152, /* a protocol error occurred */
+       LTTNG_ERR_FILE_CREATION_ERROR = 153, /* failed to create a file */
+       LTTNG_ERR_TIMER_STOP_ERROR = 154, /* failed to stop timer. */
+       LTTNG_ERR_ROTATION_NOT_AVAILABLE_KERNEL = 155, /* Rotation feature not supported by the
+                                                         kernel tracer. */
+       LTTNG_ERR_CLEAR_RELAY_DISALLOWED = 156, /* LTTng-relayd peer does not allow lttng clear
+                                                  command. */
+       LTTNG_ERR_CLEAR_NOT_AVAILABLE_RELAY = 157, /* Clearing a session is not supported by the
+                                                     relay daemon. */
+       LTTNG_ERR_CLEAR_FAIL_CONSUMER = 158, /* Clear failure on consumer */
+       LTTNG_ERR_ROTATION_AFTER_STOP_CLEAR = 159, /* Session was already cleared since it became
+                                                     inactive. */
+       LTTNG_ERR_USER_NOT_FOUND = 160, /* User not found. */
+       LTTNG_ERR_GROUP_NOT_FOUND = 161, /* Group not found. */
+       LTTNG_ERR_UNSUPPORTED_DOMAIN = 162, /* Unsupported domain used. */
+       LTTNG_ERR_PROCESS_ATTR_TRACKER_INVALID_TRACKING_POLICY = 163, /* Operation does not apply to
+                                                                        the process attribute
+                                                                        tracker's tracking policy
+                                                                      */
+       LTTNG_ERR_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD = 164, /* Error initializing event notifier
+                                                                group notification file descriptor
+                                                              */
        LTTNG_ERR_INVALID_CAPTURE_EXPRESSION = 165, /* Invalid capture expression. */
-       LTTNG_ERR_EVENT_NOTIFIER_REGISTRATION = 166, /* Error registering event notifier to the tracer. */
-       LTTNG_ERR_EVENT_NOTIFIER_ERROR_ACCOUNTING = 167, /* Error initializing event notifier error accounting. */
-       LTTNG_ERR_EVENT_NOTIFIER_ERROR_ACCOUNTING_FULL = 168, /* Error event notifier error accounting full. */
+       LTTNG_ERR_EVENT_NOTIFIER_REGISTRATION = 166, /* Error registering event notifier to the
+                                                       tracer. */
+       LTTNG_ERR_EVENT_NOTIFIER_ERROR_ACCOUNTING = 167, /* Error initializing event notifier error
+                                                           accounting. */
+       LTTNG_ERR_EVENT_NOTIFIER_ERROR_ACCOUNTING_FULL = 168, /* Error event notifier error
+                                                                accounting full. */
        LTTNG_ERR_INVALID_ERROR_QUERY_TARGET = 169, /* Invalid error query target. */
-       LTTNG_ERR_BUFFER_FLUSH_FAILED        = 170, /* Buffer flush failed */
+       LTTNG_ERR_BUFFER_FLUSH_FAILED = 170, /* Buffer flush failed */
 
        /* MUST be last element of the manually-assigned section of the enum */
        LTTNG_ERR_NR,
 
        /* Backward-compatibility assignments */
-       LTTNG_ERR_PID_TRACKED            = LTTNG_ERR_PROCESS_ATTR_EXISTS, /* Backward compat alias */
-       LTTNG_ERR_PID_NOT_TRACKED        = LTTNG_ERR_PROCESS_ATTR_MISSING, /* Backward compat alias */
+       LTTNG_ERR_PID_TRACKED = LTTNG_ERR_PROCESS_ATTR_EXISTS, /* Backward compat alias */
+       LTTNG_ERR_PID_NOT_TRACKED = LTTNG_ERR_PROCESS_ATTR_MISSING, /* Backward compat alias */
 };
 
 /*
index ae3990a29dbad5786fdeaecbc971f9d1b07b067f..51eca4ee7d13e7030dfbbb52f0c417d9076a492a 100644 (file)
@@ -7,8 +7,8 @@
 #ifndef LTTNG_EXPORT_H
 #define LTTNG_EXPORT_H
 #if defined(_WIN32) || defined(__CYGWIN__)
-# define LTTNG_EXPORT
+#define LTTNG_EXPORT
 #else
-# define LTTNG_EXPORT __attribute__((visibility("default")))
+#define LTTNG_EXPORT __attribute__((visibility("default")))
 #endif
 #endif
index dbfe9a7dbde5f94494d646c957765a7b63c33e76..929ce014e10b752f133c87589ff492bfb27e7efd 100644 (file)
 #include <lttng/event-expr.h>
 #include <lttng/event-field-value.h>
 #include <lttng/event-rule/event-rule.h>
-#include <lttng/event-rule/log4j-logging.h>
 #include <lttng/event-rule/jul-logging.h>
 #include <lttng/event-rule/kernel-kprobe.h>
 #include <lttng/event-rule/kernel-syscall.h>
-#include <lttng/event-rule/python-logging.h>
 #include <lttng/event-rule/kernel-tracepoint.h>
 #include <lttng/event-rule/kernel-uprobe.h>
+#include <lttng/event-rule/log4j-logging.h>
+#include <lttng/event-rule/python-logging.h>
 #include <lttng/event-rule/user-tracepoint.h>
 #include <lttng/event.h>
 #include <lttng/handle.h>
@@ -75,15 +75,15 @@ extern "C" {
 #endif
 
 enum lttng_calibrate_type {
-       LTTNG_CALIBRATE_FUNCTION              = 0,
+       LTTNG_CALIBRATE_FUNCTION = 0,
 };
 
 /* Machine interface output type */
 enum lttng_mi_output_type {
-       LTTNG_MI_XML                          = 1 /* XML output */
+       LTTNG_MI_XML = 1 /* XML output */
 };
 
-#define LTTNG_CALIBRATE_PADDING1           16
+#define LTTNG_CALIBRATE_PADDING1 16
 struct lttng_calibrate {
        enum lttng_calibrate_type type;
 
@@ -116,7 +116,7 @@ LTTNG_EXPORT extern int lttng_set_tracing_group(const char *name);
  * Return 0 on success else a negative LTTng error code.
  */
 LTTNG_EXPORT extern int lttng_register_consumer(struct lttng_handle *handle,
-               const char *socket_path);
+                                               const char *socket_path);
 
 /*
  * Start tracing for *all* domain(s) in the session.
@@ -152,7 +152,7 @@ LTTNG_EXPORT extern int lttng_stop_tracing_no_wait(const char *session_name);
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wshadow"
 LTTNG_EXPORT extern int lttng_calibrate(struct lttng_handle *handle,
-               struct lttng_calibrate *calibrate);
+                                       struct lttng_calibrate *calibrate);
 #pragma GCC diagnostic pop
 
 /*
@@ -179,8 +179,8 @@ LTTNG_EXPORT extern int lttng_calibrate(struct lttng_handle *handle,
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_set_consumer_url(struct lttng_handle *handle,
-               const char *control_url, const char *data_url);
+LTTNG_EXPORT extern int
+lttng_set_consumer_url(struct lttng_handle *handle, const char *control_url, const char *data_url);
 
 /*
  * For a given session name, this call checks if the data is ready to be read
index 44fd9cf1637c8e2c217964c1e58ec2f2f984e57b..34014f16ffbc652e6ac91e5cead59cff506c554d 100644 (file)
@@ -87,7 +87,8 @@ struct pending_notification {
 struct lttng_notification_channel {
        using uptr = std::unique_ptr<
                lttng_notification_channel,
-               lttng::details::create_unique_class<lttng_notification_channel, lttng_notification_channel_destroy>::deleter>;
+               lttng::details::create_unique_class<lttng_notification_channel,
+                                                   lttng_notification_channel_destroy>::deleter>;
 
        pthread_mutex_t lock;
        int socket;
index 030c88cbd3e1829ee1db2bd34fb2dc6bf43e3d4a..dad62b0b3abf730ced0b63151d9f9fa6e01c2591 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_NOTIFICATION_CHANNEL_H
 
 #include <lttng/lttng-export.h>
+
 #include <stdbool.h>
 
 #ifdef __cplusplus
@@ -58,8 +59,8 @@ enum lttng_notification_channel_status {
  * The returned lttng_notification_channel must be destroyed using
  * the lttng_notification_channel_destroy() function.
  */
-LTTNG_EXPORT extern struct lttng_notification_channel *lttng_notification_channel_create(
-               struct lttng_endpoint *endpoint);
+LTTNG_EXPORT extern struct lttng_notification_channel *
+lttng_notification_channel_create(struct lttng_endpoint *endpoint);
 
 /*
  * Get the next notification received on a notification channel.
@@ -83,9 +84,8 @@ LTTNG_EXPORT extern struct lttng_notification_channel *lttng_notification_channe
  *     that caused the reception to fail.
  */
 LTTNG_EXPORT extern enum lttng_notification_channel_status
-lttng_notification_channel_get_next_notification(
-               struct lttng_notification_channel *channel,
-               struct lttng_notification **notification);
+lttng_notification_channel_get_next_notification(struct lttng_notification_channel *channel,
+                                                struct lttng_notification **notification);
 
 /*
  * Check whether a notification is pending on a notification channel.
@@ -104,9 +104,8 @@ lttng_notification_channel_get_next_notification(
  *     provided.
  */
 LTTNG_EXPORT extern enum lttng_notification_channel_status
-lttng_notification_channel_has_pending_notification(
-               struct lttng_notification_channel *channel,
-               bool *notification_pending);
+lttng_notification_channel_has_pending_notification(struct lttng_notification_channel *channel,
+                                                   bool *notification_pending);
 
 /*
  * Subscribe to notifications of a condition through a notification channel.
@@ -124,9 +123,8 @@ lttng_notification_channel_has_pending_notification(
  *     client was already subscribed to the condition through this channel.
  */
 LTTNG_EXPORT extern enum lttng_notification_channel_status
-lttng_notification_channel_subscribe(
-               struct lttng_notification_channel *channel,
-               const struct lttng_condition *condition);
+lttng_notification_channel_subscribe(struct lttng_notification_channel *channel,
+                                    const struct lttng_condition *condition);
 
 /*
  * Unsubscribe to notifications of a condition through a notification channel.
@@ -144,15 +142,14 @@ lttng_notification_channel_subscribe(
  *     client was not already subscribed to the condition through this channel.
  */
 LTTNG_EXPORT extern enum lttng_notification_channel_status
-lttng_notification_channel_unsubscribe(
-               struct lttng_notification_channel *channel,
-               const struct lttng_condition *condition);
+lttng_notification_channel_unsubscribe(struct lttng_notification_channel *channel,
+                                      const struct lttng_condition *condition);
 
 /*
  * Closes and destroys (frees) a notification channel.
  */
-LTTNG_EXPORT extern void lttng_notification_channel_destroy(
-               struct lttng_notification_channel *channel);
+LTTNG_EXPORT extern void
+lttng_notification_channel_destroy(struct lttng_notification_channel *channel);
 
 #ifdef __cplusplus
 }
index 9837c359bf104408987d8dfec44be5ea9439c7b0..9fe471c2631fbadeab1ab3c00c61e7d2ce4b8b72 100644 (file)
@@ -38,23 +38,21 @@ struct lttng_notification_comm {
        char payload[];
 } LTTNG_PACKED;
 
-struct lttng_notification *lttng_notification_create(
-               struct lttng_trigger *trigger,
-               struct lttng_evaluation *evaluation);
+struct lttng_notification *lttng_notification_create(struct lttng_trigger *trigger,
+                                                    struct lttng_evaluation *evaluation);
 
 int lttng_notification_serialize(const struct lttng_notification *notification,
-               struct lttng_payload *payload);
+                                struct lttng_payload *payload);
 
-ssize_t lttng_notification_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_notification **notification);
+ssize_t lttng_notification_create_from_payload(struct lttng_payload_view *view,
+                                              struct lttng_notification **notification);
 
-const struct lttng_condition *lttng_notification_get_const_condition(
-               const struct lttng_notification *notification);
-const struct lttng_evaluation *lttng_notification_get_const_evaluation(
-               const struct lttng_notification *notification);
+const struct lttng_condition *
+lttng_notification_get_const_condition(const struct lttng_notification *notification);
+const struct lttng_evaluation *
+lttng_notification_get_const_evaluation(const struct lttng_notification *notification);
 
-const struct lttng_trigger *lttng_notification_get_const_trigger(
-               const struct lttng_notification *notification);
+const struct lttng_trigger *
+lttng_notification_get_const_trigger(const struct lttng_notification *notification);
 
 #endif /* LTTNG_NOTIFICATION_INTERNAL_H */
index d1c088fecc8973fc5f9bcabfca8df065e4b6793c..c434f11321fc27e017887d90696684c53448cdb5 100644 (file)
@@ -30,8 +30,8 @@ struct lttng_notification;
  *
  * Returns an lttng_condition object on success, NULL on error.
  */
-LTTNG_EXPORT extern const struct lttng_condition *lttng_notification_get_condition(
-               struct lttng_notification *notification);
+LTTNG_EXPORT extern const struct lttng_condition *
+lttng_notification_get_condition(struct lttng_notification *notification);
 
 /*
  * Get a notification's condition's evaluation.
@@ -45,8 +45,8 @@ LTTNG_EXPORT extern const struct lttng_condition *lttng_notification_get_conditi
  *
  * Returns an lttng_evaluation object on success, NULL on error.
  */
-LTTNG_EXPORT extern const struct lttng_evaluation *lttng_notification_get_evaluation(
-               struct lttng_notification *notification);
+LTTNG_EXPORT extern const struct lttng_evaluation *
+lttng_notification_get_evaluation(struct lttng_notification *notification);
 
 /*
  * Get a notification's origin trigger.
@@ -57,8 +57,8 @@ LTTNG_EXPORT extern const struct lttng_evaluation *lttng_notification_get_evalua
  *
  * Returns an lttng_trigger object on success, NULL on error.
  */
-LTTNG_EXPORT extern const struct lttng_trigger *lttng_notification_get_trigger(
-               struct lttng_notification *notification);
+LTTNG_EXPORT extern const struct lttng_trigger *
+lttng_notification_get_trigger(struct lttng_notification *notification);
 
 /*
  * Destroys (frees) a notification. The notification's condition and evaluation
index 68b6efd1b8b6a8290a964fe0ee045cdd553b2508..13c1a69eedb89ee9e8191f0a337a88b17721cc49 100644 (file)
@@ -17,16 +17,14 @@ struct lttng_ref {
        lttng_release_func release;
 };
 
-static inline
-void lttng_ref_init(struct lttng_ref *ref, lttng_release_func release)
+static inline void lttng_ref_init(struct lttng_ref *ref, lttng_release_func release)
 {
        LTTNG_ASSERT(ref);
        ref->count = 1;
        ref->release = release;
 }
 
-static inline
-void lttng_ref_get(struct lttng_ref *ref)
+static inline void lttng_ref_get(struct lttng_ref *ref)
 {
        LTTNG_ASSERT(ref);
        ref->count++;
@@ -34,8 +32,7 @@ void lttng_ref_get(struct lttng_ref *ref)
        LTTNG_ASSERT(ref->count);
 }
 
-static inline
-void lttng_ref_put(struct lttng_ref *ref)
+static inline void lttng_ref_put(struct lttng_ref *ref)
 {
        LTTNG_ASSERT(ref);
        /* Underflow check. */
index 69b82b5f6524cf502670fdc0ff885f615113baf2..dbc66f3456a1e0caf6f2c6eab1f36a4a0e5f5e22 100644 (file)
@@ -8,13 +8,14 @@
 #ifndef LTTNG_ROTATE_INTERNAL_ABI_H
 #define LTTNG_ROTATE_INTERNAL_ABI_H
 
-#include <limits.h>
-#include <stdint.h>
-#include <stdbool.h>
+#include <common/macros.hpp>
 
 #include <lttng/constant.h>
 #include <lttng/rotation.h>
-#include <common/macros.hpp>
+
+#include <limits.h>
+#include <stdbool.h>
+#include <stdint.h>
 
 /*
  * Object returned by the rotate session API.
index 08f2a985be806ae26284b124486c9bc5c8e91775..e5b14e8b7101c4bbcd8d2f8eaf0c5d35c4ad2ae9 100644 (file)
@@ -9,10 +9,11 @@
 #ifndef LTTNG_ROTATION_H
 #define LTTNG_ROTATION_H
 
-#include <stdint.h>
 #include <lttng/location.h>
 #include <lttng/lttng-export.h>
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -102,9 +103,9 @@ struct lttng_rotation_handle;
  * This will issue a request to the session daemon on every call. Hence,
  * the result of this call may change over time.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_handle_get_state(
-               struct lttng_rotation_handle *rotation_handle,
-               enum lttng_rotation_state *rotation_state);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_rotation_handle_get_state(struct lttng_rotation_handle *rotation_handle,
+                               enum lttng_rotation_state *rotation_state);
 
 /*
  * Get the location of the rotation's resulting archive.
@@ -115,15 +116,15 @@ LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_handle_get_state(
  * Note that location will not be set in case of error, or if the session
  * rotation handle has expired.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_handle_get_archive_location(
-               struct lttng_rotation_handle *rotation_handle,
-               const struct lttng_trace_archive_location **location);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_rotation_handle_get_archive_location(struct lttng_rotation_handle *rotation_handle,
+                                          const struct lttng_trace_archive_location **location);
 
 /*
  * Destroy an lttng_rotate_session handle.
  */
-LTTNG_EXPORT extern void lttng_rotation_handle_destroy(
-               struct lttng_rotation_handle *rotation_handle);
+LTTNG_EXPORT extern void
+lttng_rotation_handle_destroy(struct lttng_rotation_handle *rotation_handle);
 
 /*
  * Rotate the output folder of the session.
@@ -139,14 +140,14 @@ LTTNG_EXPORT extern void lttng_rotation_handle_destroy(
  * LTTng error code on error.
  */
 LTTNG_EXPORT extern int lttng_rotate_session(const char *session_name,
-               struct lttng_rotation_immediate_descriptor *descriptor,
-               struct lttng_rotation_handle **rotation_handle);
+                                            struct lttng_rotation_immediate_descriptor *descriptor,
+                                            struct lttng_rotation_handle **rotation_handle);
 
 /*
  * Get the type of a rotation schedule object.
  */
-LTTNG_EXPORT extern enum lttng_rotation_schedule_type lttng_rotation_schedule_get_type(
-               const struct lttng_rotation_schedule *schedule);
+LTTNG_EXPORT extern enum lttng_rotation_schedule_type
+lttng_rotation_schedule_get_type(const struct lttng_rotation_schedule *schedule);
 
 /*
  * Return a newly allocated size-based session rotation schedule or NULL on
@@ -162,24 +163,21 @@ lttng_rotation_schedule_size_threshold_create(void);
  * LTTNG_ROTATION_STATUS_UNAVAILABLE is returned if the value is unset.
  */
 LTTNG_EXPORT extern enum lttng_rotation_status
-lttng_rotation_schedule_size_threshold_get_threshold(
-               const struct lttng_rotation_schedule *schedule,
-               uint64_t *size_threshold_bytes);
+lttng_rotation_schedule_size_threshold_get_threshold(const struct lttng_rotation_schedule *schedule,
+                                                    uint64_t *size_threshold_bytes);
 
 /*
  * Set a session rotation schedule's size threshold.
  */
 LTTNG_EXPORT extern enum lttng_rotation_status
-lttng_rotation_schedule_size_threshold_set_threshold(
-               struct lttng_rotation_schedule *schedule,
-               uint64_t size_threshold_bytes);
+lttng_rotation_schedule_size_threshold_set_threshold(struct lttng_rotation_schedule *schedule,
+                                                    uint64_t size_threshold_bytes);
 
 /*
  * Return a newly allocated periodic session rotation schedule or NULL on
  * error.
  */
-LTTNG_EXPORT extern struct lttng_rotation_schedule *
-lttng_rotation_schedule_periodic_create(void);
+LTTNG_EXPORT extern struct lttng_rotation_schedule *lttng_rotation_schedule_periodic_create(void);
 
 /*
  * Get a time-based session rotation schedule's period.
@@ -187,36 +185,35 @@ lttng_rotation_schedule_periodic_create(void);
  * Returns LTTNG_ROTATION_STATUS_OK on success.
  * LTTNG_ROTATION_STATUS_UNAVAILABLE is returned if the value is unset.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_schedule_periodic_get_period(
-               const struct lttng_rotation_schedule *schedule,
-               uint64_t *period_us);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_rotation_schedule_periodic_get_period(const struct lttng_rotation_schedule *schedule,
+                                           uint64_t *period_us);
 
 /*
  * Set a time-based session rotation schedule's period.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_schedule_periodic_set_period(
-               struct lttng_rotation_schedule *schedule,
-               uint64_t period_us);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_rotation_schedule_periodic_set_period(struct lttng_rotation_schedule *schedule,
+                                           uint64_t period_us);
 
 /*
  * Destroy a rotation schedule.
  */
-LTTNG_EXPORT extern void lttng_rotation_schedule_destroy(
-               struct lttng_rotation_schedule *schedule);
+LTTNG_EXPORT extern void lttng_rotation_schedule_destroy(struct lttng_rotation_schedule *schedule);
 
 /*
  * Destroy a set of rotation schedules. Pointers to any schedule contained
  * in this set become invalid after this call.
  */
-LTTNG_EXPORT extern void lttng_rotation_schedules_destroy(
-               struct lttng_rotation_schedules *schedules);
+LTTNG_EXPORT extern void
+lttng_rotation_schedules_destroy(struct lttng_rotation_schedules *schedules);
 
 /*
  * Get the number of schedules in a schedule set.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_schedules_get_count(
-               const struct lttng_rotation_schedules *schedules,
-               unsigned int *count);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_rotation_schedules_get_count(const struct lttng_rotation_schedules *schedules,
+                                  unsigned int *count);
 
 /*
  * Get a schedule from the set at a given index.
@@ -228,9 +225,8 @@ LTTNG_EXPORT extern enum lttng_rotation_status lttng_rotation_schedules_get_coun
  * Returns a rotation schedule, or NULL on error.
  */
 LTTNG_EXPORT extern const struct lttng_rotation_schedule *
-lttng_rotation_schedules_get_at_index(
-               const struct lttng_rotation_schedules *schedules,
-               unsigned int index);
+lttng_rotation_schedules_get_at_index(const struct lttng_rotation_schedules *schedules,
+                                     unsigned int index);
 
 /*
  * Add a session rotation schedule to a session.
@@ -242,9 +238,9 @@ lttng_rotation_schedules_get_at_index(
  * LTTNG_ROTATION_STATUS_SCHEDULE_ALREADY_SET if a rotation of the same type
  * is already set.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_session_add_rotation_schedule(
-               const char *session_name,
-               const struct lttng_rotation_schedule *schedule);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_session_add_rotation_schedule(const char *session_name,
+                                   const struct lttng_rotation_schedule *schedule);
 
 /*
  * Remove a session rotation schedule from a session.
@@ -253,18 +249,18 @@ LTTNG_EXPORT extern enum lttng_rotation_status lttng_session_add_rotation_schedu
  * LTTNG_ROTATION_STATUS_SCHEDULE_INVALID if the provided schedule is
  * not set.
  */
-LTTNG_EXPORT extern enum lttng_rotation_status lttng_session_remove_rotation_schedule(
-               const char *session_name,
-               const struct lttng_rotation_schedule *schedule);
+LTTNG_EXPORT extern enum lttng_rotation_status
+lttng_session_remove_rotation_schedule(const char *session_name,
+                                      const struct lttng_rotation_schedule *schedule);
 
 /*
  * Get the rotation schedules associated with a given session.
  *
  * Returns LTTNG_OK on success, or a negative lttng error code on error.
  */
-LTTNG_EXPORT extern int lttng_session_list_rotation_schedules(
-               const char *session_name,
-               struct lttng_rotation_schedules **schedules);
+LTTNG_EXPORT extern int
+lttng_session_list_rotation_schedules(const char *session_name,
+                                     struct lttng_rotation_schedules **schedules);
 
 #ifdef __cplusplus
 }
index 6b2bb9433f6008a12f98f260eea53dab9a121b77..4b8343bdb9043f2bec23b2d21aefd2ee5c5122cb 100644 (file)
@@ -8,11 +8,12 @@
 #ifndef LTTNG_SAVE_INTERNAL_ABI_H
 #define LTTNG_SAVE_INTERNAL_ABI_H
 
-#include <limits.h>
-#include <stdint.h>
+#include <common/macros.hpp>
 
 #include <lttng/constant.h>
-#include <common/macros.hpp>
+
+#include <limits.h>
+#include <stdint.h>
 
 /*
  * Object used by the save_session API. This is opaque to the public library.
index d28fdffcdc062c4b77596f7f5ed0e2e931a72de0..6120467a78ffa7ac5f6d1ef8f2920a069eff617c 100644 (file)
@@ -30,39 +30,36 @@ LTTNG_EXPORT extern struct lttng_save_session_attr *lttng_save_session_attr_crea
  */
 LTTNG_EXPORT extern void lttng_save_session_attr_destroy(struct lttng_save_session_attr *output);
 
-
 /*
  * Save session attribute getter family functions.
  */
 
 /* Return session name. NULL indicated all sessions must be saved. */
-LTTNG_EXPORT extern const char *lttng_save_session_attr_get_session_name(
-       struct lttng_save_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_save_session_attr_get_session_name(struct lttng_save_session_attr *attr);
 /*
  * Return destination URL. A NULL value indicates the default session
  * configuration location. The URL format used is documented in lttng(1).
  * NULL indicates that the default session configuration path is used.
  */
-LTTNG_EXPORT extern const char *lttng_save_session_attr_get_output_url(
-       struct lttng_save_session_attr *attr);
+LTTNG_EXPORT extern const char *
+lttng_save_session_attr_get_output_url(struct lttng_save_session_attr *attr);
 /*
  * Return the configuration overwrite attribute. This attribute indicates
  * whether or not existing configuration files must be overwritten.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_get_overwrite(
-       struct lttng_save_session_attr *attr);
+LTTNG_EXPORT extern int lttng_save_session_attr_get_overwrite(struct lttng_save_session_attr *attr);
 /*
  * Return the omit name configuration attribute. This attribute indicates
  * whether or not the saved sessions' names should be omitted.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_get_omit_name(
-       struct lttng_save_session_attr *attr);
+LTTNG_EXPORT extern int lttng_save_session_attr_get_omit_name(struct lttng_save_session_attr *attr);
 /*
  * Return the omit output configuration attribute. This attribute indicates
  * whether or not the saved sessions' output configuration should be omitted.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_get_omit_output(
-       struct lttng_save_session_attr *attr);
+LTTNG_EXPORT extern int
+lttng_save_session_attr_get_omit_output(struct lttng_save_session_attr *attr);
 
 /*
  * Save session attribute setter family functions.
@@ -75,33 +72,34 @@ LTTNG_EXPORT extern int lttng_save_session_attr_get_omit_output(
  * Set the name of the session to save. A NULL name means all sessions
  * known to the session daemon will be saved.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_set_session_name(
-       struct lttng_save_session_attr *attr, const char *session_name);
+LTTNG_EXPORT extern int
+lttng_save_session_attr_set_session_name(struct lttng_save_session_attr *attr,
+                                        const char *session_name);
 /*
  * Set the URL of the session configuration to save. A NULL value indicates the
  * use of the default location being the session one. The URL's format is is
  * documented in lttng(1).
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_set_output_url(
-       struct lttng_save_session_attr *attr, const char *url);
+LTTNG_EXPORT extern int lttng_save_session_attr_set_output_url(struct lttng_save_session_attr *attr,
+                                                              const char *url);
 /*
  * Set the overwrite attribute. If set to true, files of the same name as the
  * current session configuration URL will be overwritten.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_set_overwrite(
-       struct lttng_save_session_attr *attr, int overwrite);
+LTTNG_EXPORT extern int lttng_save_session_attr_set_overwrite(struct lttng_save_session_attr *attr,
+                                                             int overwrite);
 /*
  * Set the omit name attribute. If set to true, the sessions' names are omitted
  * from the resulting session configuration file.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_set_omit_name(
-       struct lttng_save_session_attr *attr, int omit_name);
+LTTNG_EXPORT extern int lttng_save_session_attr_set_omit_name(struct lttng_save_session_attr *attr,
+                                                             int omit_name);
 /*
  * Set the omit output attribute. If set to true, the sessions' output
  * configurations are omitted from the resulting session configuration file.
  */
-LTTNG_EXPORT extern int lttng_save_session_attr_set_omit_output(
-       struct lttng_save_session_attr *attr, int omit_output);
+LTTNG_EXPORT extern int
+lttng_save_session_attr_set_omit_output(struct lttng_save_session_attr *attr, int omit_output);
 
 /*
  * Save session configuration(s).
index c132f5600f66fbe4cd6d77c276b1867b04444c12..a2dd70d5798dcc35f8d3ddc0e997ab79620b6c57 100644 (file)
@@ -8,11 +8,13 @@
 #ifndef LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
 #define LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
 
-#include <lttng/session-descriptor.h>
-#include <lttng/lttng-error.h>
-#include <common/uri.hpp>
-#include <common/dynamic-buffer.hpp>
 #include <common/buffer-view.hpp>
+#include <common/dynamic-buffer.hpp>
+#include <common/uri.hpp>
+
+#include <lttng/lttng-error.h>
+#include <lttng/session-descriptor.h>
+
 #include <stdbool.h>
 
 /* Note that these enums are used as part of the lttnctl protocol. */
@@ -33,52 +35,44 @@ enum lttng_session_descriptor_output_type {
        LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK = 2,
 };
 
-ssize_t lttng_session_descriptor_create_from_buffer(
-               const struct lttng_buffer_view *view,
-               struct lttng_session_descriptor **descriptor);
+ssize_t lttng_session_descriptor_create_from_buffer(const struct lttng_buffer_view *view,
+                                                   struct lttng_session_descriptor **descriptor);
 
-int lttng_session_descriptor_serialize(
-               const struct lttng_session_descriptor *descriptor,
-               struct lttng_dynamic_buffer *buffer);
+int lttng_session_descriptor_serialize(const struct lttng_session_descriptor *descriptor,
+                                      struct lttng_dynamic_buffer *buffer);
 
 enum lttng_session_descriptor_type
-lttng_session_descriptor_get_type(
-               const struct lttng_session_descriptor *descriptor);
+lttng_session_descriptor_get_type(const struct lttng_session_descriptor *descriptor);
 
 enum lttng_session_descriptor_output_type
-lttng_session_descriptor_get_output_type(
-               const struct lttng_session_descriptor *descriptor);
+lttng_session_descriptor_get_output_type(const struct lttng_session_descriptor *descriptor);
 
 void lttng_session_descriptor_get_local_output_uri(
-               const struct lttng_session_descriptor *descriptor,
-               struct lttng_uri *local_uri);
+       const struct lttng_session_descriptor *descriptor, struct lttng_uri *local_uri);
 
 void lttng_session_descriptor_get_network_output_uris(
-               const struct lttng_session_descriptor *descriptor,
-               struct lttng_uri *control,
-               struct lttng_uri *data);
+       const struct lttng_session_descriptor *descriptor,
+       struct lttng_uri *control,
+       struct lttng_uri *data);
 
 unsigned long long
-lttng_session_descriptor_live_get_timer_interval(
-               const struct lttng_session_descriptor *descriptor);
+lttng_session_descriptor_live_get_timer_interval(const struct lttng_session_descriptor *descriptor);
 
-int lttng_session_descriptor_set_session_name(
-               struct lttng_session_descriptor *descriptor,
-               const char *name);
+int lttng_session_descriptor_set_session_name(struct lttng_session_descriptor *descriptor,
+                                             const char *name);
 
 bool lttng_session_descriptor_is_output_destination_initialized(
-               const struct lttng_session_descriptor *descriptor);
+       const struct lttng_session_descriptor *descriptor);
 
 bool lttng_session_descriptor_has_output_directory(
-               const struct lttng_session_descriptor *descriptor);
+       const struct lttng_session_descriptor *descriptor);
 
-enum lttng_error_code lttng_session_descriptor_set_default_output(
-               struct lttng_session_descriptor *descriptor,
-               time_t *session_creation_time,
-               const char *absolute_home_path);
+enum lttng_error_code
+lttng_session_descriptor_set_default_output(struct lttng_session_descriptor *descriptor,
+                                           time_t *session_creation_time,
+                                           const char *absolute_home_path);
 
-int lttng_session_descriptor_assign(
-               struct lttng_session_descriptor *dst_descriptor,
-               const struct lttng_session_descriptor *src_descriptor);
+int lttng_session_descriptor_assign(struct lttng_session_descriptor *dst_descriptor,
+                                   const struct lttng_session_descriptor *src_descriptor);
 
 #endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */
index 5db04be7e9a959aa7935692e4481f9f3e1d19d03..a67a4bf1c65550b407552f5301aab7267c739131 100644 (file)
@@ -131,9 +131,8 @@ lttng_session_descriptor_local_create(const char *name, const char *path);
  *
  * Returns an lttng_session_descriptor instance on success, NULL on error.
  */
-LTTNG_EXPORT extern struct lttng_session_descriptor *
-lttng_session_descriptor_network_create(const char *name,
-               const char *control_url, const char *data_url);
+LTTNG_EXPORT extern struct lttng_session_descriptor *lttng_session_descriptor_network_create(
+       const char *name, const char *control_url, const char *data_url);
 
 /*
  * Create a snapshot session descriptor without a default output.
@@ -156,8 +155,7 @@ lttng_session_descriptor_snapshot_create(const char *name);
  * Returns an lttng_session_descriptor instance on success, NULL on error.
  */
 LTTNG_EXPORT extern struct lttng_session_descriptor *
-lttng_session_descriptor_snapshot_local_create(const char *name,
-               const char *path);
+lttng_session_descriptor_snapshot_local_create(const char *name, const char *path);
 
 /*
  * Create a snapshot session descriptor with a remote output destination.
@@ -172,7 +170,8 @@ lttng_session_descriptor_snapshot_local_create(const char *name,
  */
 LTTNG_EXPORT extern struct lttng_session_descriptor *
 lttng_session_descriptor_snapshot_network_create(const char *name,
-               const char *control_url, const char *data_url);
+                                                const char *control_url,
+                                                const char *data_url);
 
 /*
  * Create a live session descriptor without an output.
@@ -188,8 +187,7 @@ lttng_session_descriptor_snapshot_network_create(const char *name,
  * Returns an lttng_session_descriptor instance on success, NULL on error.
  */
 LTTNG_EXPORT extern struct lttng_session_descriptor *
-lttng_session_descriptor_live_create(
-               const char *name, unsigned long long live_timer_interval_us);
+lttng_session_descriptor_live_create(const char *name, unsigned long long live_timer_interval_us);
 
 /*
  * Create a live session descriptor with a remote output destination.
@@ -208,10 +206,10 @@ lttng_session_descriptor_live_create(
  * Returns an lttng_session_descriptor instance on success, NULL on error.
  */
 LTTNG_EXPORT extern struct lttng_session_descriptor *
-lttng_session_descriptor_live_network_create(
-               const char *name,
-               const char *control_url, const char *data_url,
-               unsigned long long live_timer_interval_us);
+lttng_session_descriptor_live_network_create(const char *name,
+                                            const char *control_url,
+                                            const char *data_url,
+                                            unsigned long long live_timer_interval_us);
 
 /*
  * Get a session descriptor's session name.
@@ -229,9 +227,8 @@ lttng_session_descriptor_live_network_create(
  * name parameter is unset.
  */
 LTTNG_EXPORT extern enum lttng_session_descriptor_status
-lttng_session_descriptor_get_session_name(
-               const struct lttng_session_descriptor *descriptor,
-               const char **name);
+lttng_session_descriptor_get_session_name(const struct lttng_session_descriptor *descriptor,
+                                         const char **name);
 
 /*
  * Destroy a local lttng_session object.
@@ -239,8 +236,8 @@ lttng_session_descriptor_get_session_name(
  * This does not destroy the session on the session daemon; it releases
  * the resources allocated by the descriptor object.
  */
-LTTNG_EXPORT extern void lttng_session_descriptor_destroy(
-               struct lttng_session_descriptor *descriptor);
+LTTNG_EXPORT extern void
+lttng_session_descriptor_destroy(struct lttng_session_descriptor *descriptor);
 
 #ifdef __cplusplus
 }
index 7f73b9610dd3adf3c54539e90172f65a19e0bae5..e7530d3ae8b4c8b2b5ad77809507ed881c823b92 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_SESSION_INTERNAL_H
 #define LTTNG_SESSION_INTERNAL_H
 
-#include <lttng/constant.h>
 #include <common/macros.hpp>
 
+#include <lttng/constant.h>
+
 struct lttng_session_extended {
        struct {
                uint64_t value;
index 153a37b03680da361e97f0f64bdee979ae16c6fe..9be506fc196bbda6e956134733739faac734a2ce 100644 (file)
@@ -28,7 +28,7 @@ struct lttng_destruction_handle;
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_SESSION_PADDING1             8
+#define LTTNG_SESSION_PADDING1 8
 struct lttng_session {
        char name[LTTNG_NAME_MAX];
        /*
@@ -41,9 +41,9 @@ struct lttng_session {
         *     net://hostname/path:ctrl_port [data: data_port]
         */
        char path[PATH_MAX];
-       uint32_t enabled;       /* enabled/started: 1, disabled/stopped: 0 */
+       uint32_t enabled; /* enabled/started: 1, disabled/stopped: 0 */
        uint32_t snapshot_mode;
-       unsigned int live_timer_interval;       /* usec */
+       unsigned int live_timer_interval; /* usec */
 
        /*
         * End of public attributes.
@@ -87,8 +87,8 @@ struct lttng_session {
  * Returns LTTNG_OK on success. See lttng-error.h for the meaning of the other
  * return codes.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_create_session_ext(
-               struct lttng_session_descriptor *session_descriptor);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_create_session_ext(struct lttng_session_descriptor *session_descriptor);
 
 /*
  * Create a tracing session using a name and an optional URL.
@@ -112,8 +112,7 @@ LTTNG_EXPORT extern int lttng_create_session(const char *name, const char *url);
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_create_session_snapshot(const char *name,
-               const char *snapshot_url);
+LTTNG_EXPORT extern int lttng_create_session_snapshot(const char *name, const char *snapshot_url);
 
 /*
  * Create a session exclusively used for live reading.
@@ -128,8 +127,8 @@ LTTNG_EXPORT extern int lttng_create_session_snapshot(const char *name,
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_create_session_live(const char *name, const char *url,
-               unsigned int timer_interval);
+LTTNG_EXPORT extern int
+lttng_create_session_live(const char *name, const char *url, unsigned int timer_interval);
 
 /*
  * Destroy a tracing session.
@@ -162,8 +161,8 @@ LTTNG_EXPORT extern int lttng_destroy_session(const char *name);
  * Returns LTTNG_OK on success. The returned handle is owned by the caller
  * and must be free'd using lttng_destruction_handle_destroy().
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_destroy_session_ext(const char *session_name,
-               struct lttng_destruction_handle **handle);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_destroy_session_ext(const char *session_name, struct lttng_destruction_handle **handle);
 
 /*
  * Behaves exactly like lttng_destroy_session but does not wait for data
@@ -193,8 +192,8 @@ LTTNG_EXPORT extern int lttng_list_sessions(struct lttng_session **sessions);
  * Returns LTTNG_OK on success. See lttng-error.h for the meaning of the other
  * return codes.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_session_get_creation_time(
-               const struct lttng_session *session, uint64_t *creation_time);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_session_get_creation_time(const struct lttng_session *session, uint64_t *creation_time);
 
 /*
  * Set the shared memory path for a session.
@@ -205,8 +204,7 @@ LTTNG_EXPORT extern enum lttng_error_code lttng_session_get_creation_time(
  *
  * Return 0 on success else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_set_session_shm_path(const char *session_name,
-               const char *shm_path);
+LTTNG_EXPORT extern int lttng_set_session_shm_path(const char *session_name, const char *shm_path);
 
 #ifdef __cplusplus
 }
index c60a1963b67e80ed14b153f93c8432a93d49d6fc..706bf6ebfa767d6737678004e05f9ad085d31c27 100644 (file)
@@ -8,10 +8,12 @@
 #ifndef LTTNG_SNAPSHOT_INTERNAL_ABI_H
 #define LTTNG_SNAPSHOT_INTERNAL_ABI_H
 
+#include <common/macros.hpp>
+
+#include <lttng/constant.h>
+
 #include <limits.h>
 #include <stdint.h>
-#include <lttng/constant.h>
-#include <common/macros.hpp>
 
 /*
  * Object used for the snapshot API. This is opaque to the public library.
index b777e006b2f131e95f7508fec428d8c52f0476a3..4c1049b4d4243fd72de68a008df012207b787713 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef LTTNG_SNAPSHOT_H
 #define LTTNG_SNAPSHOT_H
 
-#include <limits.h>
 #include <lttng/lttng-export.h>
+
+#include <limits.h>
 #include <stdint.h>
 #include <sys/types.h>
 
@@ -40,15 +41,20 @@ LTTNG_EXPORT extern void lttng_snapshot_output_destroy(struct lttng_snapshot_out
  */
 
 /* Return snapshot ID. */
-LTTNG_EXPORT extern uint32_t lttng_snapshot_output_get_id(const struct lttng_snapshot_output *output);
+LTTNG_EXPORT extern uint32_t
+lttng_snapshot_output_get_id(const struct lttng_snapshot_output *output);
 /* Return maximum size of a snapshot. */
-LTTNG_EXPORT extern uint64_t lttng_snapshot_output_get_maxsize(const struct lttng_snapshot_output *output);
+LTTNG_EXPORT extern uint64_t
+lttng_snapshot_output_get_maxsize(const struct lttng_snapshot_output *output);
 /* Return snapshot name. */
-LTTNG_EXPORT extern const char *lttng_snapshot_output_get_name(const struct lttng_snapshot_output *output);
+LTTNG_EXPORT extern const char *
+lttng_snapshot_output_get_name(const struct lttng_snapshot_output *output);
 /* Return snapshot control URL in a text format. */
-LTTNG_EXPORT extern const char *lttng_snapshot_output_get_ctrl_url(const struct lttng_snapshot_output *output);
+LTTNG_EXPORT extern const char *
+lttng_snapshot_output_get_ctrl_url(const struct lttng_snapshot_output *output);
 /* Return snapshot data URL in a text format. */
-LTTNG_EXPORT extern const char *lttng_snapshot_output_get_data_url(const struct lttng_snapshot_output *output);
+LTTNG_EXPORT extern const char *
+lttng_snapshot_output_get_data_url(const struct lttng_snapshot_output *output);
 
 /*
  * Snapshot output setter family functions.
@@ -59,13 +65,13 @@ LTTNG_EXPORT extern const char *lttng_snapshot_output_get_data_url(const struct
 
 /* Set a custom ID. */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_id(uint32_t id,
-               struct lttng_snapshot_output *output);
+                                                    struct lttng_snapshot_output *output);
 /* Set the maximum size. */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_size(uint64_t size,
-               struct lttng_snapshot_output *output);
+                                                      struct lttng_snapshot_output *output);
 /* Set the snapshot name. */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_name(const char *name,
-               struct lttng_snapshot_output *output);
+                                                      struct lttng_snapshot_output *output);
 
 /*
  * Set the output destination to be a path on the local filesystem.
@@ -75,7 +81,7 @@ LTTNG_EXPORT extern int lttng_snapshot_output_set_name(const char *name,
  * Return 0 on success or else a negative LTTNG_ERR code.
  */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_local_path(const char *path,
-               struct lttng_snapshot_output *output);
+                                                            struct lttng_snapshot_output *output);
 
 /*
  * Set the output destination to be the network from a combined control/data
@@ -86,7 +92,7 @@ LTTNG_EXPORT extern int lttng_snapshot_output_set_local_path(const char *path,
  * Return 0 on success or else a negative LTTNG_ERR code.
  */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_network_url(const char *url,
-               struct lttng_snapshot_output *output);
+                                                             struct lttng_snapshot_output *output);
 
 /*
  * Set the output destination to be the network using separate URLs for control
@@ -99,15 +105,14 @@ LTTNG_EXPORT extern int lttng_snapshot_output_set_network_url(const char *url,
  * Return 0 on success or else a negative LTTNG_ERR code.
  */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_network_urls(
-               const char *ctrl_url, const char *data_url,
-               struct lttng_snapshot_output *output);
+       const char *ctrl_url, const char *data_url, struct lttng_snapshot_output *output);
 
 /* Set the control URL. Local and remote URL are supported. */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_ctrl_url(const char *url,
-               struct lttng_snapshot_output *output);
+                                                          struct lttng_snapshot_output *output);
 /* Set the data URL. Local and remote URL are supported. */
 LTTNG_EXPORT extern int lttng_snapshot_output_set_data_url(const char *url,
-               struct lttng_snapshot_output *output);
+                                                          struct lttng_snapshot_output *output);
 
 /*
  * Add an output object to a session identified by name.
@@ -115,7 +120,7 @@ LTTNG_EXPORT extern int lttng_snapshot_output_set_data_url(const char *url,
  * Return 0 on success or else a negative LTTNG_ERR code.
  */
 LTTNG_EXPORT extern int lttng_snapshot_add_output(const char *session_name,
-               struct lttng_snapshot_output *output);
+                                                 struct lttng_snapshot_output *output);
 
 /*
  * Delete an output object to a session identified by name.
@@ -123,7 +128,7 @@ LTTNG_EXPORT extern int lttng_snapshot_add_output(const char *session_name,
  * Return 0 on success or else a negative LTTNG_ERR code.
  */
 LTTNG_EXPORT extern int lttng_snapshot_del_output(const char *session_name,
-               struct lttng_snapshot_output *output);
+                                                 struct lttng_snapshot_output *output);
 
 /*
  * List all snapshot output(s) of a session identified by name. The output list
@@ -133,7 +138,7 @@ LTTNG_EXPORT extern int lttng_snapshot_del_output(const char *session_name,
  * is untouched.
  */
 LTTNG_EXPORT extern int lttng_snapshot_list_output(const char *session_name,
-               struct lttng_snapshot_output_list **list);
+                                                  struct lttng_snapshot_output_list **list);
 
 /*
  * Return the next available snapshot output object in the given list. A list
@@ -142,13 +147,14 @@ LTTNG_EXPORT extern int lttng_snapshot_list_output(const char *session_name,
  * Return the next object on success or else NULL indicating the end of the
  * list.
  */
-LTTNG_EXPORT extern struct lttng_snapshot_output *lttng_snapshot_output_list_get_next(
-               struct lttng_snapshot_output_list *list);
+LTTNG_EXPORT extern struct lttng_snapshot_output *
+lttng_snapshot_output_list_get_next(struct lttng_snapshot_output_list *list);
 
 /*
  * Free an output list object.
  */
-LTTNG_EXPORT extern void lttng_snapshot_output_list_destroy(struct lttng_snapshot_output_list *list);
+LTTNG_EXPORT extern void
+lttng_snapshot_output_list_destroy(struct lttng_snapshot_output_list *list);
 
 /*
  * Snapshot a trace for the given session.
@@ -162,8 +168,8 @@ LTTNG_EXPORT extern void lttng_snapshot_output_list_destroy(struct lttng_snapsho
  *
  * Return 0 on success or else a negative LTTNG_ERR value.
  */
-LTTNG_EXPORT extern int lttng_snapshot_record(const char *session_name,
-               struct lttng_snapshot_output *output, int wait);
+LTTNG_EXPORT extern int
+lttng_snapshot_record(const char *session_name, struct lttng_snapshot_output *output, int wait);
 
 #ifdef __cplusplus
 }
index 869f8a8f85b0bf7b1e1e39ee71298f23d732287c..f8f493e6650c1cd504fc44841a37907c6458d664 100644 (file)
@@ -116,17 +116,17 @@ struct lttng_process_attr_values;
  * The tracker's ownership is transfered to the caller. Use
  * lttng_process_attr_tracker_handle_destroy() to dispose of it.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_session_get_tracker_handle(
-               const char *session_name,
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               struct lttng_process_attr_tracker_handle **out_tracker_handle);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_session_get_tracker_handle(const char *session_name,
+                                enum lttng_domain_type domain,
+                                enum lttng_process_attr process_attr,
+                                struct lttng_process_attr_tracker_handle **out_tracker_handle);
 
 /*
  * Destroy a process attribute tracker handle.
  */
-LTTNG_EXPORT extern void lttng_process_attr_tracker_handle_destroy(
-               struct lttng_process_attr_tracker_handle *tracker_handle);
+LTTNG_EXPORT extern void
+lttng_process_attr_tracker_handle_destroy(struct lttng_process_attr_tracker_handle *tracker_handle);
 
 /*
  * Get the tracking policy of a process attribute tracker.
@@ -137,8 +137,8 @@ LTTNG_EXPORT extern void lttng_process_attr_tracker_handle_destroy(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_tracker_handle_get_tracking_policy(
-               const struct lttng_process_attr_tracker_handle *tracker_handle,
-               enum lttng_tracking_policy *policy);
+       const struct lttng_process_attr_tracker_handle *tracker_handle,
+       enum lttng_tracking_policy *policy);
 
 /*
  * Set the tracking policy of a process attribute tracker.
@@ -150,8 +150,8 @@ lttng_process_attr_tracker_handle_get_tracking_policy(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_tracker_handle_set_tracking_policy(
-               const struct lttng_process_attr_tracker_handle *tracker_handle,
-               enum lttng_tracking_policy policy);
+       const struct lttng_process_attr_tracker_handle *tracker_handle,
+       enum lttng_tracking_policy policy);
 
 /*
  * Add a numerical PID to the process ID process attribute tracker inclusion
@@ -165,9 +165,7 @@ lttng_process_attr_tracker_handle_set_tracking_policy(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_process_id_tracker_handle_add_pid(
-               const struct lttng_process_attr_tracker_handle
-                               *process_id_tracker,
-               pid_t pid);
+       const struct lttng_process_attr_tracker_handle *process_id_tracker, pid_t pid);
 
 /*
  * Remove a numerical PID from the process ID process attribute tracker include
@@ -180,9 +178,7 @@ lttng_process_attr_process_id_tracker_handle_add_pid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_process_id_tracker_handle_remove_pid(
-               const struct lttng_process_attr_tracker_handle
-                               *process_id_tracker,
-               pid_t pid);
+       const struct lttng_process_attr_tracker_handle *process_id_tracker, pid_t pid);
 
 /*
  * Add a numerical PID to the virtual process ID process attribute tracker
@@ -196,9 +192,7 @@ lttng_process_attr_process_id_tracker_handle_remove_pid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_process_id_tracker_handle_add_pid(
-               const struct lttng_process_attr_tracker_handle
-                               *process_id_tracker,
-               pid_t vpid);
+       const struct lttng_process_attr_tracker_handle *process_id_tracker, pid_t vpid);
 
 /*
  * Remove a numerical PID from the virtual process ID process attribute tracker
@@ -211,9 +205,7 @@ lttng_process_attr_virtual_process_id_tracker_handle_add_pid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_process_id_tracker_handle_remove_pid(
-               const struct lttng_process_attr_tracker_handle
-                               *process_id_tracker,
-               pid_t vpid);
+       const struct lttng_process_attr_tracker_handle *process_id_tracker, pid_t vpid);
 
 /*
  * Add a numerical UID to the user ID process attribute tracker inclusion set.
@@ -226,8 +218,7 @@ lttng_process_attr_virtual_process_id_tracker_handle_remove_pid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_user_id_tracker_handle_add_uid(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               uid_t uid);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker, uid_t uid);
 
 /*
  * Remove a numerical UID from the user ID process attribute tracker include
@@ -240,8 +231,7 @@ lttng_process_attr_user_id_tracker_handle_add_uid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_user_id_tracker_handle_remove_uid(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               uid_t uid);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker, uid_t uid);
 
 /*
  * Add a user name to the user ID process attribute tracker inclusion set.
@@ -257,8 +247,7 @@ lttng_process_attr_user_id_tracker_handle_remove_uid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_user_id_tracker_handle_add_user_name(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               const char *user_name);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker, const char *user_name);
 
 /*
  * Remove a user name from the user ID process attribute tracker include
@@ -274,8 +263,7 @@ lttng_process_attr_user_id_tracker_handle_add_user_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_user_id_tracker_handle_remove_user_name(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               const char *user_name);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker, const char *user_name);
 
 /*
  * Add a numerical UID to the virtual user ID process attribute tracker
@@ -289,8 +277,7 @@ lttng_process_attr_user_id_tracker_handle_remove_user_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_user_id_tracker_handle_add_uid(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               uid_t vuid);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker, uid_t vuid);
 
 /*
  * Remove a numerical UID from the virtual user ID process attribute tracker
@@ -303,8 +290,7 @@ lttng_process_attr_virtual_user_id_tracker_handle_add_uid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_user_id_tracker_handle_remove_uid(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               uid_t vuid);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker, uid_t vuid);
 
 /*
  * Add a user name to the virtual user ID process attribute tracker include
@@ -321,8 +307,8 @@ lttng_process_attr_virtual_user_id_tracker_handle_remove_uid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_user_id_tracker_handle_add_user_name(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               const char *virtual_user_name);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker,
+       const char *virtual_user_name);
 
 /*
  * Remove a user name from the virtual user ID process attribute tracker
@@ -338,8 +324,8 @@ lttng_process_attr_virtual_user_id_tracker_handle_add_user_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_user_id_tracker_handle_remove_user_name(
-               const struct lttng_process_attr_tracker_handle *user_id_tracker,
-               const char *virtual_user_name);
+       const struct lttng_process_attr_tracker_handle *user_id_tracker,
+       const char *virtual_user_name);
 
 /*
  * Add a numerical GID to the group ID process attribute tracker inclusion set.
@@ -352,8 +338,7 @@ lttng_process_attr_virtual_user_id_tracker_handle_remove_user_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_group_id_tracker_handle_add_gid(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               gid_t gid);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker, gid_t gid);
 
 /*
  * Remove a numerical GID from the group ID process attribute tracker include
@@ -366,8 +351,7 @@ lttng_process_attr_group_id_tracker_handle_add_gid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_group_id_tracker_handle_remove_gid(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               gid_t gid);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker, gid_t gid);
 
 /*
  * Add a group name to the group ID process attribute tracker inclusion set.
@@ -383,8 +367,7 @@ lttng_process_attr_group_id_tracker_handle_remove_gid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_group_id_tracker_handle_add_group_name(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               const char *group_name);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker, const char *group_name);
 
 /*
  * Remove a group name from the group ID process attribute tracker include
@@ -400,8 +383,7 @@ lttng_process_attr_group_id_tracker_handle_add_group_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_group_id_tracker_handle_remove_group_name(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               const char *group_name);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker, const char *group_name);
 
 /*
  * Add a numerical GID to the virtual group ID process attribute tracker
@@ -415,8 +397,7 @@ lttng_process_attr_group_id_tracker_handle_remove_group_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_group_id_tracker_handle_add_gid(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               gid_t vgid);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker, gid_t vgid);
 
 /*
  * Remove a numerical GID from the virtual group ID process attribute tracker
@@ -429,8 +410,7 @@ lttng_process_attr_virtual_group_id_tracker_handle_add_gid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_group_id_tracker_handle_remove_gid(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               gid_t vgid);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker, gid_t vgid);
 
 /*
  * Add a group name to the virtual group ID process attribute tracker include
@@ -447,8 +427,8 @@ lttng_process_attr_virtual_group_id_tracker_handle_remove_gid(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_group_id_tracker_handle_add_group_name(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               const char *virtual_group_name);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker,
+       const char *virtual_group_name);
 
 /*
  * Remove a group name from the virtual group ID process attribute tracker
@@ -464,8 +444,8 @@ lttng_process_attr_virtual_group_id_tracker_handle_add_group_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_virtual_group_id_tracker_handle_remove_group_name(
-               const struct lttng_process_attr_tracker_handle *group_id_tracker,
-               const char *virtual_group_name);
+       const struct lttng_process_attr_tracker_handle *group_id_tracker,
+       const char *virtual_group_name);
 
 /*
  * Get the process attribute values that are part of a tracker's inclusion set.
@@ -482,8 +462,8 @@ lttng_process_attr_virtual_group_id_tracker_handle_remove_group_name(
  */
 LTTNG_EXPORT extern enum lttng_process_attr_tracker_handle_status
 lttng_process_attr_tracker_handle_get_inclusion_set(
-               struct lttng_process_attr_tracker_handle *tracker_handle,
-               const struct lttng_process_attr_values **values);
+       struct lttng_process_attr_tracker_handle *tracker_handle,
+       const struct lttng_process_attr_values **values);
 
 /*
  * Get the count of values within a set of process attribute values.
@@ -492,9 +472,8 @@ lttng_process_attr_tracker_handle_get_inclusion_set(
  * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID if an invalid argument is provided.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_values_status
-lttng_process_attr_values_get_count(
-               const struct lttng_process_attr_values *values,
-               unsigned int *count);
+lttng_process_attr_values_get_count(const struct lttng_process_attr_values *values,
+                                   unsigned int *count);
 
 /*
  * Get the type of a process attribute value at a given index.
@@ -503,9 +482,8 @@ lttng_process_attr_values_get_count(
  * LTTNG_PROCESS_ATTR_VALUE_TYPE_INVALID if an invalid argument is provided.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_value_type
-lttng_process_attr_values_get_type_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index);
+lttng_process_attr_values_get_type_at_index(const struct lttng_process_attr_values *values,
+                                           unsigned int index);
 
 /*
  * Get a process ID process attribute value.
@@ -515,10 +493,9 @@ lttng_process_attr_values_get_type_at_index(
  * is not a process ID.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_values_status
-lttng_process_attr_values_get_pid_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index,
-               pid_t *pid);
+lttng_process_attr_values_get_pid_at_index(const struct lttng_process_attr_values *values,
+                                          unsigned int index,
+                                          pid_t *pid);
 
 /*
  * Get a user ID process attribute value.
@@ -528,10 +505,9 @@ lttng_process_attr_values_get_pid_at_index(
  * is not a user ID.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_values_status
-lttng_process_attr_values_get_uid_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index,
-               uid_t *uid);
+lttng_process_attr_values_get_uid_at_index(const struct lttng_process_attr_values *values,
+                                          unsigned int index,
+                                          uid_t *uid);
 
 /*
  * Get a user name process attribute value.
@@ -541,10 +517,9 @@ lttng_process_attr_values_get_uid_at_index(
  * is not a user name.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_values_status
-lttng_process_attr_values_get_user_name_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index,
-               const char **user_name);
+lttng_process_attr_values_get_user_name_at_index(const struct lttng_process_attr_values *values,
+                                                unsigned int index,
+                                                const char **user_name);
 
 /*
  * Get a group ID process attribute value.
@@ -554,10 +529,9 @@ lttng_process_attr_values_get_user_name_at_index(
  * is not a group ID.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_values_status
-lttng_process_attr_values_get_gid_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index,
-               gid_t *gid);
+lttng_process_attr_values_get_gid_at_index(const struct lttng_process_attr_values *values,
+                                          unsigned int index,
+                                          gid_t *gid);
 
 /*
  * Get a group name process attribute value.
@@ -567,10 +541,9 @@ lttng_process_attr_values_get_gid_at_index(
  * is not a group name.
  */
 LTTNG_EXPORT extern enum lttng_process_attr_values_status
-lttng_process_attr_values_get_group_name_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index,
-               const char **group_name);
+lttng_process_attr_values_get_group_name_at_index(const struct lttng_process_attr_values *values,
+                                                 unsigned int index,
+                                                 const char **group_name);
 
 /* The following entry points are deprecated. */
 
@@ -589,10 +562,8 @@ lttng_process_attr_values_get_group_name_at_index(
  *
  * Returns 0 on success, else a negative LTTng error code.
  */
-LTTNG_EXPORT extern int lttng_list_tracker_pids(struct lttng_handle *handle,
-               int *enabled,
-               int32_t **pids,
-               size_t *nr_pids);
+LTTNG_EXPORT extern int
+lttng_list_tracker_pids(struct lttng_handle *handle, int *enabled, int32_t **pids, size_t *nr_pids);
 
 /*
  * Deprecated: see `lttng_process_attr_process_id_tracker_handle_add_pid`.
index 30675523e7876a0534d702dfe114161bd9a7c0f6..c0aa3506a501121137541c21fd027d41339817e7 100644 (file)
@@ -12,7 +12,9 @@
 #include <common/dynamic-array.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+
 #include <lttng/lttng.h>
+
 #include <pthread.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -107,26 +109,21 @@ struct lttng_triggers_comm {
 };
 
 ssize_t lttng_trigger_create_from_payload(struct lttng_payload_view *view,
-               struct lttng_trigger **trigger);
+                                         struct lttng_trigger **trigger);
 
-int lttng_trigger_serialize(const struct lttng_trigger *trigger,
-               struct lttng_payload *payload);
+int lttng_trigger_serialize(const struct lttng_trigger *trigger, struct lttng_payload *payload);
 
 bool lttng_trigger_validate(const struct lttng_trigger *trigger);
 
-int lttng_trigger_assign_name(
-               struct lttng_trigger *dst, const struct lttng_trigger *src);
+int lttng_trigger_assign_name(struct lttng_trigger *dst, const struct lttng_trigger *src);
 
-void lttng_trigger_set_tracer_token(
-               struct lttng_trigger *trigger, uint64_t token);
+void lttng_trigger_set_tracer_token(struct lttng_trigger *trigger, uint64_t token);
 
 uint64_t lttng_trigger_get_tracer_token(const struct lttng_trigger *trigger);
 
-int lttng_trigger_generate_name(struct lttng_trigger *trigger,
-               uint64_t unique_id);
+int lttng_trigger_generate_name(struct lttng_trigger *trigger, uint64_t unique_id);
 
-bool lttng_trigger_is_equal(
-               const struct lttng_trigger *a, const struct lttng_trigger *b);
+bool lttng_trigger_is_equal(const struct lttng_trigger *a, const struct lttng_trigger *b);
 
 bool lttng_trigger_is_hidden(const struct lttng_trigger *trigger);
 
@@ -140,10 +137,10 @@ void lttng_trigger_put(struct lttng_trigger *trigger);
  * Serialize a trigger to a mi_writer.
  * Return LTTNG_OK in success, other enum lttng_error_code on error.
  */
-enum lttng_error_code lttng_trigger_mi_serialize(const struct lttng_trigger *trigger,
-               struct mi_writer *writer,
-               const struct mi_lttng_error_query_callbacks
-                               *error_query_callbacks);
+enum lttng_error_code
+lttng_trigger_mi_serialize(const struct lttng_trigger *trigger,
+                          struct mi_writer *writer,
+                          const struct mi_lttng_error_query_callbacks *error_query_callbacks);
 
 /*
  * Allocate a new set of triggers.
@@ -161,8 +158,8 @@ struct lttng_triggers *lttng_triggers_create();
  * The ownership of the trigger set element is NOT transfered.
  * The returned object can NOT be freed via lttng_trigger_destroy.
  */
-struct lttng_trigger *lttng_triggers_borrow_mutable_at_index(
-               const struct lttng_triggers *triggers, unsigned int index);
+struct lttng_trigger *lttng_triggers_borrow_mutable_at_index(const struct lttng_triggers *triggers,
+                                                            unsigned int index);
 
 /*
  * Add a trigger to the triggers set.
@@ -170,8 +167,7 @@ struct lttng_trigger *lttng_triggers_borrow_mutable_at_index(
  * A reference to the added trigger is acquired on behalf of the trigger set
  * on success.
  */
-int lttng_triggers_add(
-               struct lttng_triggers *triggers, struct lttng_trigger *trigger);
+int lttng_triggers_add(struct lttng_triggers *triggers, struct lttng_trigger *trigger);
 
 /*
  * Remove all triggers marked as hidden from the provided trigger set.
@@ -182,41 +178,38 @@ int lttng_triggers_remove_hidden_triggers(struct lttng_triggers *triggers);
  * Serialize a trigger set to an lttng_payload object.
  * Return LTTNG_OK on success, negative lttng error code on error.
  */
-int lttng_triggers_serialize(const struct lttng_triggers *triggers,
-               struct lttng_payload *payload);
+int lttng_triggers_serialize(const struct lttng_triggers *triggers, struct lttng_payload *payload);
 
 ssize_t lttng_triggers_create_from_payload(struct lttng_payload_view *view,
-               struct lttng_triggers **triggers);
+                                          struct lttng_triggers **triggers);
 
 /*
  * Serialize a trigger set to a mi_writer.
  * Return LTTNG_OK in success, other enum lttng_error_code on error.
  */
-enum lttng_error_code lttng_triggers_mi_serialize(const struct lttng_triggers *triggers,
-               struct mi_writer *writer,
-               const struct mi_lttng_error_query_callbacks
-                               *error_query_callbacks);
+enum lttng_error_code
+lttng_triggers_mi_serialize(const struct lttng_triggers *triggers,
+                           struct mi_writer *writer,
+                           const struct mi_lttng_error_query_callbacks *error_query_callbacks);
 
-const struct lttng_credentials *lttng_trigger_get_credentials(
-               const struct lttng_trigger *trigger);
+const struct lttng_credentials *lttng_trigger_get_credentials(const struct lttng_trigger *trigger);
 
 void lttng_trigger_set_credentials(struct lttng_trigger *trigger,
-               const struct lttng_credentials *creds);
+                                  const struct lttng_credentials *creds);
 
 /*
  * Return the type of any underlying domain restriction. If no particular
  * requirement is present, returns LTTNG_DOMAIN_NONE.
  */
-enum lttng_domain_type lttng_trigger_get_underlying_domain_type_restriction(
-               const struct lttng_trigger *trigger);
+enum lttng_domain_type
+lttng_trigger_get_underlying_domain_type_restriction(const struct lttng_trigger *trigger);
 
 /*
  * Generate any bytecode related to the trigger.
  * On success LTTNG_OK. On error, returns lttng_error code.
  */
-enum lttng_error_code lttng_trigger_generate_bytecode(
-               struct lttng_trigger *trigger,
-               const struct lttng_credentials *creds);
+enum lttng_error_code lttng_trigger_generate_bytecode(struct lttng_trigger *trigger,
+                                                     const struct lttng_credentials *creds);
 
 /*
  * Note that the trigger object is not locked by "copy" as it is const and
@@ -253,17 +246,17 @@ void lttng_trigger_lock(struct lttng_trigger *trigger);
 
 void lttng_trigger_unlock(struct lttng_trigger *trigger);
 
-enum lttng_trigger_status lttng_trigger_add_error_results(
-               const struct lttng_trigger *trigger,
-               struct lttng_error_query_results *results);
+enum lttng_trigger_status
+lttng_trigger_add_error_results(const struct lttng_trigger *trigger,
+                               struct lttng_error_query_results *results);
 
-enum lttng_trigger_status lttng_trigger_condition_add_error_results(
-               const struct lttng_trigger *trigger,
-               struct lttng_error_query_results *results);
+enum lttng_trigger_status
+lttng_trigger_condition_add_error_results(const struct lttng_trigger *trigger,
+                                         struct lttng_error_query_results *results);
 
-enum lttng_trigger_status lttng_trigger_add_action_error_query_results(
-               struct lttng_trigger *trigger,
-               struct lttng_error_query_results *results);
+enum lttng_trigger_status
+lttng_trigger_add_action_error_query_results(struct lttng_trigger *trigger,
+                                            struct lttng_error_query_results *results);
 
 /*
  * Set the trigger name.
@@ -276,7 +269,6 @@ enum lttng_trigger_status lttng_trigger_add_action_error_query_results(
  * Return LTTNG_TRIGGER_STATUS_OK on success, LTTNG_TRIGGER_STATUS_INVALID
  * if invalid parameters are passed.
  */
-enum lttng_trigger_status lttng_trigger_set_name(
-               struct lttng_trigger *trigger, const char *name);
+enum lttng_trigger_status lttng_trigger_set_name(struct lttng_trigger *trigger, const char *name);
 
 #endif /* LTTNG_TRIGGER_INTERNAL_H */
index 0a944a15af197d4fe2870e99f496531296b1e177..18ab06e505627d1539633dbf8ed1d707d4b9612d 100644 (file)
@@ -8,12 +8,13 @@
 #ifndef LTTNG_TRIGGER_H
 #define LTTNG_TRIGGER_H
 
-#include <sys/types.h>
 #include <lttng/constant.h>
-#include <inttypes.h>
 #include <lttng/lttng-error.h>
 #include <lttng/lttng-export.h>
 
+#include <inttypes.h>
+#include <sys/types.h>
+
 struct lttng_action;
 struct lttng_condition;
 struct lttng_trigger;
@@ -63,8 +64,8 @@ enum lttng_trigger_status {
  * Trigger objects must be destroyed using the lttng_trigger_destroy()
  * function.
  */
-LTTNG_EXPORT extern struct lttng_trigger *lttng_trigger_create(
-               struct lttng_condition *condition, struct lttng_action *action);
+LTTNG_EXPORT extern struct lttng_trigger *lttng_trigger_create(struct lttng_condition *condition,
+                                                              struct lttng_action *action);
 
 /*
  * Set the user identity (uid) of a trigger.
@@ -75,8 +76,8 @@ LTTNG_EXPORT extern struct lttng_trigger *lttng_trigger_create(
  * LTTNG_TRIGGER_STATUS_EPERM if not authorized,
  * LTTNG_TRIGGER_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_trigger_status lttng_trigger_set_owner_uid(
-               struct lttng_trigger *trigger, uid_t uid);
+LTTNG_EXPORT extern enum lttng_trigger_status
+lttng_trigger_set_owner_uid(struct lttng_trigger *trigger, uid_t uid);
 
 /*
  * Get the user identity (uid) of a trigger.
@@ -85,8 +86,8 @@ LTTNG_EXPORT extern enum lttng_trigger_status lttng_trigger_set_owner_uid(
  * LTTNG_TRIGGER_STATUS_UNSET if unset,
  * LTTNG_TRIGGER_STATUS_INVALID if invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_trigger_status lttng_trigger_get_owner_uid(
-               const struct lttng_trigger *trigger, uid_t *uid);
+LTTNG_EXPORT extern enum lttng_trigger_status
+lttng_trigger_get_owner_uid(const struct lttng_trigger *trigger, uid_t *uid);
 
 /*
  * Get the condition of a trigger.
@@ -95,11 +96,11 @@ LTTNG_EXPORT extern enum lttng_trigger_status lttng_trigger_get_owner_uid(
  *
  * Returns a condition on success, NULL on error.
  */
-LTTNG_EXPORT extern struct lttng_condition *lttng_trigger_get_condition(
-               struct lttng_trigger *trigger);
+LTTNG_EXPORT extern struct lttng_condition *
+lttng_trigger_get_condition(struct lttng_trigger *trigger);
 
-LTTNG_EXPORT extern const struct lttng_condition *lttng_trigger_get_const_condition(
-               const struct lttng_trigger *trigger);
+LTTNG_EXPORT extern const struct lttng_condition *
+lttng_trigger_get_const_condition(const struct lttng_trigger *trigger);
 
 /*
  * Get the action of a trigger.
@@ -108,11 +109,10 @@ LTTNG_EXPORT extern const struct lttng_condition *lttng_trigger_get_const_condit
  *
  * Returns an action on success, NULL on error.
  */
-LTTNG_EXPORT extern struct lttng_action *lttng_trigger_get_action(
-               struct lttng_trigger *trigger);
+LTTNG_EXPORT extern struct lttng_action *lttng_trigger_get_action(struct lttng_trigger *trigger);
 
-LTTNG_EXPORT extern const struct lttng_action *lttng_trigger_get_const_action(
-               const struct lttng_trigger *trigger);
+LTTNG_EXPORT extern const struct lttng_action *
+lttng_trigger_get_const_action(const struct lttng_trigger *trigger);
 
 /*
  * Get the name of a trigger.
@@ -125,8 +125,8 @@ LTTNG_EXPORT extern const struct lttng_action *lttng_trigger_get_const_action(
  * success, LTTNG_TRIGGER_STATUS_INVALID if an invalid parameter is passed,
  * or LTTNG_TRIGGER_STATUS_UNSET if the trigger is unnamed.
  */
-LTTNG_EXPORT extern enum lttng_trigger_status lttng_trigger_get_name(
-               const struct lttng_trigger *trigger, const char **name);
+LTTNG_EXPORT extern enum lttng_trigger_status
+lttng_trigger_get_name(const struct lttng_trigger *trigger, const char **name);
 
 /*
  * Destroy (frees) a trigger object.
@@ -141,9 +141,8 @@ LTTNG_EXPORT extern void lttng_trigger_destroy(struct lttng_trigger *trigger);
  *
  * Returns an LTTng status code.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_register_trigger_with_name(
-               struct lttng_trigger *trigger,
-               const char *name);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_register_trigger_with_name(struct lttng_trigger *trigger, const char *name);
 
 /*
  * Register a trigger to the session daemon, generating a unique name for its
@@ -155,8 +154,8 @@ LTTNG_EXPORT extern enum lttng_error_code lttng_register_trigger_with_name(
  *
  * Returns an LTTng status code.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_register_trigger_with_automatic_name(
-               struct lttng_trigger *trigger);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_register_trigger_with_automatic_name(struct lttng_trigger *trigger);
 
 /*
  * Unregister a trigger from the session daemon.
@@ -177,8 +176,7 @@ LTTNG_EXPORT extern int lttng_unregister_trigger(const struct lttng_trigger *tri
  *
  * Returns LTTNG_OK on success, else a suitable LTTng error code.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_list_triggers(
-               struct lttng_triggers **triggers);
+LTTNG_EXPORT extern enum lttng_error_code lttng_list_triggers(struct lttng_triggers **triggers);
 
 /*
  * Get a trigger from the set at a given index.
@@ -189,8 +187,8 @@ LTTNG_EXPORT extern enum lttng_error_code lttng_list_triggers(
  *
  * Returns a trigger, or NULL on error.
  */
-LTTNG_EXPORT extern const struct lttng_trigger *lttng_triggers_get_at_index(
-               const struct lttng_triggers *triggers, unsigned int index);
+LTTNG_EXPORT extern const struct lttng_trigger *
+lttng_triggers_get_at_index(const struct lttng_triggers *triggers, unsigned int index);
 
 /*
  * Get the number of triggers in a trigger set.
@@ -198,8 +196,8 @@ LTTNG_EXPORT extern const struct lttng_trigger *lttng_triggers_get_at_index(
  * Return LTTNG_TRIGGER_STATUS_OK on success,
  * LTTNG_TRIGGER_STATUS_INVALID when invalid parameters are passed.
  */
-LTTNG_EXPORT extern enum lttng_trigger_status lttng_triggers_get_count(
-               const struct lttng_triggers *triggers, unsigned int *count);
+LTTNG_EXPORT extern enum lttng_trigger_status
+lttng_triggers_get_count(const struct lttng_triggers *triggers, unsigned int *count);
 
 /*
  * Destroy a trigger set.
index f4e6ee74eb887e4619cb62cddfdb0f81df4cce0c..016aeb1c62762d23bb5225543be40d89a6528b0a 100644 (file)
@@ -125,39 +125,35 @@ struct lttng_userspace_probe_location_tracepoint {
        struct fd_handle *binary_fd_handle;
 };
 
-int lttng_userspace_probe_location_serialize(
-               const struct lttng_userspace_probe_location *location,
-               struct lttng_payload *payload);
+int lttng_userspace_probe_location_serialize(const struct lttng_userspace_probe_location *location,
+                                            struct lttng_payload *payload);
 
 int lttng_userspace_probe_location_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_userspace_probe_location **probe_location);
+       struct lttng_payload_view *view, struct lttng_userspace_probe_location **probe_location);
 
 /*
  * Returns a version of the location that is serialized to a contiguous region
  * of memory. Pass NULL to buffer to only get the storage requirement of the
  * flattened userspace probe location.
  */
-int lttng_userspace_probe_location_flatten(
-               const struct lttng_userspace_probe_location *location,
-               struct lttng_dynamic_buffer *buffer);
+int lttng_userspace_probe_location_flatten(const struct lttng_userspace_probe_location *location,
+                                          struct lttng_dynamic_buffer *buffer);
 
-struct lttng_userspace_probe_location *lttng_userspace_probe_location_copy(
-               const struct lttng_userspace_probe_location *location);
+struct lttng_userspace_probe_location *
+lttng_userspace_probe_location_copy(const struct lttng_userspace_probe_location *location);
 
 bool lttng_userspace_probe_location_lookup_method_is_equal(
-               const struct lttng_userspace_probe_location_lookup_method *a,
-               const struct lttng_userspace_probe_location_lookup_method *b);
+       const struct lttng_userspace_probe_location_lookup_method *a,
+       const struct lttng_userspace_probe_location_lookup_method *b);
 
-bool lttng_userspace_probe_location_is_equal(
-               const struct lttng_userspace_probe_location *a,
-               const struct lttng_userspace_probe_location *b);
+bool lttng_userspace_probe_location_is_equal(const struct lttng_userspace_probe_location *a,
+                                            const struct lttng_userspace_probe_location *b);
 
-unsigned long lttng_userspace_probe_location_hash(
-               const struct lttng_userspace_probe_location *location);
+unsigned long
+lttng_userspace_probe_location_hash(const struct lttng_userspace_probe_location *location);
 
-enum lttng_error_code lttng_userspace_probe_location_mi_serialize(
-               const struct lttng_userspace_probe_location *location,
-               struct mi_writer *writer);
+enum lttng_error_code
+lttng_userspace_probe_location_mi_serialize(const struct lttng_userspace_probe_location *location,
+                                           struct mi_writer *writer);
 
 #endif /* LTTNG_USERSPACE_PROBE_INTERNAL_H */
index b6fc13508a3c02f48db57c7596cfa915d0bf150e..7de667efcb5d0555d35f04d1491fe15b4dd56523 100644 (file)
@@ -21,10 +21,10 @@ extern "C" {
 struct lttng_userspace_probe_location_lookup_method;
 
 enum lttng_userspace_probe_location_lookup_method_type {
-       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_UNKNOWN           = -1,
-       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_DEFAULT  = 0,
-       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF      = 1,
-       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT    = 2,
+       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_UNKNOWN = -1,
+       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_DEFAULT = 0,
+       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF = 1,
+       LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT = 2,
 };
 
 /*
@@ -32,13 +32,13 @@ enum lttng_userspace_probe_location_lookup_method_type {
  */
 LTTNG_EXPORT extern enum lttng_userspace_probe_location_lookup_method_type
 lttng_userspace_probe_location_lookup_method_get_type(
-               const struct lttng_userspace_probe_location_lookup_method *lookup_method);
+       const struct lttng_userspace_probe_location_lookup_method *lookup_method);
 
 /*
  * Destroy a lookup method.
  */
 LTTNG_EXPORT extern void lttng_userspace_probe_location_lookup_method_destroy(
-               struct lttng_userspace_probe_location_lookup_method *lookup_method);
+       struct lttng_userspace_probe_location_lookup_method *lookup_method);
 
 /*
  * Create a tracepoint ELF function lookup method struct.
@@ -54,7 +54,6 @@ lttng_userspace_probe_location_lookup_method_function_elf_create(void);
 LTTNG_EXPORT extern struct lttng_userspace_probe_location_lookup_method *
 lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create(void);
 
-
 /*
  * Contains all the information needed to compute the instrumentation point in
  * the binary. It is used in conjonction with a lookup method.
@@ -62,32 +61,30 @@ lttng_userspace_probe_location_lookup_method_tracepoint_sdt_create(void);
 struct lttng_userspace_probe_location;
 
 enum lttng_userspace_probe_location_status {
-       LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK        = 0,
+       LTTNG_USERSPACE_PROBE_LOCATION_STATUS_OK = 0,
        /* Invalid parameters provided. */
-       LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID   = -1,
+       LTTNG_USERSPACE_PROBE_LOCATION_STATUS_INVALID = -1,
 };
 
 enum lttng_userspace_probe_location_type {
-       LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN     = -1,
+       LTTNG_USERSPACE_PROBE_LOCATION_TYPE_UNKNOWN = -1,
        /* Function. */
-       LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION    = 0,
+       LTTNG_USERSPACE_PROBE_LOCATION_TYPE_FUNCTION = 0,
        /* SDT probe's callsites. */
-       LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT  = 1,
+       LTTNG_USERSPACE_PROBE_LOCATION_TYPE_TRACEPOINT = 1,
 };
 
 /*
  * Get the type of the userspace probe location.
  */
 LTTNG_EXPORT extern enum lttng_userspace_probe_location_type
-lttng_userspace_probe_location_get_type(
-               const struct lttng_userspace_probe_location *location);
+lttng_userspace_probe_location_get_type(const struct lttng_userspace_probe_location *location);
 
 /*
  * Destroy the userspace probe location.
  */
-LTTNG_EXPORT extern void lttng_userspace_probe_location_destroy(
-               struct lttng_userspace_probe_location *location);
-
+LTTNG_EXPORT extern void
+lttng_userspace_probe_location_destroy(struct lttng_userspace_probe_location *location);
 
 enum lttng_userspace_probe_location_function_instrumentation_type {
        LTTNG_USERSPACE_PROBE_LOCATION_FUNCTION_INSTRUMENTATION_TYPE_UNKNOWN = -1,
@@ -104,35 +101,36 @@ enum lttng_userspace_probe_location_function_instrumentation_type {
  * location.
  */
 LTTNG_EXPORT extern struct lttng_userspace_probe_location *
-lttng_userspace_probe_location_function_create(const char *binary_path,
-               const char *function_name,
-               struct lttng_userspace_probe_location_lookup_method *lookup_method);
+lttng_userspace_probe_location_function_create(
+       const char *binary_path,
+       const char *function_name,
+       struct lttng_userspace_probe_location_lookup_method *lookup_method);
 
 /*
  * Get the target binary path of the probe location of the function type.
  */
 LTTNG_EXPORT extern const char *lttng_userspace_probe_location_function_get_binary_path(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the target function type of the probe location of the function type.
  */
 LTTNG_EXPORT extern const char *lttng_userspace_probe_location_function_get_function_name(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the FD to the target binary file to the probe location of the function
  * type. The FD is only valid for the duration of the lifetime of `location`.
  */
 LTTNG_EXPORT extern int lttng_userspace_probe_location_function_get_binary_fd(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the instrumentation type of the function probe location.
  */
 LTTNG_EXPORT extern enum lttng_userspace_probe_location_function_instrumentation_type
 lttng_userspace_probe_location_function_get_instrumentation_type(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the instrumentation type of the function probe location.
@@ -145,8 +143,8 @@ lttng_userspace_probe_location_function_get_instrumentation_type(
  */
 LTTNG_EXPORT extern enum lttng_userspace_probe_location_status
 lttng_userspace_probe_location_function_set_instrumentation_type(
-               const struct lttng_userspace_probe_location *location,
-               enum lttng_userspace_probe_location_function_instrumentation_type instrumentation_type);
+       const struct lttng_userspace_probe_location *location,
+       enum lttng_userspace_probe_location_function_instrumentation_type instrumentation_type);
 
 /*
  * Get the lookup method of the given userspace probe location.
@@ -156,7 +154,7 @@ lttng_userspace_probe_location_function_set_instrumentation_type(
  */
 LTTNG_EXPORT extern const struct lttng_userspace_probe_location_lookup_method *
 lttng_userspace_probe_location_get_lookup_method(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Create a probe location of the tracepoint type.
@@ -168,35 +166,37 @@ lttng_userspace_probe_location_get_lookup_method(
  * location.
  */
 LTTNG_EXPORT extern struct lttng_userspace_probe_location *
-lttng_userspace_probe_location_tracepoint_create(const char *binary_path,
-               const char *probe_name, const char *provider_name,
-               struct lttng_userspace_probe_location_lookup_method *lookup_method);
+lttng_userspace_probe_location_tracepoint_create(
+       const char *binary_path,
+       const char *probe_name,
+       const char *provider_name,
+       struct lttng_userspace_probe_location_lookup_method *lookup_method);
 
 /*
  * Get the target binary path of the probe location of the tracepoint type.
  */
 LTTNG_EXPORT extern const char *lttng_userspace_probe_location_tracepoint_get_binary_path(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the target probe name of the probe location of the tracepoint type.
  */
 LTTNG_EXPORT extern const char *lttng_userspace_probe_location_tracepoint_get_probe_name(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the target probe provider name of the probe location of the tracepoint
  * type.
  */
 LTTNG_EXPORT extern const char *lttng_userspace_probe_location_tracepoint_get_provider_name(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 /*
  * Get the FD to the target binary file to the probe location of the tracepoint
  * type. The FD is only valid for the duration of the lifetime of `location`.
  */
 LTTNG_EXPORT extern int lttng_userspace_probe_location_tracepoint_get_binary_fd(
-               const struct lttng_userspace_probe_location *location);
+       const struct lttng_userspace_probe_location *location);
 
 #ifdef __cplusplus
 }
index 4e3bf8686ec99884103e06de0f07eb41eeb11fc8..109ccb4c449f6f80ca94a573bb7005622a08ae79 100644 (file)
 #include <lttng/health-internal.hpp>
 
 enum health_type_consumerd {
-       HEALTH_CONSUMERD_TYPE_CHANNEL           = 0,
-       HEALTH_CONSUMERD_TYPE_METADATA          = 1,
-       HEALTH_CONSUMERD_TYPE_DATA              = 2,
-       HEALTH_CONSUMERD_TYPE_SESSIOND          = 3,
-       HEALTH_CONSUMERD_TYPE_METADATA_TIMER    = 4,
+       HEALTH_CONSUMERD_TYPE_CHANNEL = 0,
+       HEALTH_CONSUMERD_TYPE_METADATA = 1,
+       HEALTH_CONSUMERD_TYPE_DATA = 2,
+       HEALTH_CONSUMERD_TYPE_SESSIOND = 3,
+       HEALTH_CONSUMERD_TYPE_METADATA_TIMER = 4,
 
        NR_HEALTH_CONSUMERD_TYPES,
 };
index ab736d55b39eef1e59078135c316cc286ea97d3d..f21d5abba90c8205cafee47eac4c73faa92f6a48 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <common/consumer/consumer.hpp>
 
-#define NR_LTTNG_CONSUMER_READY                1
+#define NR_LTTNG_CONSUMER_READY 1
 extern int lttng_consumer_ready;
 
 extern const char *tracing_group_name;
@@ -21,7 +21,6 @@ extern const char *tracing_group_name;
  * have a C linkage name makes it easier, as it avoids having to look up a
  * mangled name.
  */
-extern "C" LTTNG_EXPORT
-enum lttng_consumer_type lttng_consumer_get_type();
+extern "C" LTTNG_EXPORT enum lttng_consumer_type lttng_consumer_get_type();
 
 #endif /* _LTTNG_CONSUMERD_H */
index 4cf7462de55fb22cc72eb42211c3d389f04cea9a..fef6bd0ab1362c0bec35871246c13b49d42a2f4d 100644 (file)
@@ -11,7 +11,7 @@
 #include <time.h>
 
 char *backward_compat_group_by_session(const char *path,
-               const char *local_session_name,
-               time_t session_creation_time);
+                                      const char *local_session_name,
+                                      time_t session_creation_time);
 
 #endif /* BACKWARD_COMPATIBILITY_GROUP_BY_H */
index 147069b6bc3303ee3fbdddb627f59d4eec9be650..5dc0bd37080c64de9c8fbc691c1e321a74cb323f 100644 (file)
  */
 
 #include "lttng-relayd.hpp"
+
 #include <common/buffer-view.hpp>
 
 int cmd_recv_stream_2_1(const struct lttng_buffer_view *payload,
-               char **path_name, char **channel_name);
+                       char **path_name,
+                       char **channel_name);
 
 #endif /* RELAYD_CMD_2_1_H */
index 79f241aaa249fce2a50378f1a8abd72684ae62f2..97565df5b8481e3fc8ff07999b0c5d9e8b905216 100644 (file)
@@ -9,20 +9,28 @@
 #define RELAYD_CMD_2_11_H
 
 #include "lttng-relayd.hpp"
+
 #include <common/buffer-view.hpp>
 #include <common/uuid.hpp>
 
 int cmd_create_session_2_11(const struct lttng_buffer_view *payload,
-               char *session_name, char *hostname, char *base_path,
-               uint32_t *live_timer, bool *snapshot,
-               uint64_t *id_sessiond, lttng_uuid& sessiond_uuid,
-               bool *has_current_chunk, uint64_t *current_chunk_id,
-               time_t *creation_time,
-               bool *session_name_contains_creation_time);
+                           char *session_name,
+                           char *hostname,
+                           char *base_path,
+                           uint32_t *live_timer,
+                           bool *snapshot,
+                           uint64_t *id_sessiond,
+                           lttng_uuid& sessiond_uuid,
+                           bool *has_current_chunk,
+                           uint64_t *current_chunk_id,
+                           time_t *creation_time,
+                           bool *session_name_contains_creation_time);
 
 int cmd_recv_stream_2_11(const struct lttng_buffer_view *payload,
-               char **ret_path_name, char **ret_channel_name,
-               uint64_t *tracefile_size, uint64_t *tracefile_count,
-               uint64_t *trace_archive_id);
+                        char **ret_path_name,
+                        char **ret_channel_name,
+                        uint64_t *tracefile_size,
+                        uint64_t *tracefile_count,
+                        uint64_t *trace_archive_id);
 
 #endif /* RELAYD_CMD_2_11_H */
index 010bbb127940554f7699ad765efe2f3f5d089375..4686949be2710e494d52b6690516e0d5170e0445 100644 (file)
  */
 
 #include "lttng-relayd.hpp"
+
 #include <common/buffer-view.hpp>
 
 int cmd_recv_stream_2_2(const struct lttng_buffer_view *payload,
-               char **path_name, char **channel_name,
-               uint64_t *tracefile_size, uint64_t *tracefile_count);
+                       char **path_name,
+                       char **channel_name,
+                       uint64_t *tracefile_size,
+                       uint64_t *tracefile_count);
 
 #endif /* RELAYD_CMD_2_2_H */
index b3d105c84744194b764370acdc6f48d3fd125974..98a6dabcc124cac04be66c3b1775e883526a17b7 100644 (file)
  */
 
 #include "lttng-relayd.hpp"
+
 #include <common/buffer-view.hpp>
 
 int cmd_create_session_2_4(const struct lttng_buffer_view *payload,
-               char *session_name, char *hostname,
-               uint32_t *live_timer, bool *snapshot);
+                          char *session_name,
+                          char *hostname,
+                          uint32_t *live_timer,
+                          bool *snapshot);
 
 #endif /* RELAYD_CMD_2_4_H */
index 24e361a4b2634bc8e4635e83033de3159911c9bc..351527c09370cf7151571ee48a5246317e0387ba 100644 (file)
@@ -11,8 +11,8 @@
  */
 
 #include "cmd-2-1.hpp"
+#include "cmd-2-11.hpp"
 #include "cmd-2-2.hpp"
 #include "cmd-2-4.hpp"
-#include "cmd-2-11.hpp"
 
 #endif /* RELAYD_CMD_H */
index de25255a7aab10057d6f0b7eb8631618283ef771..917c2ef6010a8e1d8a3de57ed97505c52e90c72c 100644 (file)
  *
  */
 
-#include <limits.h>
-#include <inttypes.h>
-#include <pthread.h>
-#include <urcu.h>
-#include <urcu/wfcqueue.h>
-#include <urcu/list.h>
+#include "session.hpp"
 
+#include <common/dynamic-buffer.hpp>
 #include <common/hashtable/hashtable.hpp>
-#include <common/sessiond-comm/sessiond-comm.hpp>
 #include <common/sessiond-comm/relayd.hpp>
-#include <common/dynamic-buffer.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
 
-#include "session.hpp"
+#include <inttypes.h>
+#include <limits.h>
+#include <pthread.h>
+#include <urcu.h>
+#include <urcu/list.h>
+#include <urcu/wfcqueue.h>
 
 enum connection_type {
-       RELAY_CONNECTION_UNKNOWN    = 0,
-       RELAY_DATA                  = 1,
-       RELAY_CONTROL               = 2,
-       RELAY_VIEWER_COMMAND        = 3,
-       RELAY_VIEWER_NOTIFICATION   = 4,
+       RELAY_CONNECTION_UNKNOWN = 0,
+       RELAY_DATA = 1,
+       RELAY_CONTROL = 2,
+       RELAY_VIEWER_COMMAND = 3,
+       RELAY_VIEWER_NOTIFICATION = 4,
 };
 
 enum data_connection_state {
@@ -107,8 +107,8 @@ struct relay_connection {
         */
        struct lttng_ht_node_ulong sock_n;
        bool in_socket_ht;
-       struct lttng_ht *socket_ht;     /* HACK: Contained within this hash table. */
-       struct rcu_head rcu_node;       /* For call_rcu teardown. */
+       struct lttng_ht *socket_ht; /* HACK: Contained within this hash table. */
+       struct rcu_head rcu_node; /* For call_rcu teardown. */
 
        union {
                struct {
@@ -129,16 +129,12 @@ struct relay_connection {
        } protocol;
 };
 
-struct relay_connection *connection_create(struct lttcomm_sock *sock,
-               enum connection_type type);
-struct relay_connection *connection_get_by_sock(struct lttng_ht *relay_connections_ht,
-               int sock);
+struct relay_connection *connection_create(struct lttcomm_sock *sock, enum connection_type type);
+struct relay_connection *connection_get_by_sock(struct lttng_ht *relay_connections_ht, int sock);
 int connection_reset_protocol_state(struct relay_connection *connection);
 bool connection_get(struct relay_connection *connection);
 void connection_put(struct relay_connection *connection);
-void connection_ht_add(struct lttng_ht *relay_connections_ht,
-               struct relay_connection *conn);
-int connection_set_session(struct relay_connection *conn,
-               struct relay_session *session);
+void connection_ht_add(struct lttng_ht *relay_connections_ht, struct relay_connection *conn);
+int connection_set_session(struct relay_connection *conn, struct relay_session *session);
 
 #endif /* _CONNECTION_H */
index dbf7d3fa21166d533507550f02261e41b26e887e..3d9026da818c4857fedce83fb65fcb883f6af102 100644 (file)
  *
  */
 
-#include <inttypes.h>
-#include <urcu/ref.h>
-
-#include <common/hashtable/hashtable.hpp>
-
 #include "session.hpp"
 #include "stream.hpp"
 #include "viewer-stream.hpp"
 
+#include <common/hashtable/hashtable.hpp>
+
+#include <inttypes.h>
+#include <urcu/ref.h>
+
 struct ctf_trace {
-       struct urcu_ref ref;            /* Every stream has a ref on the trace. */
-       struct relay_session *session;  /* Back ref to trace session */
+       struct urcu_ref ref; /* Every stream has a ref on the trace. */
+       struct relay_session *session; /* Back ref to trace session */
 
        /* Trace sub-folder relative to the session output path. */
        char *path;
@@ -31,7 +31,7 @@ struct ctf_trace {
         */
        pthread_mutex_t lock;
        uint64_t id;
-       struct relay_viewer_stream *viewer_metadata_stream;     /* RCU protected */
+       struct relay_viewer_stream *viewer_metadata_stream; /* RCU protected */
 
        /*
         * Relay streams associated with this ctf trace.
@@ -46,7 +46,7 @@ struct ctf_trace {
         * stream path name.
         */
        struct lttng_ht_node_str node;
-       struct rcu_head rcu_node;       /* For call_rcu teardown. */
+       struct rcu_head rcu_node; /* For call_rcu teardown. */
 
        /*
         * True if the metadata stream of this trace was sent the viewer in the
@@ -56,7 +56,7 @@ struct ctf_trace {
 };
 
 struct ctf_trace *ctf_trace_get_by_path_or_create(struct relay_session *session,
-               const char *subpath);
+                                                 const char *subpath);
 bool ctf_trace_get(struct ctf_trace *trace);
 void ctf_trace_put(struct ctf_trace *trace);
 
index 7d885c672127aa2917c18061093cc8be82f00ef8..2e417084887be3b42579f1b6cfbf8a8409fcbdac 100644 (file)
@@ -9,18 +9,19 @@
  *
  */
 
-#include <limits.h>
 #include <lttng/health-internal.hpp>
 
-#define LTTNG_RELAYD_HEALTH_ENV                "LTTNG_RELAYD_HEALTH"
+#include <limits.h>
+
+#define LTTNG_RELAYD_HEALTH_ENV "LTTNG_RELAYD_HEALTH"
 
 enum health_type_relayd {
-       HEALTH_RELAYD_TYPE_DISPATCHER           = 0,
-       HEALTH_RELAYD_TYPE_WORKER               = 1,
-       HEALTH_RELAYD_TYPE_LISTENER             = 2,
-       HEALTH_RELAYD_TYPE_LIVE_DISPATCHER      = 3,
-       HEALTH_RELAYD_TYPE_LIVE_WORKER          = 4,
-       HEALTH_RELAYD_TYPE_LIVE_LISTENER        = 5,
+       HEALTH_RELAYD_TYPE_DISPATCHER = 0,
+       HEALTH_RELAYD_TYPE_WORKER = 1,
+       HEALTH_RELAYD_TYPE_LISTENER = 2,
+       HEALTH_RELAYD_TYPE_LIVE_DISPATCHER = 3,
+       HEALTH_RELAYD_TYPE_LIVE_WORKER = 4,
+       HEALTH_RELAYD_TYPE_LIVE_LISTENER = 5,
 
        NR_HEALTH_RELAYD_TYPES,
 };
index cb29485eb72559b8d049cc03af4c477634a3580b..8ba88c99220642da66e74d03372591bb45f9a649 100644 (file)
  *
  */
 
-#include <inttypes.h>
-#include <pthread.h>
-
 #include <common/hashtable/hashtable.hpp>
 #include <common/index/index.hpp>
 
+#include <inttypes.h>
+#include <pthread.h>
+
 struct relay_stream;
 struct relay_connection;
 struct lttcomm_relayd_index;
@@ -24,8 +24,8 @@ struct relay_index {
        /*
         * index lock nests inside stream lock.
         */
-       struct urcu_ref ref;            /* Reference from getters. */
-       struct relay_stream *stream;    /* Back ref to stream */
+       struct urcu_ref ref; /* Reference from getters. */
+       struct relay_stream *stream; /* Back ref to stream */
 
        pthread_mutex_t lock;
        /*
@@ -49,17 +49,16 @@ struct relay_index {
         * index across the stream.
         */
        struct lttng_ht_node_u64 index_n;
-       struct rcu_head rcu_node;       /* For call_rcu teardown. */
+       struct rcu_head rcu_node; /* For call_rcu teardown. */
 };
 
 struct relay_index *relay_index_get_by_id_or_create(struct relay_stream *stream,
-               uint64_t net_seq_num);
+                                                   uint64_t net_seq_num);
 void relay_index_put(struct relay_index *index);
 int relay_index_set_file(struct relay_index *index,
-               struct lttng_index_file *index_file,
-               uint64_t data_offset);
-int relay_index_set_data(struct relay_index *index,
-               const struct ctf_packet_index *data);
+                        struct lttng_index_file *index_file,
+                        uint64_t data_offset);
+int relay_index_set_data(struct relay_index *index, const struct ctf_packet_index *data);
 int relay_index_try_flush(struct relay_index *index);
 
 void relay_index_close_all(struct relay_stream *stream);
@@ -67,7 +66,7 @@ void relay_index_close_partial_fd(struct relay_stream *stream);
 uint64_t relay_index_find_last(struct relay_stream *stream);
 int relay_index_switch_all_files(struct relay_stream *stream);
 int relay_index_set_control_data(struct relay_index *index,
-               const struct lttcomm_relayd_index *data,
-               unsigned int minor_version);
+                                const struct lttcomm_relayd_index *data,
+                                unsigned int minor_version);
 
 #endif /* _RELAY_INDEX_H */
index d1866d3f5690a2d07456a4294b75f20bc910090f..67fb58a14c642af28b8807e3a06a9e21fc979f56 100644 (file)
  *
  */
 
-#include <common/uri.hpp>
-
 #include "lttng-relayd.hpp"
 
+#include <common/uri.hpp>
+
 int relayd_live_create(struct lttng_uri *live_uri);
 int relayd_live_stop(void);
 int relayd_live_join(void);
index 32911f09c5ef54fd69cfdfe2ab4ae83524f049f9..ac7d0c69159b79c193ab9c4a44dcc67b1b401669 100644 (file)
  *
  */
 
+#include <common/compat/poll.hpp>
+#include <common/fd-tracker/fd-tracker.hpp>
+#include <common/hashtable/hashtable.hpp>
+
 #include <limits.h>
 #include <urcu.h>
 #include <urcu/wfcqueue.h>
 
-#include <common/compat/poll.hpp>
-#include <common/hashtable/hashtable.hpp>
-#include <common/fd-tracker/fd-tracker.hpp>
-
 struct sessiond_trace_chunk_registry;
 
 /*
@@ -47,7 +47,7 @@ extern struct sessiond_trace_chunk_registry *sessiond_trace_chunk_registry;
 
 extern char *opt_output_path;
 extern const char *tracing_group_name;
-extern const char * const config_section_name;
+extern const char *const config_section_name;
 extern enum relay_group_output_by opt_group_output_by;
 
 extern struct fd_tracker *the_fd_tracker;
@@ -60,7 +60,6 @@ int relayd_notify_thread_quit_pipe(void);
 void relayd_close_thread_quit_pipe(void);
 bool relayd_is_thread_quit_pipe(const int fd);
 
-int create_named_thread_poll_set(struct lttng_poll_event *events,
-               int size, const char *name);
+int create_named_thread_poll_set(struct lttng_poll_event *events, int size, const char *name);
 
 #endif /* LTTNG_RELAYD_H */
index 6fdb7fa609f5336429e6a21748b3b97d5edb7a43..393fb6f282103bb8702865375fc8491b2e371fab 100644 (file)
  *
  */
 
-#include <limits.h>
 #include <common/macros.hpp>
 
-#define LTTNG_VIEWER_PATH_MAX          4096
-#define LTTNG_VIEWER_NAME_MAX          255
-#define LTTNG_VIEWER_HOST_NAME_MAX     64
+#include <limits.h>
+
+#define LTTNG_VIEWER_PATH_MAX     4096
+#define LTTNG_VIEWER_NAME_MAX     255
+#define LTTNG_VIEWER_HOST_NAME_MAX 64
 
 /* Flags in reply to get_next_index and get_packet. */
 enum {
        /* New metadata is required to read this packet. */
-       LTTNG_VIEWER_FLAG_NEW_METADATA  = (1 << 0),
+       LTTNG_VIEWER_FLAG_NEW_METADATA = (1 << 0),
        /* New stream got added to the trace. */
-       LTTNG_VIEWER_FLAG_NEW_STREAM    = (1 << 1),
+       LTTNG_VIEWER_FLAG_NEW_STREAM = (1 << 1),
 };
 
 enum lttng_viewer_command {
-       LTTNG_VIEWER_CONNECT            = 1,
-       LTTNG_VIEWER_LIST_SESSIONS      = 2,
-       LTTNG_VIEWER_ATTACH_SESSION     = 3,
-       LTTNG_VIEWER_GET_NEXT_INDEX     = 4,
-       LTTNG_VIEWER_GET_PACKET         = 5,
-       LTTNG_VIEWER_GET_METADATA       = 6,
-       LTTNG_VIEWER_GET_NEW_STREAMS    = 7,
-       LTTNG_VIEWER_CREATE_SESSION     = 8,
-       LTTNG_VIEWER_DETACH_SESSION     = 9,
+       LTTNG_VIEWER_CONNECT = 1,
+       LTTNG_VIEWER_LIST_SESSIONS = 2,
+       LTTNG_VIEWER_ATTACH_SESSION = 3,
+       LTTNG_VIEWER_GET_NEXT_INDEX = 4,
+       LTTNG_VIEWER_GET_PACKET = 5,
+       LTTNG_VIEWER_GET_METADATA = 6,
+       LTTNG_VIEWER_GET_NEW_STREAMS = 7,
+       LTTNG_VIEWER_CREATE_SESSION = 8,
+       LTTNG_VIEWER_DETACH_SESSION = 9,
 };
 
 enum lttng_viewer_attach_return_code {
-       LTTNG_VIEWER_ATTACH_OK          = 1, /* The attach command succeeded. */
-       LTTNG_VIEWER_ATTACH_ALREADY     = 2, /* A viewer is already attached. */
-       LTTNG_VIEWER_ATTACH_UNK         = 3, /* The session ID is unknown. */
-       LTTNG_VIEWER_ATTACH_NOT_LIVE    = 4, /* The session is not live. */
-       LTTNG_VIEWER_ATTACH_SEEK_ERR    = 5, /* Seek error. */
-       LTTNG_VIEWER_ATTACH_NO_SESSION  = 6, /* No viewer session created. */
+       LTTNG_VIEWER_ATTACH_OK = 1, /* The attach command succeeded. */
+       LTTNG_VIEWER_ATTACH_ALREADY = 2, /* A viewer is already attached. */
+       LTTNG_VIEWER_ATTACH_UNK = 3, /* The session ID is unknown. */
+       LTTNG_VIEWER_ATTACH_NOT_LIVE = 4, /* The session is not live. */
+       LTTNG_VIEWER_ATTACH_SEEK_ERR = 5, /* Seek error. */
+       LTTNG_VIEWER_ATTACH_NO_SESSION = 6, /* No viewer session created. */
 };
 
 enum lttng_viewer_next_index_return_code {
-       LTTNG_VIEWER_INDEX_OK           = 1, /* Index is available. */
-       LTTNG_VIEWER_INDEX_RETRY        = 2, /* Index not yet available. */
-       LTTNG_VIEWER_INDEX_HUP          = 3, /* Index closed (trace destroyed). */
-       LTTNG_VIEWER_INDEX_ERR          = 4, /* Unknow error. */
-       LTTNG_VIEWER_INDEX_INACTIVE     = 5, /* Inactive stream beacon. */
-       LTTNG_VIEWER_INDEX_EOF          = 6, /* End of index file. */
+       LTTNG_VIEWER_INDEX_OK = 1, /* Index is available. */
+       LTTNG_VIEWER_INDEX_RETRY = 2, /* Index not yet available. */
+       LTTNG_VIEWER_INDEX_HUP = 3, /* Index closed (trace destroyed). */
+       LTTNG_VIEWER_INDEX_ERR = 4, /* Unknow error. */
+       LTTNG_VIEWER_INDEX_INACTIVE = 5, /* Inactive stream beacon. */
+       LTTNG_VIEWER_INDEX_EOF = 6, /* End of index file. */
 };
 
 enum lttng_viewer_get_packet_return_code {
-       LTTNG_VIEWER_GET_PACKET_OK      = 1,
-       LTTNG_VIEWER_GET_PACKET_RETRY   = 2,
-       LTTNG_VIEWER_GET_PACKET_ERR     = 3,
-       LTTNG_VIEWER_GET_PACKET_EOF     = 4,
+       LTTNG_VIEWER_GET_PACKET_OK = 1,
+       LTTNG_VIEWER_GET_PACKET_RETRY = 2,
+       LTTNG_VIEWER_GET_PACKET_ERR = 3,
+       LTTNG_VIEWER_GET_PACKET_EOF = 4,
 };
 
 enum lttng_viewer_get_metadata_return_code {
-       LTTNG_VIEWER_METADATA_OK        = 1,
-       LTTNG_VIEWER_NO_NEW_METADATA    = 2,
-       LTTNG_VIEWER_METADATA_ERR       = 3,
+       LTTNG_VIEWER_METADATA_OK = 1,
+       LTTNG_VIEWER_NO_NEW_METADATA = 2,
+       LTTNG_VIEWER_METADATA_ERR = 3,
 };
 
 enum lttng_viewer_connection_type {
-       LTTNG_VIEWER_CLIENT_COMMAND             = 1,
-       LTTNG_VIEWER_CLIENT_NOTIFICATION        = 2,
+       LTTNG_VIEWER_CLIENT_COMMAND = 1,
+       LTTNG_VIEWER_CLIENT_NOTIFICATION = 2,
 };
 
 enum lttng_viewer_seek {
        /* Receive the trace packets from the beginning. */
-       LTTNG_VIEWER_SEEK_BEGINNING     = 1,
+       LTTNG_VIEWER_SEEK_BEGINNING = 1,
        /* Receive the trace packets from now. */
-       LTTNG_VIEWER_SEEK_LAST          = 2,
+       LTTNG_VIEWER_SEEK_LAST = 2,
 };
 
 enum lttng_viewer_new_streams_return_code {
-       LTTNG_VIEWER_NEW_STREAMS_OK           = 1, /* If new streams are being sent. */
-       LTTNG_VIEWER_NEW_STREAMS_NO_NEW       = 2, /* If no new streams are available. */
-       LTTNG_VIEWER_NEW_STREAMS_ERR          = 3, /* Error. */
-       LTTNG_VIEWER_NEW_STREAMS_HUP          = 4, /* Session closed. */
+       LTTNG_VIEWER_NEW_STREAMS_OK = 1, /* If new streams are being sent. */
+       LTTNG_VIEWER_NEW_STREAMS_NO_NEW = 2, /* If no new streams are available. */
+       LTTNG_VIEWER_NEW_STREAMS_ERR = 3, /* Error. */
+       LTTNG_VIEWER_NEW_STREAMS_HUP = 4, /* Session closed. */
 };
 
 enum lttng_viewer_create_session_return_code {
-       LTTNG_VIEWER_CREATE_SESSION_OK          = 1,
-       LTTNG_VIEWER_CREATE_SESSION_ERR         = 2,
+       LTTNG_VIEWER_CREATE_SESSION_OK = 1,
+       LTTNG_VIEWER_CREATE_SESSION_ERR = 2,
 };
 
 enum lttng_viewer_detach_session_return_code {
-       LTTNG_VIEWER_DETACH_SESSION_OK          = 1,
-       LTTNG_VIEWER_DETACH_SESSION_UNK         = 2,
-       LTTNG_VIEWER_DETACH_SESSION_ERR         = 3,
+       LTTNG_VIEWER_DETACH_SESSION_OK = 1,
+       LTTNG_VIEWER_DETACH_SESSION_UNK = 2,
+       LTTNG_VIEWER_DETACH_SESSION_ERR = 3,
 };
 
 struct lttng_viewer_session {
@@ -116,9 +117,9 @@ struct lttng_viewer_stream {
 } LTTNG_PACKED;
 
 struct lttng_viewer_cmd {
-       uint64_t data_size;     /* data size following this header */
-       uint32_t cmd;           /* enum lttcomm_relayd_command */
-       uint32_t cmd_version;   /* command version */
+       uint64_t data_size; /* data size following this header */
+       uint32_t cmd; /* enum lttcomm_relayd_command */
+       uint32_t cmd_version; /* command version */
 } LTTNG_PACKED;
 
 /*
@@ -129,7 +130,7 @@ struct lttng_viewer_connect {
        uint64_t viewer_session_id;
        uint32_t major;
        uint32_t minor;
-       uint32_t type;          /* enum lttng_viewer_connection_type */
+       uint32_t type; /* enum lttng_viewer_connection_type */
 } LTTNG_PACKED;
 
 /*
@@ -137,7 +138,7 @@ struct lttng_viewer_connect {
  */
 struct lttng_viewer_list_sessions {
        uint32_t sessions_count;
-       char session_list[];    /* struct lttng_viewer_session */
+       char session_list[]; /* struct lttng_viewer_session */
 } LTTNG_PACKED;
 
 /*
@@ -145,8 +146,8 @@ struct lttng_viewer_list_sessions {
  */
 struct lttng_viewer_attach_session_request {
        uint64_t session_id;
-       uint64_t offset;        /* unused for now */
-       uint32_t seek;          /* enum lttng_viewer_seek */
+       uint64_t offset; /* unused for now */
+       uint32_t seek; /* enum lttng_viewer_seek */
 } LTTNG_PACKED;
 
 struct lttng_viewer_attach_session_response {
@@ -162,7 +163,7 @@ struct lttng_viewer_attach_session_response {
  */
 struct lttng_viewer_get_next_index {
        uint64_t stream_id;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
 
 struct lttng_viewer_index {
        uint64_t offset;
@@ -172,9 +173,9 @@ struct lttng_viewer_index {
        uint64_t timestamp_end;
        uint64_t events_discarded;
        uint64_t stream_id;
-       uint32_t status;        /* enum lttng_viewer_next_index_return_code */
-       uint32_t flags;         /* LTTNG_VIEWER_FLAG_* */
-} __attribute__ ((__packed__));
+       uint32_t status; /* enum lttng_viewer_next_index_return_code */
+       uint32_t flags; /* LTTNG_VIEWER_FLAG_* */
+} __attribute__((__packed__));
 
 /*
  * LTTNG_VIEWER_GET_PACKET payload.
@@ -186,9 +187,9 @@ struct lttng_viewer_get_packet {
 } LTTNG_PACKED;
 
 struct lttng_viewer_trace_packet {
-       uint32_t status;        /* enum lttng_viewer_get_packet_return_code */
+       uint32_t status; /* enum lttng_viewer_get_packet_return_code */
        uint32_t len;
-       uint32_t flags;         /* LTTNG_VIEWER_FLAG_* */
+       uint32_t flags; /* LTTNG_VIEWER_FLAG_* */
        char data[];
 } LTTNG_PACKED;
 
@@ -201,7 +202,7 @@ struct lttng_viewer_get_metadata {
 
 struct lttng_viewer_metadata_packet {
        uint64_t len;
-       uint32_t status;        /* enum lttng_viewer_get_metadata_return_code */
+       uint32_t status; /* enum lttng_viewer_get_metadata_return_code */
        char data[];
 } LTTNG_PACKED;
 
index e3eb9d72ef9c59a68ddc561abe9a01bf41559d90..1de1f1853009e10cac954e690edd2aeaa2b25c4f 100644 (file)
@@ -1321,12 +1321,13 @@ static void *relay_thread_dispatcher(void *data __attribute__((unused)))
                         * the data will be read at some point in time
                         * or wait to the end of the world :)
                         */
-                       ret = lttng_write(relay_conn_pipe[1], &new_conn, sizeof(new_conn)); /* NOLINT
-                                                                                              sizeof
-                                                                                              used
-                                                                                              on a
-                                                                                              pointer.
-                                                                                            */
+                       ret = lttng_write(
+                               relay_conn_pipe[1], &new_conn, sizeof(new_conn)); /* NOLINT
+                                                                                    sizeof
+                                                                                    used
+                                                                                    on a
+                                                                                    pointer.
+                                                                                  */
                        if (ret < 0) {
                                PERROR("write connection pipe");
                                connection_put(new_conn);
index 986eca68f041868b569ead28977034f8aaa88d2d..b50c685262aa73eb753a72524b7f85fff322a3c5 100644 (file)
  *
  */
 
-#include <limits.h>
+#include <common/hashtable/hashtable.hpp>
+#include <common/optional.hpp>
+#include <common/trace-chunk.hpp>
+#include <common/uuid.hpp>
+
+#include <lttng/constant.h>
+
 #include <inttypes.h>
+#include <limits.h>
 #include <pthread.h>
 #include <urcu/list.h>
 #include <urcu/ref.h>
 
-#include <lttng/constant.h>
-#include <common/hashtable/hashtable.hpp>
-#include <common/uuid.hpp>
-#include <common/trace-chunk.hpp>
-#include <common/optional.hpp>
-
 /*
  * Represents a session for the relay point of view
  */
@@ -107,7 +108,7 @@ struct relay_session {
         * Traversals are protected by RCU.
         * recv_list_lock also protects stream_count.
         */
-       struct cds_list_head recv_list; /* RCU list. */
+       struct cds_list_head recv_list; /* RCU list. */
        uint32_t stream_count;
        pthread_mutex_t recv_list_lock;
 
@@ -135,20 +136,21 @@ struct relay_session {
         */
        bool ongoing_rotation;
        struct lttng_directory_handle *output_directory;
-       struct rcu_head rcu_node;       /* For call_rcu teardown. */
+       struct rcu_head rcu_node; /* For call_rcu teardown. */
 };
 
 struct relay_session *session_create(const char *session_name,
-               const char *hostname, const char *base_path,
-               uint32_t live_timer,
-               bool snapshot,
-               const lttng_uuid& sessiond_uuid,
-               const uint64_t *id_sessiond,
-               const uint64_t *current_chunk_id,
-               const time_t *creation_time,
-               uint32_t major,
-               uint32_t minor,
-               bool session_name_contains_creation_timestamp);
+                                    const char *hostname,
+                                    const char *base_path,
+                                    uint32_t live_timer,
+                                    bool snapshot,
+                                    const lttng_uuid& sessiond_uuid,
+                                    const uint64_t *id_sessiond,
+                                    const uint64_t *current_chunk_id,
+                                    const time_t *creation_time,
+                                    uint32_t major,
+                                    uint32_t minor,
+                                    bool session_name_contains_creation_timestamp);
 struct relay_session *session_get_by_id(uint64_t id);
 bool session_get(struct relay_session *session);
 void session_put(struct relay_session *session);
index 4d5759d87b28d663d88aabc1dd06b4ca475c2636..c290f9d0fdaf4873ffea66117547075999d8768c 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef SESSIOND_TRACE_CHUNK_REGISTRY_H
 #define SESSIOND_TRACE_CHUNK_REGISTRY_H
 
-#include <common/uuid.hpp>
 #include <common/trace-chunk.hpp>
+#include <common/uuid.hpp>
+
 #include <stdint.h>
 
 /*
  */
 struct sessiond_trace_chunk_registry;
 
-struct sessiond_trace_chunk_registry *
-sessiond_trace_chunk_registry_create(void);
+struct sessiond_trace_chunk_registry *sessiond_trace_chunk_registry_create(void);
 
-void sessiond_trace_chunk_registry_destroy(
-               struct sessiond_trace_chunk_registry *sessiond_registry);
+void sessiond_trace_chunk_registry_destroy(struct sessiond_trace_chunk_registry *sessiond_registry);
 
 int sessiond_trace_chunk_registry_session_created(
-               struct sessiond_trace_chunk_registry *sessiond_registry,
-               const lttng_uuid& sessiond_uuid);
+       struct sessiond_trace_chunk_registry *sessiond_registry, const lttng_uuid& sessiond_uuid);
 
 int sessiond_trace_chunk_registry_session_destroyed(
-               struct sessiond_trace_chunk_registry *sessiond_registry,
-               const lttng_uuid& sessiond_uuid);
-
-struct lttng_trace_chunk *sessiond_trace_chunk_registry_publish_chunk(
-               struct sessiond_trace_chunk_registry *sessiond_registry,
-               const lttng_uuid& sessiond_uuid, uint64_t session_id,
-               struct lttng_trace_chunk *chunk);
+       struct sessiond_trace_chunk_registry *sessiond_registry, const lttng_uuid& sessiond_uuid);
 
 struct lttng_trace_chunk *
-sessiond_trace_chunk_registry_get_anonymous_chunk(
-               struct sessiond_trace_chunk_registry *sessiond_registry,
-               const lttng_uuid& sessiond_uuid,
-               uint64_t session_id);
+sessiond_trace_chunk_registry_publish_chunk(struct sessiond_trace_chunk_registry *sessiond_registry,
+                                           const lttng_uuid& sessiond_uuid,
+                                           uint64_t session_id,
+                                           struct lttng_trace_chunk *chunk);
+
+struct lttng_trace_chunk *sessiond_trace_chunk_registry_get_anonymous_chunk(
+       struct sessiond_trace_chunk_registry *sessiond_registry,
+       const lttng_uuid& sessiond_uuid,
+       uint64_t session_id);
 
 struct lttng_trace_chunk *
-sessiond_trace_chunk_registry_get_chunk(
-               struct sessiond_trace_chunk_registry *sessiond_registry,
-               const lttng_uuid& sessiond_uuid,
-               uint64_t session_id, uint64_t chunk_id);
+sessiond_trace_chunk_registry_get_chunk(struct sessiond_trace_chunk_registry *sessiond_registry,
+                                       const lttng_uuid& sessiond_uuid,
+                                       uint64_t session_id,
+                                       uint64_t chunk_id);
 
 int sessiond_trace_chunk_registry_chunk_exists(
-               struct sessiond_trace_chunk_registry *sessiond_registry,
-               const lttng_uuid& sessiond_uuid,
-               uint64_t session_id, uint64_t chunk_id, bool *chunk_exists);
+       struct sessiond_trace_chunk_registry *sessiond_registry,
+       const lttng_uuid& sessiond_uuid,
+       uint64_t session_id,
+       uint64_t chunk_id,
+       bool *chunk_exists);
 
 #endif /* SESSIOND_TRACE_CHUNK_REGISTRY_H */
index 6e09c5571c5428c1d4a09efba0419d2e91035f21..eee56d38d1ef78a761e7b405e1adffd570f70f57 100644 (file)
  *
  */
 
-#include <limits.h>
-#include <inttypes.h>
-#include <pthread.h>
-#include <urcu/list.h>
+#include "session.hpp"
+#include "tracefile-array.hpp"
 
+#include <common/buffer-view.hpp>
 #include <common/hashtable/hashtable.hpp>
-#include <common/trace-chunk.hpp>
 #include <common/optional.hpp>
-#include <common/buffer-view.hpp>
+#include <common/trace-chunk.hpp>
 
-#include "session.hpp"
-#include "tracefile-array.hpp"
+#include <inttypes.h>
+#include <limits.h>
+#include <pthread.h>
+#include <urcu/list.h>
 
 struct lttcomm_relayd_index;
 
@@ -118,8 +118,8 @@ struct relay_stream {
         */
        struct tracefile_array *tfa;
 
-       bool closed;            /* Stream is closed. */
-       bool close_requested;   /* Close command has been received. */
+       bool closed; /* Stream is closed. */
+       bool close_requested; /* Close command has been received. */
 
        /*
         * Counts number of indexes in indexes_ht. Redundant info.
@@ -169,8 +169,8 @@ struct relay_stream {
         * Node of stream within global stream hash table.
         */
        struct lttng_ht_node_u64 node;
-       bool in_stream_ht;              /* is stream in stream hash table. */
-       struct rcu_head rcu_node;       /* For call_rcu teardown. */
+       bool in_stream_ht; /* is stream in stream hash table. */
+       struct rcu_head rcu_node; /* For call_rcu teardown. */
        /*
         * The trace chunk to which the file currently being produced (if any)
         * belongs.
@@ -186,33 +186,37 @@ struct relay_stream {
 };
 
 struct relay_stream *stream_create(struct ctf_trace *trace,
-       uint64_t stream_handle, char *path_name,
-       char *channel_name, uint64_t tracefile_size,
-       uint64_t tracefile_count);
+                                  uint64_t stream_handle,
+                                  char *path_name,
+                                  char *channel_name,
+                                  uint64_t tracefile_size,
+                                  uint64_t tracefile_count);
 
 struct relay_stream *stream_get_by_id(uint64_t stream_id);
 bool stream_get(struct relay_stream *stream);
 void stream_put(struct relay_stream *stream);
-int stream_rotate_output_files(struct relay_session *session,
-               struct relay_stream *stream);
+int stream_rotate_output_files(struct relay_session *session, struct relay_stream *stream);
 int stream_set_pending_rotation(struct relay_stream *stream,
-               struct lttng_trace_chunk *next_trace_chunk,
-               uint64_t rotation_sequence_number);
+                               struct lttng_trace_chunk *next_trace_chunk,
+                               uint64_t rotation_sequence_number);
 void try_stream_close(struct relay_stream *stream);
 void stream_publish(struct relay_stream *stream);
-int stream_init_packet(struct relay_stream *stream, size_t packet_size,
-               bool *file_rotated);
+int stream_init_packet(struct relay_stream *stream, size_t packet_size, bool *file_rotated);
 int stream_write(struct relay_stream *stream,
-               const struct lttng_buffer_view *packet, size_t padding_len);
+                const struct lttng_buffer_view *packet,
+                size_t padding_len);
 /* Called after the reception of a complete data packet. */
-int stream_update_index(struct relay_stream *stream, uint64_t net_seq_num,
-               bool rotate_index, bool *flushed, uint64_t total_size);
+int stream_update_index(struct relay_stream *stream,
+                       uint64_t net_seq_num,
+                       bool rotate_index,
+                       bool *flushed,
+                       uint64_t total_size);
 int stream_complete_packet(struct relay_stream *stream,
-               size_t packet_total_size, uint64_t sequence_number,
-               bool index_flushed);
+                          size_t packet_total_size,
+                          uint64_t sequence_number,
+                          bool index_flushed);
 /* Index info is in host endianness. */
-int stream_add_index(struct relay_stream *stream,
-               const struct lttcomm_relayd_index *index_info);
+int stream_add_index(struct relay_stream *stream, const struct lttcomm_relayd_index *index_info);
 int stream_reset_file(struct relay_stream *stream);
 
 void print_relay_streams(void);
index 09c425fad43267f96e40b30063e28ebdf95159df..25b228016219ace106080b4b814b6c7d650b4695 100644 (file)
@@ -8,15 +8,15 @@
  *
  */
 
-#include <limits.h>
 #include <inttypes.h>
+#include <limits.h>
 #include <pthread.h>
 #include <stdbool.h>
 
 struct tracefile {
        /* Per-tracefile head/tail seq. */
-       uint64_t seq_head;      /* Newest seqcount. Inclusive. */
-       uint64_t seq_tail;      /* Oldest seqcount. Inclusive. */
+       uint64_t seq_head; /* Newest seqcount. Inclusive. */
+       uint64_t seq_tail; /* Oldest seqcount. Inclusive. */
 };
 
 enum tracefile_rotate_type {
@@ -54,8 +54,7 @@ struct tracefile_array *tracefile_array_create(size_t count);
 void tracefile_array_destroy(struct tracefile_array *tfa);
 
 void tracefile_array_file_rotate(struct tracefile_array *tfa, enum tracefile_rotate_type type);
-void tracefile_array_commit_seq(struct tracefile_array *tfa,
-               uint64_t new_seq_head);
+void tracefile_array_commit_seq(struct tracefile_array *tfa, uint64_t new_seq_head);
 void tracefile_array_reset(struct tracefile_array *tfa);
 
 uint64_t tracefile_array_get_read_file_index_head(struct tracefile_array *tfa);
@@ -66,7 +65,6 @@ uint64_t tracefile_array_get_file_index_tail(struct tracefile_array *tfa);
 /* May return -1ULL in the case where we have not received any indexes yet. */
 uint64_t tracefile_array_get_seq_tail(struct tracefile_array *tfa);
 
-bool tracefile_array_seq_in_file(struct tracefile_array *tfa,
-               uint64_t file_index, uint64_t seq);
+bool tracefile_array_seq_in_file(struct tracefile_array *tfa, uint64_t file_index, uint64_t seq);
 
 #endif /* _STREAM_H */
index 65ad3e11a8165fe4fa3ec973f7bd42f49ff83e54..301b8ffc7ff1c41738c3e94b6d7b0cb01c173513 100644 (file)
  *
  */
 
-#include <limits.h>
-#include <inttypes.h>
-#include <pthread.h>
-#include <urcu/list.h>
-#include <urcu/ref.h>
+#include "lttng-viewer-abi.hpp"
+#include "session.hpp"
 
 #include <common/hashtable/hashtable.hpp>
 #include <common/trace-chunk.hpp>
 
-#include "session.hpp"
-#include "lttng-viewer-abi.hpp"
+#include <inttypes.h>
+#include <limits.h>
+#include <pthread.h>
+#include <urcu/list.h>
+#include <urcu/ref.h>
 
 struct relay_viewer_session {
        /*
@@ -29,8 +29,8 @@ struct relay_viewer_session {
         * This list limits the design to having the sessions in at most
         * one viewer session.
         */
-       struct cds_list_head session_list;      /* RCU list. */
-       pthread_mutex_t session_list_lock;      /* Protects list updates. */
+       struct cds_list_head session_list; /* RCU list. */
+       pthread_mutex_t session_list_lock; /* Protects list updates. */
        /*
         * The viewer session's current trace chunk is initially set, when
         * a viewer attaches to the viewer session, to a copy the corresponding
@@ -65,14 +65,13 @@ struct relay_viewer_session *viewer_session_create(void);
 void viewer_session_destroy(struct relay_viewer_session *vsession);
 void viewer_session_close(struct relay_viewer_session *vsession);
 
-enum lttng_viewer_attach_return_code viewer_session_attach(
-               struct relay_viewer_session *vsession,
-               struct relay_session *session);
+enum lttng_viewer_attach_return_code viewer_session_attach(struct relay_viewer_session *vsession,
+                                                          struct relay_session *session);
 int viewer_session_is_attached(struct relay_viewer_session *vsession,
-               struct relay_session *session);
+                              struct relay_session *session);
 void viewer_session_close_one_session(struct relay_viewer_session *vsession,
-               struct relay_session *session);
+                                     struct relay_session *session);
 int viewer_session_set_trace_chunk_copy(struct relay_viewer_session *vsession,
-               struct lttng_trace_chunk *relay_session_trace_chunk);
+                                       struct lttng_trace_chunk *relay_session_trace_chunk);
 
 #endif /* _VIEWER_SESSION_H */
index 42bdc1e208be4ac2a06bdc80ce6bd5b6f2ef4f96..2886420f4dd74be64d48a3b1b6d33de97824a4fe 100644 (file)
  *
  */
 
-#include <limits.h>
-#include <inttypes.h>
-#include <pthread.h>
-
-#include <common/hashtable/hashtable.hpp>
-
 #include "ctf-trace.hpp"
 #include "lttng-viewer-abi.hpp"
 #include "stream.hpp"
 
+#include <common/hashtable/hashtable.hpp>
+
+#include <inttypes.h>
+#include <limits.h>
+#include <pthread.h>
+
 struct relay_stream;
 
 /*
@@ -78,15 +78,14 @@ struct relay_viewer_stream {
 };
 
 struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream,
-               struct lttng_trace_chunk *viewer_trace_chunk,
-               enum lttng_viewer_seek seek_t);
+                                                struct lttng_trace_chunk *viewer_trace_chunk,
+                                                enum lttng_viewer_seek seek_t);
 
 struct relay_viewer_stream *viewer_stream_get_by_id(uint64_t id);
 bool viewer_stream_get(struct relay_viewer_stream *vstream);
 void viewer_stream_put(struct relay_viewer_stream *vstream);
 int viewer_stream_rotate(struct relay_viewer_stream *vstream);
-bool viewer_stream_is_tracefile_seq_readable(struct relay_viewer_stream *vstream,
-               uint64_t seq);
+bool viewer_stream_is_tracefile_seq_readable(struct relay_viewer_stream *vstream, uint64_t seq);
 void print_viewer_streams(void);
 void viewer_stream_close_files(struct relay_viewer_stream *vstream);
 void viewer_stream_sync_tracefile_array_tail(struct relay_viewer_stream *vstream);
index 85d5931fedb9fa09188652d0646036f9fc9d08da..4fc874f15b38773319a5121797df6e5c1d13a06f 100644 (file)
@@ -22,8 +22,7 @@ enum action_executor_status {
        ACTION_EXECUTOR_STATUS_INVALID,
 };
 
-struct action_executor *action_executor_create(
-               struct notification_thread_handle *handle);
+struct action_executor *action_executor_create(struct notification_thread_handle *handle);
 
 void action_executor_destroy(struct action_executor *executor);
 
@@ -37,11 +36,11 @@ void action_executor_destroy(struct action_executor *executor);
  * This function assumes the ownership of the `evaluation` both on success and
  * failure: the caller should no longer access it once the function returns.
  */
-enum action_executor_status action_executor_enqueue_trigger(
-               struct action_executor *executor,
-               struct lttng_trigger *trigger,
-               struct lttng_evaluation *evaluation,
-               const struct lttng_credentials *object_creds,
-               struct notification_client_list *list);
+enum action_executor_status
+action_executor_enqueue_trigger(struct action_executor *executor,
+                               struct lttng_trigger *trigger,
+                               struct lttng_evaluation *evaluation,
+                               const struct lttng_credentials *object_creds,
+                               struct notification_client_list *list);
 
 #endif /* ACTION_EXECUTOR_H */
index d84ea61721f21cacfb2d8879d7d2d65b9490ff61..86d0a9b881ab888d2aa1ec70b613abe47f41e3fe 100644 (file)
@@ -17,14 +17,12 @@ bool agent_tracing_is_enabled(void);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline
-bool launch_agent_management_thread(void)
+static inline bool launch_agent_management_thread(void)
 {
        return true;
 }
 
-static inline
-bool agent_tracing_is_enabled(void)
+static inline bool agent_tracing_is_enabled(void)
 {
        return false;
 }
index 2ad42c3f4a6a639e5b8824b414944414c16e0b49..388543f6627877f6f5c1a5547ce1db2ed42f28a2 100644 (file)
@@ -9,14 +9,15 @@
 #ifndef LTTNG_SESSIOND_AGENT_H
 #define LTTNG_SESSIOND_AGENT_H
 
-#include <inttypes.h>
-
 #include <common/hashtable/hashtable.hpp>
+
 #include <lttng/lttng.h>
 
+#include <inttypes.h>
+
 /* Agent protocol version that is verified during the agent registration. */
-#define AGENT_MAJOR_VERSION            2
-#define AGENT_MINOR_VERSION            0
+#define AGENT_MAJOR_VERSION 2
+#define AGENT_MINOR_VERSION 0
 
 /*
  * Hash table that contains the agent app created upon registration indexed by
@@ -145,32 +146,29 @@ void agent_add(struct agent *agt, struct lttng_ht *ht);
 
 /* Agent event API. */
 struct agent_event *agent_create_event(const char *name,
-               enum lttng_loglevel_type loglevel_type, int loglevel_value,
-               struct lttng_bytecode *filter,
-               char *filter_expression);
+                                      enum lttng_loglevel_type loglevel_type,
+                                      int loglevel_value,
+                                      struct lttng_bytecode *filter,
+                                      char *filter_expression);
 void agent_add_event(struct agent_event *event, struct agent *agt);
 
 struct agent_event *agent_find_event(const char *name,
-               enum lttng_loglevel_type loglevel_type,
-               int loglevel_value,
-               const char *filter_expression,
-               struct agent *agt);
-void agent_find_events_by_name(const char *name, struct agent *agt,
-               struct lttng_ht_iter* iter);
-void agent_event_next_duplicate(const char *name,
-               struct agent *agt, struct lttng_ht_iter* iter);
+                                    enum lttng_loglevel_type loglevel_type,
+                                    int loglevel_value,
+                                    const char *filter_expression,
+                                    struct agent *agt);
+void agent_find_events_by_name(const char *name, struct agent *agt, struct lttng_ht_iter *iter);
+void agent_event_next_duplicate(const char *name, struct agent *agt, struct lttng_ht_iter *iter);
 void agent_delete_event(struct agent_event *event, struct agent *agt);
 void agent_destroy_event(struct agent_event *event);
 
 /* Agent context API.*/
-int agent_enable_context(const struct lttng_event_context *ctx,
-               enum lttng_domain_type domain);
-int agent_add_context(const struct lttng_event_context *ctx,
-               struct agent *agt);
+int agent_enable_context(const struct lttng_event_context *ctx, enum lttng_domain_type domain);
+int agent_add_context(const struct lttng_event_context *ctx, struct agent *agt);
 
 /* Agent app API. */
-struct agent_app *agent_create_app(pid_t pid, enum lttng_domain_type domain,
-               struct lttcomm_sock *sock);
+struct agent_app *
+agent_create_app(pid_t pid, enum lttng_domain_type domain, struct lttcomm_sock *sock);
 void agent_add_app(struct agent_app *app);
 void agent_delete_app(struct agent_app *app);
 struct agent_app *agent_find_app_by_sock(int sock);
@@ -179,20 +177,16 @@ void agent_destroy_app_by_sock(int sock);
 int agent_send_registration_done(struct agent_app *app);
 
 /* Agent action API */
-int agent_enable_event(struct agent_event *event,
-               enum lttng_domain_type domain);
-int agent_disable_event(struct agent_event *event,
-               enum lttng_domain_type domain);
+int agent_enable_event(struct agent_event *event, enum lttng_domain_type domain);
+int agent_disable_event(struct agent_event *event, enum lttng_domain_type domain);
 void agent_update(const struct agent *agt, const struct agent_app *app);
-int agent_list_events(struct lttng_event **events,
-               enum lttng_domain_type domain);
+int agent_list_events(struct lttng_event **events, enum lttng_domain_type domain);
 
-struct agent_event *agent_find_event_by_trigger(
-               const struct lttng_trigger *trigger, struct agent *agt);
+struct agent_event *agent_find_event_by_trigger(const struct lttng_trigger *trigger,
+                                               struct agent *agt);
 
 /* Global event notifier per-domain agents. */
-struct agent *agent_find_by_event_notifier_domain(
-               enum lttng_domain_type domain_type);
+struct agent *agent_find_by_event_notifier_domain(enum lttng_domain_type domain_type);
 void agent_by_event_notifier_domain_ht_destroy(void);
 int agent_by_event_notifier_domain_ht_create(void);
 
index 4641361f013d260f66ed797fcf3a7bed0a947094..35f7960e909c4d0a590cb9ef8d8343b4f9374f3c 100644 (file)
@@ -8,16 +8,17 @@
 #ifndef LTTNG_BUFFER_REGISTRY_H
 #define LTTNG_BUFFER_REGISTRY_H
 
-#include <stdint.h>
-#include <urcu/list.h>
-
-#include <lttng/lttng.h>
-#include <common/hashtable/hashtable.hpp>
-
 #include "consumer.hpp"
 #include "lttng-ust-ctl.hpp"
-#include "ust-registry.hpp"
 #include "ust-registry-session.hpp"
+#include "ust-registry.hpp"
+
+#include <common/hashtable/hashtable.hpp>
+
+#include <lttng/lttng.h>
+
+#include <stdint.h>
+#include <urcu/list.h>
 
 struct buffer_reg_stream {
        struct cds_list_head lnode;
@@ -68,9 +69,9 @@ struct buffer_reg_uid {
         * Keys to match this object in a hash table. The following three variables
         * identify a unique per UID buffer registry.
         */
-       uint64_t session_id;    /* Unique tracing session id. */
-       int bits_per_long;      /* ABI */
-       uid_t uid;                      /* Owner. */
+       uint64_t session_id; /* Unique tracing session id. */
+       int bits_per_long; /* ABI */
+       uid_t uid; /* Owner. */
 
        enum lttng_domain_type domain;
        struct buffer_reg_session *registry;
@@ -101,20 +102,24 @@ struct buffer_reg_pid {
 
 /* Buffer registry per UID. */
 void buffer_reg_init_uid_registry(void);
-int buffer_reg_uid_create(uint64_t session_id, uint32_t bits_per_long, uid_t uid,
-               enum lttng_domain_type domain, struct buffer_reg_uid **regp,
-               const char *root_shm_path, const char *shm_path);
+int buffer_reg_uid_create(uint64_t session_id,
+                         uint32_t bits_per_long,
+                         uid_t uid,
+                         enum lttng_domain_type domain,
+                         struct buffer_reg_uid **regp,
+                         const char *root_shm_path,
+                         const char *shm_path);
 void buffer_reg_uid_add(struct buffer_reg_uid *reg);
-struct buffer_reg_uid *buffer_reg_uid_find(uint64_t session_id,
-               uint32_t bits_per_long, uid_t uid);
+struct buffer_reg_uid *buffer_reg_uid_find(uint64_t session_id, uint32_t bits_per_long, uid_t uid);
 void buffer_reg_uid_remove(struct buffer_reg_uid *regp);
-void buffer_reg_uid_destroy(struct buffer_reg_uid *regp,
-               struct consumer_output *consumer);
+void buffer_reg_uid_destroy(struct buffer_reg_uid *regp, struct consumer_output *consumer);
 
 /* Buffer registry per PID. */
 void buffer_reg_init_pid_registry(void);
-int buffer_reg_pid_create(uint64_t session_id, struct buffer_reg_pid **regp,
-               const char *root_shm_path, const char *shm_path);
+int buffer_reg_pid_create(uint64_t session_id,
+                         struct buffer_reg_pid **regp,
+                         const char *root_shm_path,
+                         const char *shm_path);
 void buffer_reg_pid_add(struct buffer_reg_pid *reg);
 struct buffer_reg_pid *buffer_reg_pid_find(uint64_t session_id);
 void buffer_reg_pid_remove(struct buffer_reg_pid *regp);
@@ -122,27 +127,21 @@ void buffer_reg_pid_destroy(struct buffer_reg_pid *regp);
 
 /* Channel */
 int buffer_reg_channel_create(uint64_t key, struct buffer_reg_channel **regp);
-void buffer_reg_channel_add(struct buffer_reg_session *session,
-               struct buffer_reg_channel *channel);
-struct buffer_reg_channel *buffer_reg_channel_find(uint64_t key,
-               struct buffer_reg_uid *reg);
-void buffer_reg_channel_remove(struct buffer_reg_session *session,
-               struct buffer_reg_channel *regp);
-void buffer_reg_channel_destroy(struct buffer_reg_channel *regp,
-               enum lttng_domain_type domain);
+void buffer_reg_channel_add(struct buffer_reg_session *session, struct buffer_reg_channel *channel);
+struct buffer_reg_channel *buffer_reg_channel_find(uint64_t key, struct buffer_reg_uid *reg);
+void buffer_reg_channel_remove(struct buffer_reg_session *session, struct buffer_reg_channel *regp);
+void buffer_reg_channel_destroy(struct buffer_reg_channel *regp, enum lttng_domain_type domain);
 
 /* Stream */
 int buffer_reg_stream_create(struct buffer_reg_stream **regp);
-void buffer_reg_stream_add(struct buffer_reg_stream *stream,
-               struct buffer_reg_channel *channel);
-void buffer_reg_stream_destroy(struct buffer_reg_stream *regp,
-               enum lttng_domain_type domain);
+void buffer_reg_stream_add(struct buffer_reg_stream *stream, struct buffer_reg_channel *channel);
+void buffer_reg_stream_destroy(struct buffer_reg_stream *regp, enum lttng_domain_type domain);
 
 /* Global registry. */
 void buffer_reg_destroy_registries(void);
 
-int buffer_reg_uid_consumer_channel_key(
-               struct cds_list_head *buffer_reg_uid_list,
-               uint64_t chan_key, uint64_t *consumer_chan_key);
+int buffer_reg_uid_consumer_channel_key(struct cds_list_head *buffer_reg_uid_list,
+                                       uint64_t chan_key,
+                                       uint64_t *consumer_chan_key);
 
 #endif /* LTTNG_BUFFER_REGISTRY_H */
index 342e30f78a472e75113103527b7789b68885551f..f7156c6324574fc1dfe1a6e4a908cf5d3d9b60ff 100644 (file)
@@ -8,31 +8,28 @@
 #ifndef _LTT_CHANNEL_H
 #define _LTT_CHANNEL_H
 
-#include <lttng/lttng.h>
-
 #include "trace-kernel.hpp"
 #include "trace-ust.hpp"
 
-int channel_kernel_disable(struct ltt_kernel_session *ksession,
-               char *channel_name);
+#include <lttng/lttng.h>
+
+int channel_kernel_disable(struct ltt_kernel_session *ksession, char *channel_name);
 enum lttng_error_code channel_kernel_enable(struct ltt_kernel_session *ksession,
-               struct ltt_kernel_channel *kchan);
+                                           struct ltt_kernel_channel *kchan);
 enum lttng_error_code channel_kernel_create(struct ltt_kernel_session *ksession,
-               struct lttng_channel *chan,
-               int kernel_pipe);
+                                           struct lttng_channel *chan,
+                                           int kernel_pipe);
 
-struct lttng_channel *channel_new_default_attr(int domain,
-               enum lttng_buffer_type type);
+struct lttng_channel *channel_new_default_attr(int domain, enum lttng_buffer_type type);
 void channel_attr_destroy(struct lttng_channel *channel);
 
 enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
-               struct lttng_channel *attr, enum lttng_buffer_type type);
+                                        struct lttng_channel *attr,
+                                        enum lttng_buffer_type type);
 enum lttng_error_code channel_ust_enable(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan);
-int channel_ust_disable(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan);
+                                        struct ltt_ust_channel *uchan);
+int channel_ust_disable(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan);
 
-struct lttng_channel *trace_ust_channel_to_lttng_channel(
-               const struct ltt_ust_channel *uchan);
+struct lttng_channel *trace_ust_channel_to_lttng_channel(const struct ltt_ust_channel *uchan);
 
 #endif /* _LTT_CHANNEL_H */
index 0680e14fd581eb28817baf0e077659845bded1bf..6c3f696f01cc3fb12ba246116c7f9beb692850fa 100644 (file)
@@ -2214,10 +2214,8 @@ skip_domain:
                                        cmd_ctx->lsm.u.rotation_set_schedule.type;
                value = cmd_ctx->lsm.u.rotation_set_schedule.value;
 
-               ret = cmd_rotation_set_schedule(cmd_ctx->session,
-                                               set_schedule,
-                                               schedule_type,
-                                               value);
+               ret = cmd_rotation_set_schedule(
+                       cmd_ctx->session, set_schedule, schedule_type, value);
                if (ret != LTTNG_OK) {
                        goto error;
                }
index fd130fc186ff3a44a5cbbb69861d23ffa04e9025..8fc1cb4cd00972860d5e6df9b0e36f071df6510e 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common/compat/time.hpp>
 #include <common/uuid.hpp>
+
 #include <vendor/optional.hpp>
 
 #include <stddef.h>
index 413bb6500353ba6e72536e97513f66ef16e00cd8..203ffb14652880478fd0843e91aa0a75d22c3de5 100644 (file)
@@ -3390,8 +3390,7 @@ error:
  *
  * Called with session lock held.
  */
-int cmd_destroy_session(struct ltt_session *session,
-                       int *sock_fd)
+int cmd_destroy_session(struct ltt_session *session, int *sock_fd)
 {
        int ret;
        enum lttng_error_code destruction_last_error = LTTNG_OK;
index 6defe0049d6a55966ba9fcd1a7ab34af98ebf88b..8b77b18a4d7e2f81c24f6a4c8922da2d59b8f8ba 100644 (file)
@@ -12,6 +12,7 @@
 #include "lttng-sessiond.hpp"
 #include "lttng/tracker.h"
 #include "session.hpp"
+
 #include <common/tracker.hpp>
 
 struct notification_thread_handle;
@@ -38,60 +39,64 @@ struct cmd_completion_handler {
 void cmd_init(void);
 
 /* Session commands */
-enum lttng_error_code cmd_create_session(struct command_ctx *cmd_ctx, int sock,
-               struct lttng_session_descriptor **return_descriptor);
+enum lttng_error_code cmd_create_session(struct command_ctx *cmd_ctx,
+                                        int sock,
+                                        struct lttng_session_descriptor **return_descriptor);
 int cmd_destroy_session(struct ltt_session *session, int *sock_fd);
 
 /* Channel commands */
 int cmd_disable_channel(struct ltt_session *session,
-               enum lttng_domain_type domain, char *channel_name);
+                       enum lttng_domain_type domain,
+                       char *channel_name);
 int cmd_enable_channel(struct command_ctx *cmd_ctx, int sock, int wpipe);
 
 /* Process attribute tracker commands */
-enum lttng_error_code cmd_process_attr_tracker_get_tracking_policy(
-               struct ltt_session *session,
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               enum lttng_tracking_policy *policy);
-enum lttng_error_code cmd_process_attr_tracker_set_tracking_policy(
-               struct ltt_session *session,
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               enum lttng_tracking_policy policy);
-enum lttng_error_code cmd_process_attr_tracker_inclusion_set_add_value(
-               struct ltt_session *session,
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               const struct process_attr_value *value);
-enum lttng_error_code cmd_process_attr_tracker_inclusion_set_remove_value(
-               struct ltt_session *session,
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               const struct process_attr_value *value);
-enum lttng_error_code cmd_process_attr_tracker_get_inclusion_set(
-               struct ltt_session *session,
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               struct lttng_process_attr_values **values);
+enum lttng_error_code
+cmd_process_attr_tracker_get_tracking_policy(struct ltt_session *session,
+                                            enum lttng_domain_type domain,
+                                            enum lttng_process_attr process_attr,
+                                            enum lttng_tracking_policy *policy);
+enum lttng_error_code
+cmd_process_attr_tracker_set_tracking_policy(struct ltt_session *session,
+                                            enum lttng_domain_type domain,
+                                            enum lttng_process_attr process_attr,
+                                            enum lttng_tracking_policy policy);
+enum lttng_error_code
+cmd_process_attr_tracker_inclusion_set_add_value(struct ltt_session *session,
+                                                enum lttng_domain_type domain,
+                                                enum lttng_process_attr process_attr,
+                                                const struct process_attr_value *value);
+enum lttng_error_code
+cmd_process_attr_tracker_inclusion_set_remove_value(struct ltt_session *session,
+                                                   enum lttng_domain_type domain,
+                                                   enum lttng_process_attr process_attr,
+                                                   const struct process_attr_value *value);
+enum lttng_error_code
+cmd_process_attr_tracker_get_inclusion_set(struct ltt_session *session,
+                                          enum lttng_domain_type domain,
+                                          enum lttng_process_attr process_attr,
+                                          struct lttng_process_attr_values **values);
 
 /* Event commands */
 int cmd_disable_event(struct command_ctx *cmd_ctx,
-               struct lttng_event *event,
-               char *filter_expression,
-               struct lttng_bytecode *filter,
-               struct lttng_event_exclusion *exclusion);
+                     struct lttng_event *event,
+                     char *filter_expression,
+                     struct lttng_bytecode *filter,
+                     struct lttng_event_exclusion *exclusion);
 int cmd_add_context(struct command_ctx *cmd_ctx,
-               const struct lttng_event_context *event_context,
-               int kwpipe);
-int cmd_set_filter(struct ltt_session *session, enum lttng_domain_type domain,
-               char *channel_name, struct lttng_event *event,
-               struct lttng_bytecode *bytecode);
+                   const struct lttng_event_context *event_context,
+                   int kwpipe);
+int cmd_set_filter(struct ltt_session *session,
+                  enum lttng_domain_type domain,
+                  char *channel_name,
+                  struct lttng_event *event,
+                  struct lttng_bytecode *bytecode);
 int cmd_enable_event(struct command_ctx *cmd_ctx,
-               struct lttng_event *event,
-               char *filter_expression,
-               struct lttng_event_exclusion *exclusion,
-               struct lttng_bytecode *bytecode,
-               int wpipe);
+                    struct lttng_event *event,
+                    char *filter_expression,
+                    struct lttng_event_exclusion *exclusion,
+                    struct lttng_bytecode *bytecode,
+                    int wpipe);
 
 /* Trace session action commands */
 int cmd_start_trace(struct ltt_session *session);
@@ -99,77 +104,81 @@ int cmd_stop_trace(struct ltt_session *session);
 
 /* Consumer commands */
 int cmd_register_consumer(struct ltt_session *session,
-               enum lttng_domain_type domain,
-               const char *sock_path, struct consumer_data *cdata);
-int cmd_set_consumer_uri(struct ltt_session *session, size_t nb_uri,
-               struct lttng_uri *uris);
+                         enum lttng_domain_type domain,
+                         const char *sock_path,
+                         struct consumer_data *cdata);
+int cmd_set_consumer_uri(struct ltt_session *session, size_t nb_uri, struct lttng_uri *uris);
 int cmd_setup_relayd(struct ltt_session *session);
 
 /* Listing commands */
-ssize_t cmd_list_domains(struct ltt_session *session,
-               struct lttng_domain **domains);
+ssize_t cmd_list_domains(struct ltt_session *session, struct lttng_domain **domains);
 enum lttng_error_code cmd_list_events(enum lttng_domain_type domain,
-               struct ltt_session *session,
-               char *channel_name,
-               struct lttng_payload *payload);
+                                     struct ltt_session *session,
+                                     char *channel_name,
+                                     struct lttng_payload *payload);
 enum lttng_error_code cmd_list_channels(enum lttng_domain_type domain,
-               struct ltt_session *session,
-               struct lttng_payload *payload);
+                                       struct ltt_session *session,
+                                       struct lttng_payload *payload);
 void cmd_list_lttng_sessions(struct lttng_session *sessions,
-               size_t session_count, uid_t uid, gid_t gid);
+                            size_t session_count,
+                            uid_t uid,
+                            gid_t gid);
 enum lttng_error_code cmd_list_tracepoint_fields(enum lttng_domain_type domain,
-               struct lttng_payload *reply);
+                                                struct lttng_payload *reply);
 enum lttng_error_code cmd_list_tracepoints(enum lttng_domain_type domain,
-               struct lttng_payload *reply_payload);
+                                          struct lttng_payload *reply_payload);
 ssize_t cmd_snapshot_list_outputs(struct ltt_session *session,
-               struct lttng_snapshot_output **outputs);
-enum lttng_error_code cmd_list_syscalls(
-               struct lttng_payload *reply_payload);
+                                 struct lttng_snapshot_output **outputs);
+enum lttng_error_code cmd_list_syscalls(struct lttng_payload *reply_payload);
 
 int cmd_data_pending(struct ltt_session *session);
 
 /* Snapshot */
 int cmd_snapshot_add_output(struct ltt_session *session,
-               const struct lttng_snapshot_output *output, uint32_t *id);
+                           const struct lttng_snapshot_output *output,
+                           uint32_t *id);
 int cmd_snapshot_del_output(struct ltt_session *session,
-               const struct lttng_snapshot_output *output);
+                           const struct lttng_snapshot_output *output);
 int cmd_snapshot_record(struct ltt_session *session,
-               const struct lttng_snapshot_output *output, int wait);
+                       const struct lttng_snapshot_output *output,
+                       int wait);
 
-int cmd_set_session_shm_path(struct ltt_session *session,
-               const char *shm_path);
+int cmd_set_session_shm_path(struct ltt_session *session, const char *shm_path);
 int cmd_regenerate_metadata(struct ltt_session *session);
 int cmd_regenerate_statedump(struct ltt_session *session);
 
-enum lttng_error_code cmd_register_trigger(
-               const struct lttng_credentials *cmd_creds,
-               struct lttng_trigger *trigger,
-               bool is_anonymous_trigger,
-               struct notification_thread_handle *notification_thread_handle,
-               struct lttng_trigger **return_trigger);
-enum lttng_error_code cmd_unregister_trigger(
-               const struct lttng_credentials *cmd_creds,
-               const struct lttng_trigger *trigger,
-               struct notification_thread_handle *notification_thread_handle);
-
-enum lttng_error_code cmd_list_triggers(struct command_ctx *cmd_ctx,
-               struct notification_thread_handle *notification_thread_handle,
-               struct lttng_triggers **return_triggers);
-enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cmd_creds,
-               const struct lttng_error_query *query,
-               struct lttng_error_query_results **_results,
-               struct notification_thread_handle *notification_thread);
+enum lttng_error_code
+cmd_register_trigger(const struct lttng_credentials *cmd_creds,
+                    struct lttng_trigger *trigger,
+                    bool is_anonymous_trigger,
+                    struct notification_thread_handle *notification_thread_handle,
+                    struct lttng_trigger **return_trigger);
+enum lttng_error_code
+cmd_unregister_trigger(const struct lttng_credentials *cmd_creds,
+                      const struct lttng_trigger *trigger,
+                      struct notification_thread_handle *notification_thread_handle);
+
+enum lttng_error_code
+cmd_list_triggers(struct command_ctx *cmd_ctx,
+                 struct notification_thread_handle *notification_thread_handle,
+                 struct lttng_triggers **return_triggers);
+enum lttng_error_code
+cmd_execute_error_query(const struct lttng_credentials *cmd_creds,
+                       const struct lttng_error_query *query,
+                       struct lttng_error_query_results **_results,
+                       struct notification_thread_handle *notification_thread);
 
 int cmd_rotate_session(struct ltt_session *session,
-               struct lttng_rotate_session_return *rotate_return,
-               bool quiet_rotation,
-               enum lttng_trace_chunk_command_type command);
+                      struct lttng_rotate_session_return *rotate_return,
+                      bool quiet_rotation,
+                      enum lttng_trace_chunk_command_type command);
 int cmd_rotate_get_info(struct ltt_session *session,
-               struct lttng_rotation_get_info_return *info_return,
-               uint64_t rotate_id);
+                       struct lttng_rotation_get_info_return *info_return,
+                       uint64_t rotate_id);
 int cmd_rotation_set_schedule(struct ltt_session *session,
-               bool activate, enum lttng_rotation_schedule_type schedule_type,
-               uint64_t value);
+                             bool activate,
+                             enum lttng_rotation_schedule_type schedule_type,
+                             uint64_t value);
 
 const struct cmd_completion_handler *cmd_pop_completion_handler(void);
 int start_kernel_session(struct ltt_kernel_session *ksess);
index 49a074952a5bed638661adcf6e8e579aee500b91..23d2c229e0e831352eeedd13449b7b2341e93fb9 100644 (file)
@@ -17,7 +17,6 @@
  */
 unsigned long lttng_condition_hash(const struct lttng_condition *condition);
 
-struct lttng_condition *lttng_condition_copy(
-               const struct lttng_condition *condition);
+struct lttng_condition *lttng_condition_copy(const struct lttng_condition *condition);
 
 #endif /* LTTNG_SESSIOND_CONDITION_INTERNAL_H */
index 6875360e6089d06b870bae7d7a82f27607257e97..6c334875b26012650169d71d30dda47e2bb73926 100644 (file)
@@ -8,13 +8,15 @@
 #ifndef _CONSUMER_H
 #define _CONSUMER_H
 
+#include "snapshot.hpp"
+
 #include <common/consumer/consumer.hpp>
 #include <common/hashtable/hashtable.hpp>
+
 #include <lttng/lttng.h>
-#include <urcu/ref.h>
-#include <algorithm>
 
-#include "snapshot.hpp"
+#include <algorithm>
+#include <urcu/ref.h>
 
 struct snapshot;
 struct snapshot_output;
@@ -75,9 +77,9 @@ struct consumer_socket {
 };
 
 struct consumer_data {
-       explicit consumer_data (lttng_consumer_type type_)
-               : type(type_)
-       {}
+       explicit consumer_data(lttng_consumer_type type_) : type(type_)
+       {
+       }
 
        enum lttng_consumer_type type;
 
@@ -144,7 +146,7 @@ struct consumer_net {
  * Consumer output object describing where and how to send data.
  */
 struct consumer_output {
-       struct urcu_ref ref;    /* Refcount */
+       struct urcu_ref ref; /* Refcount */
 
        /* If the consumer is enabled meaning that should be used */
        bool enabled;
@@ -167,9 +169,8 @@ struct consumer_output {
         * Subdirectory path name used for both local and network
         * consumer ("kernel", "ust", or empty).
         */
-       char domain_subdir[
-               max_constexpr(sizeof(DEFAULT_KERNEL_TRACE_DIR),
-                       sizeof(DEFAULT_UST_TRACE_DIR))];
+       char domain_subdir[max_constexpr(sizeof(DEFAULT_KERNEL_TRACE_DIR),
+                                        sizeof(DEFAULT_UST_TRACE_DIR))];
 
        /*
         * Hashtable of consumer_socket index by the file descriptor value. For
@@ -193,152 +194,161 @@ struct consumer_output {
        char chunk_path[LTTNG_PATH_MAX];
 };
 
-struct consumer_socket *consumer_find_socket(int key,
-               const struct consumer_output *consumer);
+struct consumer_socket *consumer_find_socket(int key, const struct consumer_output *consumer);
 struct consumer_socket *consumer_find_socket_by_bitness(int bits,
-               const struct consumer_output *consumer);
+                                                       const struct consumer_output *consumer);
 struct consumer_socket *consumer_allocate_socket(int *fd);
-void consumer_add_socket(struct consumer_socket *sock,
-               struct consumer_output *consumer);
-void consumer_del_socket(struct consumer_socket *sock,
-               struct consumer_output *consumer);
+void consumer_add_socket(struct consumer_socket *sock, struct consumer_output *consumer);
+void consumer_del_socket(struct consumer_socket *sock, struct consumer_output *consumer);
 void consumer_destroy_socket(struct consumer_socket *sock);
-int consumer_copy_sockets(struct consumer_output *dst,
-               struct consumer_output *src);
+int consumer_copy_sockets(struct consumer_output *dst, struct consumer_output *src);
 void consumer_destroy_output_sockets(struct consumer_output *obj);
-int consumer_socket_send(struct consumer_socket *socket, const void *msg,
-               size_t len);
-int consumer_socket_recv(struct consumer_socket *socket, void *msg,
-               size_t len);
+int consumer_socket_send(struct consumer_socket *socket, const void *msg, size_t len);
+int consumer_socket_recv(struct consumer_socket *socket, void *msg, size_t len);
 
 struct consumer_output *consumer_create_output(enum consumer_dst_type type);
 struct consumer_output *consumer_copy_output(struct consumer_output *obj);
 void consumer_output_get(struct consumer_output *obj);
 void consumer_output_put(struct consumer_output *obj);
 int consumer_set_network_uri(const struct ltt_session *session,
-               struct consumer_output *obj,
-               struct lttng_uri *uri);
-int consumer_send_fds(struct consumer_socket *sock, const int *fds,
-               size_t nb_fd);
-int consumer_send_msg(struct consumer_socket *sock,
-               const struct lttcomm_consumer_msg *msg);
+                            struct consumer_output *obj,
+                            struct lttng_uri *uri);
+int consumer_send_fds(struct consumer_socket *sock, const int *fds, size_t nb_fd);
+int consumer_send_msg(struct consumer_socket *sock, const struct lttcomm_consumer_msg *msg);
 int consumer_send_stream(struct consumer_socket *sock,
-               struct consumer_output *dst, struct lttcomm_consumer_msg *msg,
-               const int *fds, size_t nb_fd);
-int consumer_send_channel(struct consumer_socket *sock,
-               struct lttcomm_consumer_msg *msg);
+                        struct consumer_output *dst,
+                        struct lttcomm_consumer_msg *msg,
+                        const int *fds,
+                        size_t nb_fd);
+int consumer_send_channel(struct consumer_socket *sock, struct lttcomm_consumer_msg *msg);
 int consumer_send_relayd_socket(struct consumer_socket *consumer_sock,
-               struct lttcomm_relayd_sock *rsock, struct consumer_output *consumer,
-               enum lttng_stream_type type, uint64_t session_id,
-               const char *session_name, const char *hostname,
-               const char *base_path, int session_live_timer,
-               const uint64_t *current_chunk_id, time_t session_creation_time,
-               bool session_name_contains_creation_time);
-int consumer_send_channel_monitor_pipe(struct consumer_socket *consumer_sock,
-               int pipe);
-int consumer_send_destroy_relayd(struct consumer_socket *sock,
-               struct consumer_output *consumer);
+                               struct lttcomm_relayd_sock *rsock,
+                               struct consumer_output *consumer,
+                               enum lttng_stream_type type,
+                               uint64_t session_id,
+                               const char *session_name,
+                               const char *hostname,
+                               const char *base_path,
+                               int session_live_timer,
+                               const uint64_t *current_chunk_id,
+                               time_t session_creation_time,
+                               bool session_name_contains_creation_time);
+int consumer_send_channel_monitor_pipe(struct consumer_socket *consumer_sock, int pipe);
+int consumer_send_destroy_relayd(struct consumer_socket *sock, struct consumer_output *consumer);
 int consumer_recv_status_reply(struct consumer_socket *sock);
 int consumer_recv_status_channel(struct consumer_socket *sock,
-               uint64_t *key, unsigned int *stream_count);
+                                uint64_t *key,
+                                unsigned int *stream_count);
 void consumer_output_send_destroy_relayd(struct consumer_output *consumer);
-int consumer_create_socket(struct consumer_data *data,
-               struct consumer_output *output);
+int consumer_create_socket(struct consumer_data *data, struct consumer_output *output);
 
 void consumer_init_ask_channel_comm_msg(struct lttcomm_consumer_msg *msg,
-               uint64_t subbuf_size,
-               uint64_t num_subbuf,
-               int overwrite,
-               unsigned int switch_timer_interval,
-               unsigned int read_timer_interval,
-               unsigned int live_timer_interval,
-               bool is_in_live_session,
-               unsigned int monitor_timer_interval,
-               int output,
-               int type,
-               uint64_t session_id,
-               const char *pathname,
-               const char *name,
-               uint64_t relayd_id,
-               uint64_t key,
-               const lttng_uuid& uuid,
-               uint32_t chan_id,
-               uint64_t tracefile_size,
-               uint64_t tracefile_count,
-               uint64_t session_id_per_pid,
-               unsigned int monitor,
-               uint32_t ust_app_uid,
-               int64_t blocking_timeout,
-               const char *root_shm_path,
-               const char *shm_path,
-               struct lttng_trace_chunk *trace_chunk,
-               const struct lttng_credentials *buffer_credentials);
+                                       uint64_t subbuf_size,
+                                       uint64_t num_subbuf,
+                                       int overwrite,
+                                       unsigned int switch_timer_interval,
+                                       unsigned int read_timer_interval,
+                                       unsigned int live_timer_interval,
+                                       bool is_in_live_session,
+                                       unsigned int monitor_timer_interval,
+                                       int output,
+                                       int type,
+                                       uint64_t session_id,
+                                       const char *pathname,
+                                       const char *name,
+                                       uint64_t relayd_id,
+                                       uint64_t key,
+                                       const lttng_uuid& uuid,
+                                       uint32_t chan_id,
+                                       uint64_t tracefile_size,
+                                       uint64_t tracefile_count,
+                                       uint64_t session_id_per_pid,
+                                       unsigned int monitor,
+                                       uint32_t ust_app_uid,
+                                       int64_t blocking_timeout,
+                                       const char *root_shm_path,
+                                       const char *shm_path,
+                                       struct lttng_trace_chunk *trace_chunk,
+                                       const struct lttng_credentials *buffer_credentials);
 void consumer_init_add_stream_comm_msg(struct lttcomm_consumer_msg *msg,
-               uint64_t channel_key,
-               uint64_t stream_key,
-               int32_t cpu);
+                                      uint64_t channel_key,
+                                      uint64_t stream_key,
+                                      int32_t cpu);
 void consumer_init_streams_sent_comm_msg(struct lttcomm_consumer_msg *msg,
-               enum lttng_consumer_command cmd,
-               uint64_t channel_key, uint64_t net_seq_idx);
+                                        enum lttng_consumer_command cmd,
+                                        uint64_t channel_key,
+                                        uint64_t net_seq_idx);
 void consumer_init_add_channel_comm_msg(struct lttcomm_consumer_msg *msg,
-               uint64_t channel_key,
-               uint64_t session_id,
-               const char *pathname,
-               uint64_t relayd_id,
-               const char *name,
-               unsigned int nb_init_streams,
-               enum lttng_event_output output,
-               int type,
-               uint64_t tracefile_size,
-               uint64_t tracefile_count,
-               unsigned int monitor,
-               unsigned int live_timer_interval,
-               bool is_in_live_session,
-               unsigned int monitor_timer_interval,
-               struct lttng_trace_chunk *trace_chunk);
-int consumer_is_data_pending(uint64_t session_id,
-               struct consumer_output *consumer);
-int consumer_close_metadata(struct consumer_socket *socket,
-               uint64_t metadata_key);
-int consumer_setup_metadata(struct consumer_socket *socket,
-               uint64_t metadata_key);
+                                       uint64_t channel_key,
+                                       uint64_t session_id,
+                                       const char *pathname,
+                                       uint64_t relayd_id,
+                                       const char *name,
+                                       unsigned int nb_init_streams,
+                                       enum lttng_event_output output,
+                                       int type,
+                                       uint64_t tracefile_size,
+                                       uint64_t tracefile_count,
+                                       unsigned int monitor,
+                                       unsigned int live_timer_interval,
+                                       bool is_in_live_session,
+                                       unsigned int monitor_timer_interval,
+                                       struct lttng_trace_chunk *trace_chunk);
+int consumer_is_data_pending(uint64_t session_id, struct consumer_output *consumer);
+int consumer_close_metadata(struct consumer_socket *socket, uint64_t metadata_key);
+int consumer_setup_metadata(struct consumer_socket *socket, uint64_t metadata_key);
 int consumer_push_metadata(struct consumer_socket *socket,
-               uint64_t metadata_key, char *metadata_str, size_t len,
-               size_t target_offset, uint64_t version);
+                          uint64_t metadata_key,
+                          char *metadata_str,
+                          size_t len,
+                          size_t target_offset,
+                          uint64_t version);
 int consumer_flush_channel(struct consumer_socket *socket, uint64_t key);
 int consumer_clear_quiescent_channel(struct consumer_socket *socket, uint64_t key);
-int consumer_get_discarded_events(uint64_t session_id, uint64_t channel_key,
-               struct consumer_output *consumer, uint64_t *discarded);
-int consumer_get_lost_packets(uint64_t session_id, uint64_t channel_key,
-               struct consumer_output *consumer, uint64_t *lost);
+int consumer_get_discarded_events(uint64_t session_id,
+                                 uint64_t channel_key,
+                                 struct consumer_output *consumer,
+                                 uint64_t *discarded);
+int consumer_get_lost_packets(uint64_t session_id,
+                             uint64_t channel_key,
+                             struct consumer_output *consumer,
+                             uint64_t *lost);
 
 /* Snapshot command. */
 enum lttng_error_code consumer_snapshot_channel(struct consumer_socket *socket,
-               uint64_t key, const struct consumer_output *output, int metadata,
-               const char *channel_path, uint64_t nb_packets_per_stream);
+                                               uint64_t key,
+                                               const struct consumer_output *output,
+                                               int metadata,
+                                               const char *channel_path,
+                                               uint64_t nb_packets_per_stream);
 
 /* Rotation commands. */
-int consumer_rotate_channel(struct consumer_socket *socket, uint64_t key,
-               struct consumer_output *output, bool is_metadata_channel);
-int consumer_init(struct consumer_socket *socket,
-               const lttng_uuid& sessiond_uuid);
+int consumer_rotate_channel(struct consumer_socket *socket,
+                           uint64_t key,
+                           struct consumer_output *output,
+                           bool is_metadata_channel);
+int consumer_init(struct consumer_socket *socket, const lttng_uuid& sessiond_uuid);
 
 int consumer_create_trace_chunk(struct consumer_socket *socket,
-               uint64_t relayd_id, uint64_t session_id,
-               struct lttng_trace_chunk *chunk,
-               const char *domain_subdir);
+                               uint64_t relayd_id,
+                               uint64_t session_id,
+                               struct lttng_trace_chunk *chunk,
+                               const char *domain_subdir);
 int consumer_close_trace_chunk(struct consumer_socket *socket,
-               uint64_t relayd_id, uint64_t session_id,
-               struct lttng_trace_chunk *chunk,
-               char *closed_trace_chunk_path);
+                              uint64_t relayd_id,
+                              uint64_t session_id,
+                              struct lttng_trace_chunk *chunk,
+                              char *closed_trace_chunk_path);
 int consumer_trace_chunk_exists(struct consumer_socket *socket,
-               uint64_t relayd_id, uint64_t session_id,
-               struct lttng_trace_chunk *chunk,
-               enum consumer_trace_chunk_exists_status *result);
+                               uint64_t relayd_id,
+                               uint64_t session_id,
+                               struct lttng_trace_chunk *chunk,
+                               enum consumer_trace_chunk_exists_status *result);
 int consumer_open_channel_packets(struct consumer_socket *socket, uint64_t key);
 
 char *setup_channel_trace_path(struct consumer_output *consumer,
-               const char *session_path, size_t *consumer_path_offset);
+                              const char *session_path,
+                              size_t *consumer_path_offset);
 
 /* Clear command */
 int consumer_clear_channel(struct consumer_socket *socket, uint64_t key);
index a55f571161d9f14d6aaa26b2d9194ce49e5a0c27..4a9653333d5bc8914b9c91af2cfdf41fda635020 100644 (file)
@@ -8,18 +8,18 @@
 #ifndef _LTT_CONTEXT_H
 #define _LTT_CONTEXT_H
 
-#include <lttng/lttng.h>
-
+#include "lttng-ust-ctl.hpp"
 #include "trace-kernel.hpp"
 #include "trace-ust.hpp"
-#include "lttng-ust-ctl.hpp"
+
+#include <lttng/lttng.h>
 
 int context_kernel_add(struct ltt_kernel_session *ksession,
-               const struct lttng_event_context *ctx,
-               const char *channel_name);
+                      const struct lttng_event_context *ctx,
+                      const char *channel_name);
 int context_ust_add(struct ltt_ust_session *usess,
-               enum lttng_domain_type domain,
-               const struct lttng_event_context *ctx,
-               const char *channel_name);
+                   enum lttng_domain_type domain,
+                   const struct lttng_event_context *ctx,
+                   const char *channel_name);
 
 #endif /* _LTT_CONTEXT_H */
index b709a029465ee695450ccf0f4fef53612f01ae76..a46cc8bcbd845abe3e7e7be9862c6c31d894d9ca 100644 (file)
@@ -8,12 +8,12 @@
 #ifndef LTTNG_CTF2_TRACE_CLASS_VISITOR_H
 #define LTTNG_CTF2_TRACE_CLASS_VISITOR_H
 
-#include "trace-class.hpp"
-#include "stream-class.hpp"
 #include "event-class.hpp"
+#include "stream-class.hpp"
+#include "trace-class.hpp"
 
-#include <vendor/optional.hpp>
 #include <vendor/nlohmann/json.hpp>
+#include <vendor/optional.hpp>
 
 #include <functional>
 
index d5ec8c9c32ca27702fe92a8442edeb33afff4c00..d3e57368a092095429a30a3dba3ed1165f48ce95 100644 (file)
 #ifndef SESSIOND_UST_DISPATCH_THREAD_H
 #define SESSIOND_UST_DISPATCH_THREAD_H
 
-#include <stdbool.h>
 #include "lttng-sessiond.hpp"
 
+#include <stdbool.h>
+
 bool launch_ust_dispatch_thread(struct ust_cmd_queue *cmd_queue,
-               int apps_cmd_pipe_write_fd,
-               int apps_cmd_notify_write_fd);
+                               int apps_cmd_pipe_write_fd,
+                               int apps_cmd_notify_write_fd);
 
 #endif /* SESSIOND_UST_DISPATCH_THREAD_H */
index 2a5e63e62dd524fe98315565318c91bd1c0c6c5c..81b27f8d0447145b944eafa563cee776b5f4de14 100644 (file)
@@ -11,6 +11,7 @@
 #include "field.hpp"
 
 #include <common/uuid.hpp>
+
 #include <vendor/optional.hpp>
 
 #include <string>
@@ -40,11 +41,11 @@ public:
 
 protected:
        event_class(unsigned int id,
-                       unsigned int stream_class_id,
-                       int log_level,
-                       std::string name,
-                       nonstd::optional<std::string> model_emf_uri,
-                       lttng::sessiond::trace::type::cuptr payload);
+                   unsigned int stream_class_id,
+                   int log_level,
+                   std::string name,
+                   nonstd::optional<std::string> model_emf_uri,
+                   lttng::sessiond::trace::type::cuptr payload);
 };
 
 } /* namespace trace */
index 89466bd441605bf9b1336e289b92ac10b2105843..e1d445333ea97a3de8559425013ab0cd700656c9 100644 (file)
@@ -8,11 +8,11 @@
 #ifndef _EVENT_NOTIFIER_ERROR_ACCOUNTING_H
 #define _EVENT_NOTIFIER_ERROR_ACCOUNTING_H
 
-#include <stdint.h>
+#include "ust-app.hpp"
 
 #include <lttng/trigger/trigger.h>
 
-#include "ust-app.hpp"
+#include <stdint.h>
 
 enum event_notifier_error_accounting_status {
        EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK,
@@ -30,16 +30,14 @@ enum event_notifier_error_accounting_status {
  * to be allocated for each domain.
  */
 enum event_notifier_error_accounting_status
-event_notifier_error_accounting_init(uint64_t buffer_size_kernel,
-               uint64_t buffer_size_ust);
+event_notifier_error_accounting_init(uint64_t buffer_size_kernel, uint64_t buffer_size_ust);
 
 /*
  * Register the kernel event notifier group.
  * This allocates the counter object on the kernel side.
  */
 enum event_notifier_error_accounting_status
-event_notifier_error_accounting_register_kernel(
-               int kernel_event_notifier_group_fd);
+event_notifier_error_accounting_register_kernel(int kernel_event_notifier_group_fd);
 
 #ifdef HAVE_LIBLTTNG_UST_CTL
 
@@ -59,18 +57,14 @@ event_notifier_error_accounting_unregister_app(struct ust_app *app);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline
-enum event_notifier_error_accounting_status
-event_notifier_error_accounting_register_app(
-               struct ust_app *app __attribute__((unused)))
+static inline enum event_notifier_error_accounting_status
+event_notifier_error_accounting_register_app(struct ust_app *app __attribute__((unused)))
 {
        return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
 }
 
-static inline
-enum event_notifier_error_accounting_status
-event_notifier_error_accounting_unregister_app(
-               struct ust_app *app __attribute__((unused)))
+static inline enum event_notifier_error_accounting_status
+event_notifier_error_accounting_unregister_app(struct ust_app *app __attribute__((unused)))
 {
        return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
 }
@@ -80,17 +74,13 @@ event_notifier_error_accounting_unregister_app(
  * Allocates, reserves and returns the error counter index for that trigger.
  */
 enum event_notifier_error_accounting_status
-event_notifier_error_accounting_register_event_notifier(
-               const struct lttng_trigger *trigger,
-               uint64_t *error_counter_index);
+event_notifier_error_accounting_register_event_notifier(const struct lttng_trigger *trigger,
+                                                       uint64_t *error_counter_index);
 
 enum event_notifier_error_accounting_status
-event_notifier_error_accounting_get_count(
-               const struct lttng_trigger *trigger,
-               uint64_t *count);
+event_notifier_error_accounting_get_count(const struct lttng_trigger *trigger, uint64_t *count);
 
-void event_notifier_error_accounting_unregister_event_notifier(
-               const struct lttng_trigger *trigger);
+void event_notifier_error_accounting_unregister_event_notifier(const struct lttng_trigger *trigger);
 
 void event_notifier_error_accounting_fini(void);
 
index 367c4944553c56ad15f53b26830b1deee16c9535..462ed2f0db588fdd1ad37debd9bf6d2609ef079c 100644 (file)
@@ -326,7 +326,6 @@ int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, struct ltt_
        LTTNG_ASSERT(usess);
        LTTNG_ASSERT(uchan);
 
-
        /* Disabling existing events */
        {
                lttng::urcu::read_lock_guard read_lock;
index efc4ad5d07b3547197542551e5c3ae6244dd1c0e..efd72f4ccd14f037d7dbd7c12bb97f907a9a3b39 100644 (file)
 struct agent;
 
 int event_kernel_disable_event(struct ltt_kernel_channel *kchan,
-               const char *event_name, enum lttng_event_type event_type);
+                              const char *event_name,
+                              enum lttng_event_type event_type);
 
 int event_kernel_enable_event(struct ltt_kernel_channel *kchan,
-               struct lttng_event *event, char *filter_expression,
-               struct lttng_bytecode *filter);
+                             struct lttng_event *event,
+                             char *filter_expression,
+                             struct lttng_bytecode *filter);
 
 int event_ust_enable_tracepoint(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan, struct lttng_event *event,
-               char *filter_expression,
-               struct lttng_bytecode *filter,
-               struct lttng_event_exclusion *exclusion,
-               bool internal_event);
+                               struct ltt_ust_channel *uchan,
+                               struct lttng_event *event,
+                               char *filter_expression,
+                               struct lttng_bytecode *filter,
+                               struct lttng_event_exclusion *exclusion,
+                               bool internal_event);
 int event_ust_disable_tracepoint(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan, const char *event_name);
-
-int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan);
-
-int event_agent_enable(struct ltt_ust_session *usess, struct agent *agt,
-               struct lttng_event *event, struct lttng_bytecode *filter,
-               char *filter_expression);
-int event_agent_enable_all(struct ltt_ust_session *usess, struct agent *agt,
-               struct lttng_event *event, struct lttng_bytecode *filter,
-               char *filter_expression);
-
-int event_agent_disable(struct ltt_ust_session *usess, struct agent *agt,
-               const char *event_name);
+                                struct ltt_ust_channel *uchan,
+                                const char *event_name);
+
+int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan);
+
+int event_agent_enable(struct ltt_ust_session *usess,
+                      struct agent *agt,
+                      struct lttng_event *event,
+                      struct lttng_bytecode *filter,
+                      char *filter_expression);
+int event_agent_enable_all(struct ltt_ust_session *usess,
+                          struct agent *agt,
+                          struct lttng_event *event,
+                          struct lttng_bytecode *filter,
+                          char *filter_expression);
+
+int event_agent_disable(struct ltt_ust_session *usess, struct agent *agt, const char *event_name);
 int event_agent_disable_all(struct ltt_ust_session *usess, struct agent *agt);
 
-int trigger_agent_enable(
-               const struct lttng_trigger *trigger, struct agent *agt);
-int trigger_agent_disable(
-               const struct lttng_trigger *trigger, struct agent *agt);
+int trigger_agent_enable(const struct lttng_trigger *trigger, struct agent *agt);
+int trigger_agent_disable(const struct lttng_trigger *trigger, struct agent *agt);
 
 const char *event_get_default_agent_ust_name(enum lttng_domain_type domain);
 
index dc418b661bd1344049141b9dd39d825244ed0615..8ba85d81a9efc2ed5bd2bb72808a0b54cea4947a 100644 (file)
@@ -137,11 +137,11 @@ public:
        using roles = std::vector<role>;
 
        integer_type(unsigned int alignment,
-                       byte_order byte_order,
-                       unsigned int size,
-                       signedness signedness,
-                       base base,
-                       roles roles = {});
+                    byte_order byte_order,
+                    unsigned int size,
+                    signedness signedness,
+                    base base,
+                    roles roles = {});
 
        type::cuptr copy() const override;
 
@@ -165,9 +165,9 @@ protected:
 class floating_point_type : public type {
 public:
        floating_point_type(unsigned int alignment,
-                       byte_order byte_order,
-                       unsigned int exponent_digits,
-                       unsigned int mantissa_digits);
+                           byte_order byte_order,
+                           unsigned int exponent_digits,
+                           unsigned int mantissa_digits);
 
        type::cuptr copy() const final;
 
@@ -207,7 +207,7 @@ public:
        using range_integer_t = MappingIntegerType;
 
        enumeration_mapping_range(MappingIntegerType in_begin, MappingIntegerType in_end) :
-               begin{in_begin}, end{in_end}
+               begin{ in_begin }, end{ in_end }
        {
        }
 
@@ -270,31 +270,31 @@ public:
        using mappings = std::vector<mapping>;
 
        static_assert(std::is_integral<MappingIntegerType>::value &&
-                                       sizeof(MappingIntegerType) == 8,
-                       "MappingIntegerType must be either int64_t or uint64_t");
+                             sizeof(MappingIntegerType) == 8,
+                     "MappingIntegerType must be either int64_t or uint64_t");
 
        typed_enumeration_type(unsigned int in_alignment,
-                       enum byte_order in_byte_order,
-                       unsigned int in_size,
-                       enum base in_base,
-                       const std::shared_ptr<const mappings>& in_mappings,
-                       integer_type::roles in_roles = {}) :
+                              enum byte_order in_byte_order,
+                              unsigned int in_size,
+                              enum base in_base,
+                              const std::shared_ptr<const mappings>& in_mappings,
+                              integer_type::roles in_roles = {}) :
                enumeration_type(in_alignment,
-                               in_byte_order,
-                               in_size,
-                               std::is_signed<MappingIntegerType>::value ?
-                                               integer_type::signedness::SIGNED :
-                                                     integer_type::signedness::UNSIGNED,
-                               in_base,
-                               std::move(in_roles)),
-               mappings_{std::move(in_mappings)}
+                                in_byte_order,
+                                in_size,
+                                std::is_signed<MappingIntegerType>::value ?
+                                        integer_type::signedness::SIGNED :
+                                        integer_type::signedness::UNSIGNED,
+                                in_base,
+                                std::move(in_roles)),
+               mappings_{ std::move(in_mappings) }
        {
        }
 
        type::cuptr copy() const override
        {
                return lttng::make_unique<typed_enumeration_type<MappingIntegerType>>(
-                               alignment, byte_order, size, base_, mappings_, roles_);
+                       alignment, byte_order, size, base_, mappings_, roles_);
        }
 
        void accept(type_visitor& visitor) const final;
@@ -304,8 +304,8 @@ public:
 private:
        bool _is_equal(const type& base_other) const noexcept final
        {
-               const auto& other = static_cast<const typed_enumeration_type<MappingIntegerType>&>(
-                               base_other);
+               const auto& other =
+                       static_cast<const typed_enumeration_type<MappingIntegerType>&>(base_other);
 
                return integer_type::_is_equal(base_other) && *this->mappings_ == *other.mappings_;
        }
@@ -328,8 +328,8 @@ protected:
 class static_length_array_type : public array_type {
 public:
        static_length_array_type(unsigned int alignment,
-                       type::cuptr element_type,
-                       uint64_t in_length);
+                                type::cuptr element_type,
+                                uint64_t in_length);
 
        type::cuptr copy() const final;
 
@@ -344,8 +344,8 @@ private:
 class dynamic_length_array_type : public array_type {
 public:
        dynamic_length_array_type(unsigned int alignment,
-                       type::cuptr element_type,
-                       field_location length_field_location);
+                                 type::cuptr element_type,
+                                 field_location length_field_location);
 
        type::cuptr copy() const final;
 
@@ -415,8 +415,9 @@ protected:
 
 class static_length_string_type : public string_type {
 public:
-       static_length_string_type(
-                       unsigned int alignment, enum encoding in_encoding, uint64_t length);
+       static_length_string_type(unsigned int alignment,
+                                 enum encoding in_encoding,
+                                 uint64_t length);
 
        type::cuptr copy() const final;
 
@@ -431,8 +432,8 @@ private:
 class dynamic_length_string_type : public string_type {
 public:
        dynamic_length_string_type(unsigned int alignment,
-                       enum encoding in_encoding,
-                       field_location length_field_location);
+                                  enum encoding in_encoding,
+                                  field_location length_field_location);
 
        type::cuptr copy() const final;
 
@@ -471,24 +472,25 @@ private:
 
 template <typename MappingIntegerType>
 class variant_type : public type {
-       static_assert(std::is_same<MappingIntegerType,
-                                       unsigned_enumeration_type::mapping::range_t::
-                                                       range_integer_t>::value ||
-                                       std::is_same<MappingIntegerType,
-                                                       signed_enumeration_type::mapping::range_t::
-                                                                       range_integer_t>::value,
-                       "Variant mapping integer type must be one of those allowed by typed_enumeration_type");
+       static_assert(
+               std::is_same<MappingIntegerType,
+                            unsigned_enumeration_type::mapping::range_t::range_integer_t>::value ||
+                       std::is_same<
+                               MappingIntegerType,
+                               signed_enumeration_type::mapping::range_t::range_integer_t>::value,
+               "Variant mapping integer type must be one of those allowed by typed_enumeration_type");
 
 public:
-       using choice = std::pair<const details::enumeration_mapping<MappingIntegerType>, type::cuptr>;
+       using choice =
+               std::pair<const details::enumeration_mapping<MappingIntegerType>, type::cuptr>;
        using choices = std::vector<choice>;
 
        variant_type(unsigned int in_alignment,
-                       field_location in_selector_field_location,
-                       choices in_choices) :
+                    field_location in_selector_field_location,
+                    choices in_choices) :
                type(in_alignment),
-               selector_field_location{std::move(in_selector_field_location)},
-               choices_{std::move(in_choices)}
+               selector_field_location{ std::move(in_selector_field_location) },
+               choices_{ std::move(in_choices) }
        {
        }
 
@@ -498,8 +500,8 @@ public:
 
                copy_of_choices.reserve(choices_.size());
                for (const auto& current_choice : choices_) {
-                       copy_of_choices.emplace_back(
-                                       current_choice.first, current_choice.second->copy());
+                       copy_of_choices.emplace_back(current_choice.first,
+                                                    current_choice.second->copy());
                }
 
                return lttng::make_unique<variant_type<MappingIntegerType>>(
@@ -518,11 +520,13 @@ private:
                        return false;
                }
 
-               return std::equal(a.cbegin(), a.cend(), b.cbegin(),
-                               [](const choice& choice_a, const choice& choice_b) {
-                                       return choice_a.first == choice_b.first &&
-                                               *choice_a.second == *choice_b.second;
-                               });
+               return std::equal(a.cbegin(),
+                                 a.cend(),
+                                 b.cbegin(),
+                                 [](const choice& choice_a, const choice& choice_b) {
+                                         return choice_a.first == choice_b.first &&
+                                                 *choice_a.second == *choice_b.second;
+                                 });
        }
 
        bool _is_equal(const type& base_other) const noexcept final
@@ -530,7 +534,7 @@ private:
                const auto& other = static_cast<decltype(*this)&>(base_other);
 
                return selector_field_location == other.selector_field_location &&
-                               _choices_are_equal(choices_, other.choices_);
+                       _choices_are_equal(choices_, other.choices_);
        }
 };
 
@@ -568,8 +572,12 @@ public:
        virtual void visit(const static_length_string_type& type) = 0;
        virtual void visit(const dynamic_length_string_type& type) = 0;
        virtual void visit(const structure_type& type) = 0;
-       virtual void visit(const variant_type<signed_enumeration_type::mapping::range_t::range_integer_t>& type) = 0;
-       virtual void visit(const variant_type<unsigned_enumeration_type::mapping::range_t::range_integer_t>& type) = 0;
+       virtual void
+       visit(const variant_type<signed_enumeration_type::mapping::range_t::range_integer_t>&
+                     type) = 0;
+       virtual void
+       visit(const variant_type<unsigned_enumeration_type::mapping::range_t::range_integer_t>&
+                     type) = 0;
 
 protected:
        type_visitor() = default;
@@ -589,10 +597,10 @@ namespace fmt {
 template <>
 struct formatter<lttng::sessiond::trace::field_location> : formatter<std::string> {
        template <typename FormatContextType>
-       typename FormatContextType::iterator format(
-                       const lttng::sessiond::trace::field_location& location, FormatContextType& ctx)
+       typename FormatContextType::iterator
+       format(const lttng::sessiond::trace::field_location& location, FormatContextType& ctx)
        {
-               std::string location_str{"["};
+               std::string location_str{ "[" };
 
                switch (location.root_) {
                case lttng::sessiond::trace::field_location::root::PACKET_HEADER:
@@ -615,7 +623,7 @@ struct formatter<lttng::sessiond::trace::field_location> : formatter<std::string
                        break;
                }
 
-               for (const auto &name : location.elements_) {
+               for (const autoname : location.elements_) {
                        location_str += ", \"" + name + "\"";
                }
 
@@ -627,7 +635,7 @@ struct formatter<lttng::sessiond::trace::field_location> : formatter<std::string
 namespace details {
 template <typename MappingIntegerType>
 ::std::string format_mapping_range(typename lttng::sessiond::trace::typed_enumeration_type<
-               MappingIntegerType>::mapping::range_t range)
+                                  MappingIntegerType>::mapping::range_t range)
 {
        if (range.begin == range.end) {
                return ::fmt::format("[{}]", range.begin);
@@ -643,13 +651,12 @@ struct formatter<typename lttng::sessiond::trace::signed_enumeration_type::mappi
        template <typename FormatContextType>
        typename FormatContextType::iterator
        format(typename lttng::sessiond::trace::signed_enumeration_type::mapping::range_t range,
-                       FormatContextType& ctx)
+              FormatContextType& ctx)
        {
                return format_to(ctx.out(),
-                               details::format_mapping_range<
-                                               lttng::sessiond::trace::signed_enumeration_type::
-                                                               mapping::range_t::range_integer_t>(
-                                               range));
+                                details::format_mapping_range<
+                                        lttng::sessiond::trace::signed_enumeration_type::mapping::
+                                                range_t::range_integer_t>(range));
        }
 };
 
@@ -659,13 +666,12 @@ struct formatter<typename lttng::sessiond::trace::unsigned_enumeration_type::map
        template <typename FormatContextType>
        typename FormatContextType::iterator
        format(typename lttng::sessiond::trace::unsigned_enumeration_type::mapping::range_t range,
-                       FormatContextType& ctx)
+              FormatContextType& ctx)
        {
                return format_to(ctx.out(),
-                               details::format_mapping_range<
-                                               lttng::sessiond::trace::unsigned_enumeration_type::
-                                                               mapping::range_t::range_integer_t>(
-                                               range));
+                                details::format_mapping_range<
+                                        lttng::sessiond::trace::unsigned_enumeration_type::
+                                                mapping::range_t::range_integer_t>(range));
        }
 };
 
index 455cc05d5ee1eea2236a87623e8c5154db77aa1a..453b87e5bb68f2fb9b400724a3062248fb9be701 100644 (file)
@@ -9,20 +9,21 @@
  */
 
 #include <lttng/health-internal.hpp>
+
 #include <stdbool.h>
 
 enum health_type_sessiond {
-       HEALTH_SESSIOND_TYPE_CMD                = 0,
-       HEALTH_SESSIOND_TYPE_APP_MANAGE         = 1,
-       HEALTH_SESSIOND_TYPE_APP_REG            = 2,
-       HEALTH_SESSIOND_TYPE_KERNEL             = 3,
-       HEALTH_SESSIOND_TYPE_CONSUMER           = 4,
-       HEALTH_SESSIOND_TYPE_APP_MANAGE_NOTIFY  = 6,
-       HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH   = 7,
-       HEALTH_SESSIOND_TYPE_NOTIFICATION       = 8,
-       HEALTH_SESSIOND_TYPE_ROTATION           = 9,
-       HEALTH_SESSIOND_TYPE_TIMER              = 10,
-       HEALTH_SESSIOND_TYPE_ACTION_EXECUTOR    = 11,
+       HEALTH_SESSIOND_TYPE_CMD = 0,
+       HEALTH_SESSIOND_TYPE_APP_MANAGE = 1,
+       HEALTH_SESSIOND_TYPE_APP_REG = 2,
+       HEALTH_SESSIOND_TYPE_KERNEL = 3,
+       HEALTH_SESSIOND_TYPE_CONSUMER = 4,
+       HEALTH_SESSIOND_TYPE_APP_MANAGE_NOTIFY = 6,
+       HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH = 7,
+       HEALTH_SESSIOND_TYPE_NOTIFICATION = 8,
+       HEALTH_SESSIOND_TYPE_ROTATION = 9,
+       HEALTH_SESSIOND_TYPE_TIMER = 10,
+       HEALTH_SESSIOND_TYPE_ACTION_EXECUTOR = 11,
 
        NR_HEALTH_SESSIOND_TYPES,
 };
index d91436256cb6903c4efa5b702dc6db161ece17e5..54a642b7441b4bd956f9778b98441f5a461bd3fb 100644 (file)
 /*
  * Compatible lttng-modules version.
  */
-#define KERN_MODULES_PRE_MAJOR     1
-#define KERN_MODULES_PRE_MINOR     9
+#define KERN_MODULES_PRE_MAJOR 1
+#define KERN_MODULES_PRE_MINOR 9
 
-#define KERN_MODULES_MAJOR         2
-#define KERN_MODULES_MINOR         0
+#define KERN_MODULES_MAJOR 2
+#define KERN_MODULES_MINOR 0
 
 enum kernel_module_property_load_policy {
        KERNEL_MODULE_PROPERTY_LOAD_POLICY_REQUIRED = 0,
@@ -24,7 +24,7 @@ enum kernel_module_property_load_policy {
 
 struct kern_modules_param {
        char *name;
-    enum kernel_module_property_load_policy load_policy;
+       enum kernel_module_property_load_policy load_policy;
        bool loaded;
 };
 
index 276312e6c24b5906dad8740ec58d9c6f4ffdba67..9164085676acb2fb3d9678950a46a241d5bceece 100644 (file)
@@ -5,27 +5,29 @@
  *
  */
 
-#include <sys/types.h>
+#include "trace-kernel.hpp"
 
 #include <common/sessiond-comm/sessiond-comm.hpp>
 
-#include "trace-kernel.hpp"
+#include <sys/types.h>
 
 int kernel_consumer_send_channel_streams(struct consumer_socket *sock,
-               struct ltt_kernel_channel *channel, struct ltt_kernel_session *session,
-               unsigned int monitor);
+                                        struct ltt_kernel_channel *channel,
+                                        struct ltt_kernel_session *session,
+                                        unsigned int monitor);
 
-int kernel_consumer_send_session(struct consumer_socket *sock,
-               struct ltt_kernel_session *session);
+int kernel_consumer_send_session(struct consumer_socket *sock, struct ltt_kernel_session *session);
 
 int kernel_consumer_add_metadata(struct consumer_socket *sock,
-               struct ltt_kernel_session *session, unsigned int monitor);
+                                struct ltt_kernel_session *session,
+                                unsigned int monitor);
 
 int kernel_consumer_destroy_channel(struct consumer_socket *socket,
-               struct ltt_kernel_channel *channel);
+                                   struct ltt_kernel_channel *channel);
 
 int kernel_consumer_destroy_metadata(struct consumer_socket *socket,
-               struct ltt_kernel_metadata *metadata);
+                                    struct ltt_kernel_metadata *metadata);
 
 int kernel_consumer_streams_sent(struct consumer_socket *sock,
-               struct ltt_kernel_session *session, uint64_t channel_key);
+                                struct ltt_kernel_session *session,
+                                uint64_t channel_key);
index 2914475d55f2af0ba9052844095db1f372939214..24c3180d5eabcb05310dfbca4d3ea2207674f91e 100644 (file)
@@ -86,7 +86,7 @@ static inline uint64_t sanitize_uprobe_offset(uint64_t raw_offset)
        return raw_offset;
 }
 #endif
-}
+} /* namespace */
 
 /*
  * Add context on a kernel channel.
index bb01651213dfd211dd75ba459e70f59f9c91916c..6024f611c8005627c9e1df4f07b4f5f7c2747509 100644 (file)
  */
 #define KERNEL_EVENT_INIT_LIST_SIZE 64
 
-int kernel_add_channel_context(struct ltt_kernel_channel *chan,
-               struct ltt_kernel_context *ctx);
+int kernel_add_channel_context(struct ltt_kernel_channel *chan, struct ltt_kernel_context *ctx);
 int kernel_create_session(struct ltt_session *session);
-int kernel_create_channel(struct ltt_kernel_session *session,
-               struct lttng_channel *chan);
-int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel,
-               char *filter_expression, struct lttng_bytecode *filter);
+int kernel_create_channel(struct ltt_kernel_session *session, struct lttng_channel *chan);
+int kernel_create_event(struct lttng_event *ev,
+                       struct ltt_kernel_channel *channel,
+                       char *filter_expression,
+                       struct lttng_bytecode *filter);
 int kernel_disable_channel(struct ltt_kernel_channel *chan);
 int kernel_disable_event(struct ltt_kernel_event *event);
 int kernel_enable_event(struct ltt_kernel_event *event);
 int kernel_enable_channel(struct ltt_kernel_channel *chan);
-enum lttng_error_code kernel_process_attr_tracker_set_tracking_policy(
-               struct ltt_kernel_session *session,
-               enum lttng_process_attr process_attr,
-               enum lttng_tracking_policy policy);
-enum lttng_error_code kernel_process_attr_tracker_inclusion_set_add_value(
-               struct ltt_kernel_session *session,
-               enum lttng_process_attr process_attr,
-               const struct process_attr_value *value);
-enum lttng_error_code kernel_process_attr_tracker_inclusion_set_remove_value(
-               struct ltt_kernel_session *session,
-               enum lttng_process_attr process_attr,
-               const struct process_attr_value *value);
-const struct process_attr_tracker *kernel_get_process_attr_tracker(
-               struct ltt_kernel_session *session,
-               enum lttng_process_attr process_attr);
+enum lttng_error_code
+kernel_process_attr_tracker_set_tracking_policy(struct ltt_kernel_session *session,
+                                               enum lttng_process_attr process_attr,
+                                               enum lttng_tracking_policy policy);
+enum lttng_error_code
+kernel_process_attr_tracker_inclusion_set_add_value(struct ltt_kernel_session *session,
+                                                   enum lttng_process_attr process_attr,
+                                                   const struct process_attr_value *value);
+enum lttng_error_code
+kernel_process_attr_tracker_inclusion_set_remove_value(struct ltt_kernel_session *session,
+                                                      enum lttng_process_attr process_attr,
+                                                      const struct process_attr_value *value);
+const struct process_attr_tracker *
+kernel_get_process_attr_tracker(struct ltt_kernel_session *session,
+                               enum lttng_process_attr process_attr);
 int kernel_open_metadata(struct ltt_kernel_session *session);
 int kernel_open_metadata_stream(struct ltt_kernel_session *session);
 int kernel_open_channel_stream(struct ltt_kernel_channel *channel);
@@ -59,14 +59,13 @@ int kernel_stop_session(struct ltt_kernel_session *session);
 ssize_t kernel_list_events(struct lttng_event **event_list);
 void kernel_wait_quiescent(void);
 int kernel_validate_version(struct lttng_kernel_abi_tracer_version *kernel_tracer_version,
-               struct lttng_kernel_abi_tracer_abi_version *kernel_tracer_abi_version);
+                           struct lttng_kernel_abi_tracer_abi_version *kernel_tracer_abi_version);
 void kernel_destroy_session(struct ltt_kernel_session *ksess);
 void kernel_free_session(struct ltt_kernel_session *ksess);
 void kernel_destroy_channel(struct ltt_kernel_channel *kchan);
-enum lttng_error_code kernel_snapshot_record(
-               struct ltt_kernel_session *ksess,
-               const struct consumer_output *output,
-               uint64_t nb_packets_per_stream);
+enum lttng_error_code kernel_snapshot_record(struct ltt_kernel_session *ksess,
+                                            const struct consumer_output *output,
+                                            uint64_t nb_packets_per_stream);
 int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits);
 enum lttng_error_code kernel_rotate_session(struct ltt_session *session);
 enum lttng_error_code kernel_clear_session(struct ltt_session *session);
@@ -79,19 +78,16 @@ int init_kernel_tracer(void);
 void cleanup_kernel_tracer(void);
 bool kernel_tracer_is_initialized(void);
 
-enum lttng_error_code kernel_create_channel_subdirectories(
-               const struct ltt_kernel_session *ksess);
+enum lttng_error_code kernel_create_channel_subdirectories(const struct ltt_kernel_session *ksess);
 
-enum lttng_error_code kernel_create_event_notifier_group_notification_fd(
-               int *event_notifier_group_notification_fd);
-enum lttng_error_code kernel_destroy_event_notifier_group_notification_fd(
-               int event_notifier_group_notification_fd);
+enum lttng_error_code
+kernel_create_event_notifier_group_notification_fd(int *event_notifier_group_notification_fd);
+enum lttng_error_code
+kernel_destroy_event_notifier_group_notification_fd(int event_notifier_group_notification_fd);
 
-enum lttng_error_code kernel_register_event_notifier(
-               struct lttng_trigger *trigger,
-               const struct lttng_credentials *cmd_creds);
-enum lttng_error_code kernel_unregister_event_notifier(
-               const struct lttng_trigger *trigger);
+enum lttng_error_code kernel_register_event_notifier(struct lttng_trigger *trigger,
+                                                    const struct lttng_credentials *cmd_creds);
+enum lttng_error_code kernel_unregister_event_notifier(const struct lttng_trigger *trigger);
 
 int kernel_get_notification_fd(void);
 
index a6b17c2a823ade6ba087aea3e2395b695347385d..c8e03e7e922b628896907dfd7428d2bdb1a14db7 100644 (file)
@@ -31,7 +31,7 @@
 enum consumerd_state {
        CONSUMER_STARTED = 1,
        CONSUMER_STOPPED = 2,
-       CONSUMER_ERROR   = 3,
+       CONSUMER_ERROR = 3,
 };
 
 /* Unique identifier of a session daemon instance. */
index 78691f95dc7eb2c6658c7c32970e605712539422..8ba8c7ea095294448511091dc8cf75b8c2f54afc 100644 (file)
@@ -8,19 +8,20 @@
 #ifndef LTTNG_SYSCALL_H
 #define LTTNG_SYSCALL_H
 
+#include "trace-kernel.hpp"
+
 #include <common/hashtable/hashtable.hpp>
-#include <lttng/event.h>
 
-#include "trace-kernel.hpp"
+#include <lttng/event.h>
 
 /*
  * Default size of the kernel system call array. With this size, we usually
  * reallocate twice considering a 32 bit compat layer also.
  */
-#define SYSCALL_TABLE_INIT_SIZE    256
+#define SYSCALL_TABLE_INIT_SIZE 256
 
 /* Maximum length of a syscall name. */
-#define SYSCALL_NAME_LEN           255
+#define SYSCALL_NAME_LEN 255
 
 /*
  * Represent a kernel syscall and used when we are populating the internal
index 312c243cf1a21cbd899285242e55fa636f73651a..8d59952d6d404b408dba3c77eb0838615790baa4 100644 (file)
@@ -1770,9 +1770,8 @@ int main(int argc, char **argv)
        }
 
        try {
-               the_rotation_thread_handle =
-                       lttng::make_unique<lttng::sessiond::rotation_thread>(
-                               *rotation_timer_queue, *the_notification_thread_handle);
+               the_rotation_thread_handle = lttng::make_unique<lttng::sessiond::rotation_thread>(
+                       *rotation_timer_queue, *the_notification_thread_handle);
        } catch (const std::exception& e) {
                retval = -1;
                ERR("Failed to create rotation thread: %s", e.what());
index a865d9a8fc344947e33e04d306dfea1d35a4e55d..6d4c7a62548368f6ebb4e9e58e86cc1474581c66 100644 (file)
 #ifndef SESSIOND_APPLICATION_MANAGEMENT_THREAD_H
 #define SESSIOND_APPLICATION_MANAGEMENT_THREAD_H
 
-#include <stdbool.h>
 #include "lttng-sessiond.hpp"
 
+#include <stdbool.h>
+
 bool launch_application_management_thread(int apps_cmd_pipe_read_fd);
 
 #endif /* SESSIOND_APPLICATION_MANAGEMENT_THREAD_H */
index 9e35a9051b4806f63ce83a5be69d15b40fc1c415..e2b29cc5b914765151db48208f1ae516517cec90 100644 (file)
 #ifndef SESSIOND_CONSUMER_MANAGEMENT_THREAD_H
 #define SESSIOND_CONSUMER_MANAGEMENT_THREAD_H
 
-#include <stdbool.h>
 #include "lttng-sessiond.hpp"
 
+#include <stdbool.h>
+
 bool launch_consumer_management_thread(struct consumer_data *consumer_data);
 
 #endif /* SESSIOND_CONSUMER_MANAGEMENT_THREAD_H */
index fe0d8b0130f803836873edc03244f335b531dee9..c514d6042718448ef87ac65f89b126a1e9f9857c 100644 (file)
 #ifndef SESSIOND_KERNEL_MANAGEMENT_THREAD_H
 #define SESSIOND_KERNEL_MANAGEMENT_THREAD_H
 
-#include <stdbool.h>
 #include "lttng-sessiond.hpp"
 
+#include <stdbool.h>
+
 bool launch_kernel_management_thread(int kernel_poll_pipe_read_fd);
 
 #endif /* SESSIOND_KERNEL_MANAGEMENT_THREAD_H */
index 293a0b4b79ec685cd81c121b589ccd6e05941622..4058de5a4d89953b41b4d947dcc4f9e230b9ce70 100644 (file)
@@ -8,14 +8,17 @@
 #ifndef NOTIFICATION_THREAD_COMMANDS_H
 #define NOTIFICATION_THREAD_COMMANDS_H
 
-#include <lttng/domain.h>
-#include <lttng/lttng-error.h>
-#include <urcu/rculfhash.h>
-#include "notification-thread.hpp"
-#include "notification-thread-internal.hpp"
 #include "notification-thread-events.hpp"
+#include "notification-thread-internal.hpp"
+#include "notification-thread.hpp"
+
 #include <common/waiter.hpp>
+
+#include <lttng/domain.h>
+#include <lttng/lttng-error.h>
+
 #include <stdbool.h>
+#include <urcu/rculfhash.h>
 
 struct notification_thread_data;
 struct lttng_trigger;
@@ -121,47 +124,48 @@ struct notification_thread_command {
        bool is_async;
 };
 
-enum lttng_error_code notification_thread_command_register_trigger(
-               struct notification_thread_handle *handle,
-               struct lttng_trigger *trigger,
-               bool is_anonymous_trigger);
-
-enum lttng_error_code notification_thread_command_unregister_trigger(
-               struct notification_thread_handle *handle,
-               const struct lttng_trigger *trigger);
-
-enum lttng_error_code notification_thread_command_add_session(
-               struct notification_thread_handle *handle,
-               uint64_t session_id,
-               const char *session_name,
-               uid_t session_uid,
-               gid_t session_gid);
-
-enum lttng_error_code notification_thread_command_remove_session(
-               struct notification_thread_handle *handle,
-               uint64_t session_id);
-
-enum lttng_error_code notification_thread_command_add_channel(
-               struct notification_thread_handle *handle,
-               uint64_t session_id,
-               char *channel_name, uint64_t key,
-               enum lttng_domain_type domain, uint64_t capacity);
+enum lttng_error_code
+notification_thread_command_register_trigger(struct notification_thread_handle *handle,
+                                            struct lttng_trigger *trigger,
+                                            bool is_anonymous_trigger);
+
+enum lttng_error_code
+notification_thread_command_unregister_trigger(struct notification_thread_handle *handle,
+                                              const struct lttng_trigger *trigger);
+
+enum lttng_error_code
+notification_thread_command_add_session(struct notification_thread_handle *handle,
+                                       uint64_t session_id,
+                                       const char *session_name,
+                                       uid_t session_uid,
+                                       gid_t session_gid);
+
+enum lttng_error_code
+notification_thread_command_remove_session(struct notification_thread_handle *handle,
+                                          uint64_t session_id);
+
+enum lttng_error_code
+notification_thread_command_add_channel(struct notification_thread_handle *handle,
+                                       uint64_t session_id,
+                                       char *channel_name,
+                                       uint64_t key,
+                                       enum lttng_domain_type domain,
+                                       uint64_t capacity);
 
 enum lttng_error_code notification_thread_command_remove_channel(
-               struct notification_thread_handle *handle,
-               uint64_t key, enum lttng_domain_type domain);
+       struct notification_thread_handle *handle, uint64_t key, enum lttng_domain_type domain);
 
-enum lttng_error_code notification_thread_command_session_rotation_ongoing(
-               struct notification_thread_handle *handle,
-               uint64_t session_id,
-               uint64_t trace_archive_chunk_id);
+enum lttng_error_code
+notification_thread_command_session_rotation_ongoing(struct notification_thread_handle *handle,
+                                                    uint64_t session_id,
+                                                    uint64_t trace_archive_chunk_id);
 
 /* Ownership of location is transferred. */
 enum lttng_error_code notification_thread_command_session_rotation_completed(
-               struct notification_thread_handle *handle,
-               uint64_t session_id,
-               uint64_t trace_archive_chunk_id,
-               struct lttng_trace_archive_location *location);
+       struct notification_thread_handle *handle,
+       uint64_t session_id,
+       uint64_t trace_archive_chunk_id,
+       struct lttng_trace_archive_location *location);
 
 /*
  * Return the set of triggers visible to a given client.
@@ -176,30 +180,29 @@ enum lttng_error_code notification_thread_command_session_rotation_completed(
  *
  * The caller has the exclusive ownership of the returned trigger set.
  */
-enum lttng_error_code notification_thread_command_list_triggers(
-               struct notification_thread_handle *handle,
-               uid_t client_uid,
-               struct lttng_triggers **triggers);
+enum lttng_error_code
+notification_thread_command_list_triggers(struct notification_thread_handle *handle,
+                                         uid_t client_uid,
+                                         struct lttng_triggers **triggers);
 
 /*
  * The ownership of trigger_event_application_pipe is _not_ transferred to
  * the notification thread.
  */
-enum lttng_error_code notification_thread_command_add_tracer_event_source(
-               struct notification_thread_handle *handle,
-               int tracer_event_source_fd,
-               enum lttng_domain_type domain);
-
-enum lttng_error_code notification_thread_command_remove_tracer_event_source(
-               struct notification_thread_handle *handle,
-               int tracer_event_source_fd);
-
-void notification_thread_command_quit(
-               struct notification_thread_handle *handle);
-
-enum lttng_error_code notification_thread_command_get_trigger(
-               struct notification_thread_handle *handle,
-               const struct lttng_trigger *trigger,
-               struct lttng_trigger **real_trigger);
+enum lttng_error_code
+notification_thread_command_add_tracer_event_source(struct notification_thread_handle *handle,
+                                                   int tracer_event_source_fd,
+                                                   enum lttng_domain_type domain);
+
+enum lttng_error_code
+notification_thread_command_remove_tracer_event_source(struct notification_thread_handle *handle,
+                                                      int tracer_event_source_fd);
+
+void notification_thread_command_quit(struct notification_thread_handle *handle);
+
+enum lttng_error_code
+notification_thread_command_get_trigger(struct notification_thread_handle *handle,
+                                       const struct lttng_trigger *trigger,
+                                       struct lttng_trigger **real_trigger);
 
 #endif /* NOTIFICATION_THREAD_COMMANDS_H */
index 50abad916117fa6f24f8669726b24bf7e82a58db..955b16cddd299c0bacb1b00929e6d7fe645c4bc1 100644 (file)
@@ -8,48 +8,39 @@
 #ifndef NOTIFICATION_THREAD_EVENTS_H
 #define NOTIFICATION_THREAD_EVENTS_H
 
-#include <lttng/domain.h>
 #include "notification-thread.hpp"
 
+#include <lttng/domain.h>
+
 /**
  * Event handling function shall only return an error if
  * the thread should be stopped.
  */
-int handle_notification_thread_command(
-               struct notification_thread_handle *handle,
-               struct notification_thread_state *state);
+int handle_notification_thread_command(struct notification_thread_handle *handle,
+                                      struct notification_thread_state *state);
 
-int handle_notification_thread_client_connect(
-               struct notification_thread_state *state);
+int handle_notification_thread_client_connect(struct notification_thread_state *state);
 
-int handle_notification_thread_client_disconnect(
-               int client_fd,
-               struct notification_thread_state *state);
+int handle_notification_thread_client_disconnect(int client_fd,
+                                                struct notification_thread_state *state);
 
-int handle_notification_thread_client_disconnect_all(
-               struct notification_thread_state *state);
+int handle_notification_thread_client_disconnect_all(struct notification_thread_state *state);
 
-int handle_notification_thread_trigger_unregister_all(
-               struct notification_thread_state *state);
+int handle_notification_thread_trigger_unregister_all(struct notification_thread_state *state);
 
-int handle_notification_thread_tracer_event_source_died(
-               struct notification_thread_state *state,
-               int tracer_event_source_fd);
+int handle_notification_thread_tracer_event_source_died(struct notification_thread_state *state,
+                                                       int tracer_event_source_fd);
 
-int handle_notification_thread_client_in(
-               struct notification_thread_state *state,
-               int socket);
+int handle_notification_thread_client_in(struct notification_thread_state *state, int socket);
 
-int handle_notification_thread_client_out(
-               struct notification_thread_state *state,
-               int socket);
+int handle_notification_thread_client_out(struct notification_thread_state *state, int socket);
 
-int handle_notification_thread_channel_sample(
-               struct notification_thread_state *state, int pipe,
-               enum lttng_domain_type domain);
+int handle_notification_thread_channel_sample(struct notification_thread_state *state,
+                                             int pipe,
+                                             enum lttng_domain_type domain);
 
-int handle_notification_thread_event_notification(
-               struct notification_thread_state *state, int pipe,
-               enum lttng_domain_type domain);
+int handle_notification_thread_event_notification(struct notification_thread_state *state,
+                                                 int pipe,
+                                                 enum lttng_domain_type domain);
 
 #endif /* NOTIFICATION_THREAD_EVENTS_H */
index f711727c32342606b0d8b067e6911f87d7a5984f..864593cefa28f204123b7fe84fb2d605fcef07c2 100644 (file)
@@ -8,17 +8,20 @@
 #ifndef NOTIFICATION_THREAD_INTERNAL_H
 #define NOTIFICATION_THREAD_INTERNAL_H
 
+#include "notification-thread.hpp"
+
 #include <common/compat/socket.hpp>
 #include <common/credentials.hpp>
 #include <common/payload.hpp>
+
 #include <lttng/notification/channel-internal.hpp>
 #include <lttng/ref-internal.hpp>
+
 #include <stdbool.h>
 #include <unistd.h>
+#include <urcu/call-rcu.h>
 #include <urcu/rculfhash.h>
 #include <urcu/ref.h>
-#include <urcu/call-rcu.h>
-#include "notification-thread.hpp"
 
 struct lttng_evaluation;
 struct notification_thread_handle;
@@ -243,29 +246,25 @@ using report_client_transmission_result_cb = int (*)(struct notification_client
                                                     enum client_transmission_status,
                                                     void *);
 
-int notification_client_list_send_evaluation(
-               struct notification_client_list *list,
-               const struct lttng_trigger *trigger,
-               const struct lttng_evaluation *evaluation,
-               const struct lttng_credentials *source_object_creds,
-               report_client_transmission_result_cb client_report,
-               void *user_data);
+int notification_client_list_send_evaluation(struct notification_client_list *list,
+                                            const struct lttng_trigger *trigger,
+                                            const struct lttng_evaluation *evaluation,
+                                            const struct lttng_credentials *source_object_creds,
+                                            report_client_transmission_result_cb client_report,
+                                            void *user_data);
 
 int notification_thread_client_communication_update(
-               struct notification_thread_handle *handle,
-               notification_client_id id,
-               enum client_transmission_status transmission_status);
+       struct notification_thread_handle *handle,
+       notification_client_id id,
+       enum client_transmission_status transmission_status);
 
 /*
  * Takes ownership of the payload if present.
  */
 struct lttng_event_notifier_notification *lttng_event_notifier_notification_create(
-               uint64_t tracer_token,
-               enum lttng_domain_type domain,
-               char *payload,
-               size_t payload_size);
+       uint64_t tracer_token, enum lttng_domain_type domain, char *payload, size_t payload_size);
 
 void lttng_event_notifier_notification_destroy(
-               struct lttng_event_notifier_notification *event_notifier_notification);
+       struct lttng_event_notifier_notification *event_notifier_notification);
 
 #endif /* NOTIFICATION_THREAD_INTERNAL_H */
index 0c0740926ead3657ec01524e9834967cda7f957b..c995fc951d8e515c30c1c237b6be25b894bf20eb 100644 (file)
 
 #include "action-executor.hpp"
 #include "thread.hpp"
+
 #include <common/compat/poll.hpp>
 #include <common/hashtable/hashtable.hpp>
 #include <common/pipe.hpp>
-#include <lttng/trigger/trigger.h>
+
 #include <lttng/domain.h>
+#include <lttng/trigger/trigger.h>
+
 #include <pthread.h>
 #include <semaphore.h>
 #include <urcu.h>
@@ -151,8 +154,8 @@ struct notification_thread_handle {
  *             for lookup on registration.
  *   - tracer_event_sources_list:
  *             A list of tracer event source (read side fd) of type
-*              struct notification_event_tracer_event_source_element.
-*
+ *              struct notification_event_tracer_event_source_element.
+ *
  *
  * The thread reacts to the following internal events:
  *   1) creation of a tracing channel,
@@ -315,13 +318,11 @@ struct notification_thread_state {
 };
 
 /* notification_thread_data takes ownership of the channel monitor pipes. */
-struct notification_thread_handle *notification_thread_handle_create(
-               struct lttng_pipe *ust32_channel_monitor_pipe,
-               struct lttng_pipe *ust64_channel_monitor_pipe,
-               struct lttng_pipe *kernel_channel_monitor_pipe);
-void notification_thread_handle_destroy(
-               struct notification_thread_handle *handle);
-struct lttng_thread *launch_notification_thread(
-               struct notification_thread_handle *handle);
+struct notification_thread_handle *
+notification_thread_handle_create(struct lttng_pipe *ust32_channel_monitor_pipe,
+                                 struct lttng_pipe *ust64_channel_monitor_pipe,
+                                 struct lttng_pipe *kernel_channel_monitor_pipe);
+void notification_thread_handle_destroy(struct notification_thread_handle *handle);
+struct lttng_thread *launch_notification_thread(struct notification_thread_handle *handle);
 
 #endif /* NOTIFICATION_THREAD_H */
index 152a52a2058b431936ed4f3b5842001fb7287ec7..75301e2020aab55e6b77a93d338c661b8b5b67bd 100644 (file)
@@ -14,9 +14,8 @@ bool launch_application_notification_thread(int apps_cmd_notify_pipe_read_fd);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static
-bool launch_application_notification_thread(
-               int apps_cmd_notify_pipe_read_fd __attribute__((unused)))
+static bool launch_application_notification_thread(int apps_cmd_notify_pipe_read_fd
+                                                  __attribute__((unused)))
 {
        return true;
 }
index ef82a2ca286dcd8f56affdaf3d61af7156452a4d..2071475de7e9eb3c3114f080e3de73c40a7f91d2 100644 (file)
 #ifndef SESSIOND_APPLICATION_REGISTRATION_THREAD_H
 #define SESSIOND_APPLICATION_REGISTRATION_THREAD_H
 
-#include <stdbool.h>
 #include "lttng-sessiond.hpp"
 
-struct lttng_thread *launch_application_registration_thread(
-               struct ust_cmd_queue *cmd_queue);
+#include <stdbool.h>
+
+struct lttng_thread *launch_application_registration_thread(struct ust_cmd_queue *cmd_queue);
 
 #endif /* SESSIOND_APPLICATION_REGISTRATION_THREAD_H */
index 6f58a178d3abfe9aa34df0b669765341a66d9d10..bc7893475c13c34e816427d1d358740655c53bb3 100644 (file)
@@ -393,9 +393,8 @@ void ls::rotation_thread_timer_queue_destroy(struct rotation_thread_timer_queue
        free(queue);
 }
 
-ls::rotation_thread::rotation_thread(
-       rotation_thread_timer_queue& rotation_timer_queue,
-       notification_thread_handle& notification_thread_handle) :
+ls::rotation_thread::rotation_thread(rotation_thread_timer_queue& rotation_timer_queue,
+                                    notification_thread_handle& notification_thread_handle) :
        _rotation_timer_queue{ rotation_timer_queue },
        _notification_thread_handle{ notification_thread_handle }
 {
@@ -460,8 +459,8 @@ ls::rotation_thread::~rotation_thread()
 }
 
 void ls::rotation_thread_enqueue_job(ls::rotation_thread_timer_queue *queue,
-                                ls::rotation_thread_job_type job_type,
-                                ltt_session *session)
+                                    ls::rotation_thread_job_type job_type,
+                                    ltt_session *session)
 {
        const char dummy = '!';
        struct rotation_thread_job *job = nullptr;
@@ -539,7 +538,8 @@ void ls::rotation_thread::_handle_job_queue()
                }
 
                session_lock_list();
-               const auto unlock_list = lttng::make_scope_exit([]() noexcept { session_unlock_list(); });
+               const auto unlock_list =
+                       lttng::make_scope_exit([]() noexcept { session_unlock_list(); });
 
                /* locked_ptr will unlock the session and release the ref held by the job. */
                session_lock(job->session);
@@ -551,7 +551,7 @@ void ls::rotation_thread::_handle_job_queue()
        }
 }
 
-void ls::rotation_thread::_handle_notification(const lttng_notification &notification)
+void ls::rotation_thread::_handle_notification(const lttng_notificationnotification)
 {
        int ret = 0;
        const char *condition_session_name = nullptr;
@@ -770,7 +770,8 @@ void ls::rotation_thread::_run()
                                }
 
                                if (fd == _notification_channel_subscribtion_change_eventfd.fd()) {
-                                       _notification_channel_subscribtion_change_eventfd.decrement();
+                                       _notification_channel_subscribtion_change_eventfd
+                                               .decrement();
                                }
                        } else {
                                /* Job queue or quit pipe activity. */
@@ -829,7 +830,7 @@ void ls::rotation_thread::launch_thread()
 }
 
 void ls::rotation_thread::subscribe_session_consumed_size_rotation(ltt_session& session,
-                                                                         std::uint64_t size)
+                                                                  std::uint64_t size)
 {
        const struct lttng_credentials session_creds = {
                .uid = LTTNG_OPTIONAL_INIT_VALUE(session.uid),
@@ -851,8 +852,8 @@ void ls::rotation_thread::subscribe_session_consumed_size_rotation(ltt_session&
                        "Could not set session consumed size condition threshold: size={}", size));
        }
 
-       condition_status = lttng_condition_session_consumed_size_set_session_name(rotate_condition.get(),
-                                                                                 session.name);
+       condition_status = lttng_condition_session_consumed_size_set_session_name(
+               rotate_condition.get(), session.name);
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
                LTTNG_THROW_ERROR(fmt::format(
                        "Could not set session consumed size condition session name: name=`{}`",
@@ -869,8 +870,7 @@ void ls::rotation_thread::subscribe_session_consumed_size_rotation(ltt_session&
        /* trigger acquires its own reference to condition and action on success. */
        auto trigger = lttng::make_unique_wrapper<lttng_trigger, lttng_trigger_put>(
                lttng_trigger_create(rotate_condition.get(), notify_action.get()));
-       if (!trigger)
-       {
+       if (!trigger) {
                LTTNG_THROW_POSIX("Could not create size-based rotation trigger", errno);
        }
 
@@ -878,8 +878,8 @@ void ls::rotation_thread::subscribe_session_consumed_size_rotation(ltt_session&
        lttng_trigger_set_hidden(trigger.get());
        lttng_trigger_set_credentials(trigger.get(), &session_creds);
 
-       auto nc_status =
-               lttng_notification_channel_subscribe(_notification_channel.get(), rotate_condition.get());
+       auto nc_status = lttng_notification_channel_subscribe(_notification_channel.get(),
+                                                             rotate_condition.get());
        if (nc_status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
                LTTNG_THROW_ERROR("Could not subscribe to session consumed size notification");
        }
index 02ff2b2fe1549baece8eb03563e5cf86fa39d658..daf5b5f3e97c733aad048996b488313bf1472ee1 100644 (file)
 namespace lttng {
 namespace sessiond {
 
-enum class rotation_thread_job_type {
-       SCHEDULED_ROTATION,
-       CHECK_PENDING_ROTATION
-};
+enum class rotation_thread_job_type { SCHEDULED_ROTATION, CHECK_PENDING_ROTATION };
 
 struct rotation_thread_timer_queue;
 
@@ -43,7 +40,7 @@ public:
        using uptr = std::unique_ptr<rotation_thread>;
 
        rotation_thread(rotation_thread_timer_queue& rotation_timer_queue,
-                              notification_thread_handle& notification_thread_handle);
+                       notification_thread_handle& notification_thread_handle);
        ~rotation_thread();
 
        /* Only use through the lttng_thread facilities. */
index 367b41c17912acb4c6c9517de786591461db4ac8..ec2af8d506d8abda869821ca3408f79cd9ff4c2a 100644 (file)
@@ -8,10 +8,10 @@
 #ifndef SAVE_H
 #define SAVE_H
 
-#include <lttng/save.h>
 #include <common/compat/socket.hpp>
 
-int cmd_save_sessions(struct lttng_save_session_attr *attr,
-       lttng_sock_cred *creds);
+#include <lttng/save.h>
+
+int cmd_save_sessions(struct lttng_save_session_attr *attr, lttng_sock_cred *creds);
 
 #endif /* SAVE_H */
index 0532a76867585fe8e7c22f4115a7abc8563e7330..0ad891e3252e4e294aaf23026abac9a394080117 100644 (file)
@@ -928,7 +928,7 @@ static void session_notify_destruction(const struct ltt_session *session)
 /*
  * Fire each clear notifier once, and remove them from the array.
  */
-void session_notify_clear(ltt_session &session)
+void session_notify_clear(ltt_sessionsession)
 {
        size_t i;
        const size_t count = lttng_dynamic_array_get_count(&session.clear_notifiers);
@@ -1359,7 +1359,7 @@ bool session_access_ok(struct ltt_session *session, uid_t uid)
  *
  * Must be called with the session and session_list locks held.
  */
-int session_reset_rotation_state(ltt_session &session, enum lttng_rotation_state result)
+int session_reset_rotation_state(ltt_sessionsession, enum lttng_rotation_state result)
 {
        int ret = 0;
 
index 49064037d7668db5c3d7e62edbea4d5acdf6e8c4..74be7e959ef5311114a43980cf05ead1594de548 100644 (file)
@@ -8,21 +8,22 @@
 #ifndef _LTT_SESSION_H
 #define _LTT_SESSION_H
 
-#include <limits.h>
-#include <stdbool.h>
-#include <urcu/list.h>
+#include "consumer.hpp"
+#include "snapshot.hpp"
+#include "trace-kernel.hpp"
 
-#include <common/hashtable/hashtable.hpp>
 #include <common/dynamic-array.hpp>
+#include <common/hashtable/hashtable.hpp>
 #include <common/make-unique-wrapper.hpp>
 #include <common/pthread-lock.hpp>
-#include <lttng/rotation.h>
+
 #include <lttng/location.h>
 #include <lttng/lttng-error.h>
+#include <lttng/rotation.h>
 
-#include "snapshot.hpp"
-#include "trace-kernel.hpp"
-#include "consumer.hpp"
+#include <limits.h>
+#include <stdbool.h>
+#include <urcu/list.h>
 
 #define ASSERT_SESSION_LIST_LOCKED() LTTNG_ASSERT(session_trylock_list())
 
@@ -76,8 +77,10 @@ struct ltt_session_list {
  */
 struct ltt_session {
        using id_t = uint64_t;
-       using locked_ptr = std::unique_ptr<ltt_session,
-                       lttng::details::create_unique_class<ltt_session,
+       using locked_ptr =
+               std::unique_ptr<ltt_session,
+                               lttng::details::create_unique_class<
+                                       ltt_session,
                                        lttng::sessiond::details::locked_session_release>::deleter>;
        using sptr = std::shared_ptr<ltt_session>;
 
@@ -212,8 +215,8 @@ struct ltt_session {
        char *base_path;
 };
 
-enum lttng_error_code session_create(const char *name, uid_t uid, gid_t gid,
-               struct ltt_session **out_session);
+enum lttng_error_code
+session_create(const char *name, uid_t uid, gid_t gid, struct ltt_session **out_session);
 void session_lock(struct ltt_session *session);
 void session_unlock(struct ltt_session *session);
 
@@ -232,24 +235,24 @@ void session_unlock_list() noexcept;
 
 void session_destroy(struct ltt_session *session);
 int session_add_destroy_notifier(struct ltt_session *session,
-               ltt_session_destroy_notifier notifier, void *user_data);
+                                ltt_session_destroy_notifier notifier,
+                                void *user_data);
 
 int session_add_clear_notifier(struct ltt_session *session,
-               ltt_session_clear_notifier notifier, void *user_data);
-void session_notify_clear(ltt_session &session);
+                              ltt_session_clear_notifier notifier,
+                              void *user_data);
+void session_notify_clear(ltt_session& session);
 
 bool session_get(struct ltt_session *session);
 void session_put(struct ltt_session *session);
 
-enum consumer_dst_type session_get_consumer_destination_type(
-               const struct ltt_session *session);
-const char *session_get_net_consumer_hostname(
-               const struct ltt_session *session);
-void session_get_net_consumer_ports(
-               const struct ltt_session *session,
-               uint16_t *control_port, uint16_t *data_port);
-struct lttng_trace_archive_location *session_get_trace_archive_location(
-               const struct ltt_session *session);
+enum consumer_dst_type session_get_consumer_destination_type(const struct ltt_session *session);
+const char *session_get_net_consumer_hostname(const struct ltt_session *session);
+void session_get_net_consumer_ports(const struct ltt_session *session,
+                                   uint16_t *control_port,
+                                   uint16_t *data_port);
+struct lttng_trace_archive_location *
+session_get_trace_archive_location(const struct ltt_session *session);
 
 struct ltt_session *session_find_by_name(const char *name);
 struct ltt_session *session_find_by_id(ltt_session::id_t id);
@@ -259,15 +262,14 @@ void session_list_wait_empty();
 
 bool session_access_ok(struct ltt_session *session, uid_t uid);
 
-int session_reset_rotation_state(ltt_session &session,
-               enum lttng_rotation_state result);
+int session_reset_rotation_state(ltt_session& session, enum lttng_rotation_state result);
 
 /* Create a new trace chunk object from the session's configuration. */
-struct lttng_trace_chunk *session_create_new_trace_chunk(
-               const struct ltt_session *session,
-               const struct consumer_output *consumer_output_override,
-               const char *session_base_path_override,
-               const char *chunk_name_override);
+struct lttng_trace_chunk *
+session_create_new_trace_chunk(const struct ltt_session *session,
+                              const struct consumer_output *consumer_output_override,
+                              const char *session_base_path_override,
+                              const char *chunk_name_override);
 
 /*
  * Set `new_trace_chunk` as the session's current trace chunk. A reference
@@ -278,17 +280,17 @@ struct lttng_trace_chunk *session_create_new_trace_chunk(
  * `current_session_trace_chunk` on success.
  */
 int session_set_trace_chunk(struct ltt_session *session,
-               struct lttng_trace_chunk *new_trace_chunk,
-               struct lttng_trace_chunk **current_session_trace_chunk);
+                           struct lttng_trace_chunk *new_trace_chunk,
+                           struct lttng_trace_chunk **current_session_trace_chunk);
 
 /*
  * Close a chunk on the remote peers of a session. Has no effect on the
  * ltt_session itself.
  */
 int session_close_trace_chunk(struct ltt_session *session,
-               struct lttng_trace_chunk *trace_chunk,
-               enum lttng_trace_chunk_command_type close_command,
-               char *path);
+                             struct lttng_trace_chunk *trace_chunk,
+                             enum lttng_trace_chunk_command_type close_command,
+                             char *path);
 
 /* Open a packet in all channels of a given session. */
 enum lttng_error_code session_open_packets(struct ltt_session *session);
index fa0bfeb8216b2161661de73be4a7e944a585b9d4..6b98a59a7fb56a53b7d6435e66c234f9939eb48d 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_SESSIOND_CONFIG_H
 
 #include <common/macros.hpp>
+
 #include <stdbool.h>
 
 struct config_string {
index 9053d3b4a84b54f0ec2629900e7ac171fcfedd0e..726b89f80c23fbea59ea73452a29a6c692159f66 100644 (file)
@@ -8,14 +8,14 @@
 #ifndef SNAPSHOT_H
 #define SNAPSHOT_H
 
-#include <limits.h>
-#include <stdint.h>
+#include "consumer.hpp"
 
 #include <common/common.hpp>
 #include <common/hashtable/hashtable.hpp>
 #include <common/uri.hpp>
 
-#include "consumer.hpp"
+#include <limits.h>
+#include <stdint.h>
 
 struct consumer_output;
 struct ltt_session;
@@ -55,27 +55,29 @@ struct snapshot {
 struct snapshot *snapshot_alloc();
 void snapshot_destroy(struct snapshot *obj);
 int snapshot_init(struct snapshot *obj);
-void snapshot_delete_output(struct snapshot *snapshot,
-               struct snapshot_output *output);
-void snapshot_add_output(struct snapshot *snapshot,
-               struct snapshot_output *output);
+void snapshot_delete_output(struct snapshot *snapshot, struct snapshot_output *output);
+void snapshot_add_output(struct snapshot *snapshot, struct snapshot_output *output);
 
 /* Snapshot output object. */
 struct snapshot_output *snapshot_output_alloc();
 void snapshot_output_destroy(struct snapshot_output *obj);
 int snapshot_output_init(const struct ltt_session *session,
-               uint64_t max_size, const char *name,
-               const char *ctrl_url, const char *data_url,
-               struct consumer_output *consumer, struct snapshot_output *output,
-               struct snapshot *snapshot);
+                        uint64_t max_size,
+                        const char *name,
+                        const char *ctrl_url,
+                        const char *data_url,
+                        struct consumer_output *consumer,
+                        struct snapshot_output *output,
+                        struct snapshot *snapshot);
 int snapshot_output_init_with_uri(const struct ltt_session *session,
-               uint64_t max_size, const char *name,
-               struct lttng_uri *uris, size_t nb_uri,
-               struct consumer_output *consumer, struct snapshot_output *output,
-               struct snapshot *snapshot);
-struct snapshot_output *snapshot_find_output_by_id(uint32_t id,
-               struct snapshot *snapshot);
-struct snapshot_output *snapshot_find_output_by_name(const char *name,
-               struct snapshot *snapshot);
+                                 uint64_t max_size,
+                                 const char *name,
+                                 struct lttng_uri *uris,
+                                 size_t nb_uri,
+                                 struct consumer_output *consumer,
+                                 struct snapshot_output *output,
+                                 struct snapshot *snapshot);
+struct snapshot_output *snapshot_find_output_by_id(uint32_t id, struct snapshot *snapshot);
+struct snapshot_output *snapshot_find_output_by_name(const char *name, struct snapshot *snapshot);
 
 #endif /* SNAPSHOT_H */
index d80ad2e0b0b036773762edfd766b11effd78b6cf..5faecd5e1eb41c3fd824eec132afe652c17fa997 100644 (file)
@@ -35,9 +35,9 @@ public:
        stream_class& operator=(stream_class&&) = delete;
        stream_class& operator=(const stream_class&) = delete;
 
-       virtual const typepacket_context() const;
-       virtual const typeevent_header() const;
-       virtual const typeevent_context() const;
+       virtual const type *packet_context() const;
+       virtual const type *event_header() const;
+       virtual const type *event_context() const;
 
        const unsigned int id;
        /*
@@ -50,8 +50,8 @@ public:
 
 protected:
        stream_class(unsigned int id,
-                       enum header_type header_type,
-                       nonstd::optional<std::string> default_clock_class_name = nonstd::nullopt);
+                    enum header_type header_type,
+                    nonstd::optional<std::string> default_clock_class_name = nonstd::nullopt);
        virtual void _accept_on_event_classes(trace_class_visitor& trace_class_visitor) const = 0;
 
        lttng::sessiond::trace::type::cuptr _packet_context;
index f35bb5803d864dd5d2503a7efbcdb51f6eb7d069..a1e390a09b085ee2c56ce1f90d513349b1f30123 100644 (file)
@@ -31,10 +31,10 @@ using lttng_thread_cleanup_cb = void (*)(void *);
  * The shutdown and cleanup callbacks are optional.
  */
 struct lttng_thread *lttng_thread_create(const char *name,
-               lttng_thread_entry_point entry,
-               lttng_thread_shutdown_cb shutdown,
-               lttng_thread_cleanup_cb cleanup,
-               void *thread_data);
+                                        lttng_thread_entry_point entry,
+                                        lttng_thread_shutdown_cb shutdown,
+                                        lttng_thread_cleanup_cb cleanup,
+                                        void *thread_data);
 
 bool lttng_thread_get(struct lttng_thread *thread);
 void lttng_thread_put(struct lttng_thread *thread);
index d87824704633ab61fbe54f9178de333990904a17..838983e3baa2d26a5b8c554a0a05e9d4ffe4449f 100644 (file)
@@ -233,7 +233,7 @@ end:
 /*
  * Call with session and session_list locks held.
  */
-int timer_session_rotation_pending_check_stop(ltt_session &session)
+int timer_session_rotation_pending_check_stop(ltt_sessionsession)
 {
        int ret;
 
index 3cdebbc13590f68bb15baa093d04d6069525dcf0..142982f8bbe3fe9e21097b3925d488743d562166 100644 (file)
@@ -23,17 +23,16 @@ int timer_signal_init(void);
 
 /* Start a session's rotation pending check timer (one-shot mode). */
 int timer_session_rotation_pending_check_start(struct ltt_session *session,
-               unsigned int interval_us);
+                                              unsigned int interval_us);
 /* Stop a session's rotation pending check timer. */
-int timer_session_rotation_pending_check_stop(ltt_session &session);
+int timer_session_rotation_pending_check_stop(ltt_sessionsession);
 
 /* Start a session's rotation schedule timer. */
 int timer_session_rotation_schedule_timer_start(struct ltt_session *session,
-               unsigned int interval_us);
+                                               unsigned int interval_us);
 /* Stop a session's rotation schedule timer. */
 int timer_session_rotation_schedule_timer_stop(struct ltt_session *session);
 
-bool launch_timer_thread(
-               struct timer_thread_parameters *timer_thread_parameters);
+bool launch_timer_thread(struct timer_thread_parameters *timer_thread_parameters);
 
 #endif /* SESSIOND_TIMER_H */
index cbd4114869ee3904ea27d9da135890159bda33c1..afd99ffb7dfa67541f7ca327337e760ed93704bd 100644 (file)
@@ -40,7 +40,7 @@ public:
        {
        }
 
-       const charconst name;
+       const char *const name;
        const ValueType& value;
 };
 
index a563faa28379481c47f05da59c1c8824c97b51a8..265613ba81292caabcd59cc051a8764e15ebb459 100644 (file)
@@ -8,15 +8,16 @@
 #ifndef _LTT_TRACE_KERNEL_H
 #define _LTT_TRACE_KERNEL_H
 
-#include <urcu/list.h>
+#include "consumer.hpp"
+#include "tracker.hpp"
 
-#include <lttng/lttng.h>
-#include <common/lttng-kernel.hpp>
-#include <common/lttng-kernel-old.hpp>
 #include <common/defaults.hpp>
+#include <common/lttng-kernel-old.hpp>
+#include <common/lttng-kernel.hpp>
 
-#include "consumer.hpp"
-#include "tracker.hpp"
+#include <lttng/lttng.h>
+
+#include <urcu/list.h>
 
 /* Kernel event list */
 struct ltt_kernel_event_list {
@@ -141,41 +142,38 @@ struct ltt_kernel_session {
 /*
  * Lookup functions. NULL is returned if not found.
  */
-struct ltt_kernel_event *trace_kernel_get_event_by_name(
-               char *name, struct ltt_kernel_channel *channel,
-               enum lttng_event_type type);
-struct ltt_kernel_event *trace_kernel_find_event(
-               char *name, struct ltt_kernel_channel *channel,
-               enum lttng_event_type type,
-               struct lttng_bytecode *filter);
-struct ltt_kernel_channel *trace_kernel_get_channel_by_name(
-               const char *name, struct ltt_kernel_session *session);
+struct ltt_kernel_event *trace_kernel_get_event_by_name(char *name,
+                                                       struct ltt_kernel_channel *channel,
+                                                       enum lttng_event_type type);
+struct ltt_kernel_event *trace_kernel_find_event(char *name,
+                                                struct ltt_kernel_channel *channel,
+                                                enum lttng_event_type type,
+                                                struct lttng_bytecode *filter);
+struct ltt_kernel_channel *trace_kernel_get_channel_by_name(const char *name,
+                                                           struct ltt_kernel_session *session);
 
 /*
  * Create functions malloc() the data structure.
  */
 struct ltt_kernel_session *trace_kernel_create_session();
-struct ltt_kernel_channel *trace_kernel_create_channel(
-               struct lttng_channel *chan);
+struct ltt_kernel_channel *trace_kernel_create_channel(struct lttng_channel *chan);
 enum lttng_error_code trace_kernel_create_event(struct lttng_event *ev,
-               char *filter_expression, struct lttng_bytecode *filter,
-               struct ltt_kernel_event **kernel_event);
+                                               char *filter_expression,
+                                               struct lttng_bytecode *filter,
+                                               struct ltt_kernel_event **kernel_event);
 struct ltt_kernel_metadata *trace_kernel_create_metadata();
-struct ltt_kernel_stream *trace_kernel_create_stream(const char *name,
-               unsigned int count);
-struct ltt_kernel_context *trace_kernel_create_context(
-               struct lttng_kernel_abi_context *ctx);
+struct ltt_kernel_stream *trace_kernel_create_stream(const char *name, unsigned int count);
+struct ltt_kernel_context *trace_kernel_create_context(struct lttng_kernel_abi_context *ctx);
 /* Trigger is only non-const to acquire a reference. */
 enum lttng_error_code trace_kernel_create_event_notifier_rule(
-               struct lttng_trigger *trigger,
-               uint64_t token,
-               uint64_t error_counter_index,
-               struct ltt_kernel_event_notifier_rule **event_notifier_rule);
-struct ltt_kernel_context *trace_kernel_copy_context(
-               struct ltt_kernel_context *ctx);
+       struct lttng_trigger *trigger,
+       uint64_t token,
+       uint64_t error_counter_index,
+       struct ltt_kernel_event_notifier_rule **event_notifier_rule);
+struct ltt_kernel_context *trace_kernel_copy_context(struct ltt_kernel_context *ctx);
 enum lttng_error_code trace_kernel_init_event_notifier_from_event_rule(
-               const struct lttng_event_rule *rule,
-               struct lttng_kernel_abi_event_notifier *kernel_event_notifier);
+       const struct lttng_event_rule *rule,
+       struct lttng_kernel_abi_event_notifier *kernel_event_notifier);
 
 /*
  * Destroy functions free() the data structure and remove from linked list if
index 46a69fe9d5f3105814ecf5853d02100993e80b8d..74b1df60f9d71a3f815154f56b2bed3a3023ed5e 100644 (file)
@@ -9,16 +9,17 @@
 #ifndef _LTT_TRACE_UST_H
 #define _LTT_TRACE_UST_H
 
-#include <limits.h>
-#include <urcu/list.h>
+#include "consumer.hpp"
+#include "lttng-ust-ctl.hpp"
 
 #include <common/defaults.hpp>
 #include <common/hashtable/hashtable.hpp>
 #include <common/tracker.hpp>
+
 #include <lttng/lttng.h>
 
-#include "consumer.hpp"
-#include "lttng-ust-ctl.hpp"
+#include <limits.h>
+#include <urcu/list.h>
 
 struct agent;
 
@@ -56,7 +57,7 @@ struct ltt_ust_event {
 
 /* UST channel */
 struct ltt_ust_channel {
-       uint64_t id;    /* unique id per session. */
+       uint64_t id; /* unique id per session. */
        bool enabled;
        /*
         * A UST channel can be part of a userspace sub-domain such as JUL,
@@ -92,7 +93,7 @@ struct ust_id_tracker {
 
 /* UST session */
 struct ltt_ust_session {
-       uint64_t id;    /* Unique identifier of session */
+       uint64_t id; /* Unique identifier of session */
        struct ltt_ust_domain_global domain_global;
        /* Hash table of agent indexed by agent domain. */
        struct lttng_ht *agents;
@@ -118,7 +119,7 @@ struct ltt_ust_session {
        unsigned int output_traces;
        unsigned int snapshot_mode;
        unsigned int has_non_default_channel;
-       unsigned int live_timer_interval;       /* usec */
+       unsigned int live_timer_interval; /* usec */
 
        /* Metadata channel attributes. */
        struct lttng_ust_abi_channel_attr metadata_attr;
@@ -175,39 +176,38 @@ static inline uint64_t trace_ust_get_next_chan_id(struct ltt_ust_session *s)
 #ifdef HAVE_LIBLTTNG_UST_CTL
 
 int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key);
-int trace_ust_ht_match_event_by_name(struct cds_lfht_node *node,
-               const void *_key);
+int trace_ust_ht_match_event_by_name(struct cds_lfht_node *node, const void *_key);
 
 /*
  * Lookup functions. NULL is returned if not found.
  */
 struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht,
-               char *name, struct lttng_bytecode *filter,
-               enum lttng_ust_abi_loglevel_type loglevel_type, int loglevel_value,
-               struct lttng_event_exclusion *exclusion);
-struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht,
-               const char *name);
+                                          char *name,
+                                          struct lttng_bytecode *filter,
+                                          enum lttng_ust_abi_loglevel_type loglevel_type,
+                                          int loglevel_value,
+                                          struct lttng_event_exclusion *exclusion);
+struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, const char *name);
 struct agent *trace_ust_find_agent(struct ltt_ust_session *session,
-               enum lttng_domain_type domain_type);
+                                  enum lttng_domain_type domain_type);
 
 /*
  * Create functions malloc() the data structure.
  */
 struct ltt_ust_session *trace_ust_create_session(uint64_t session_id);
 struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr,
-               enum lttng_domain_type domain);
+                                                enum lttng_domain_type domain);
 
 enum lttng_error_code trace_ust_create_event(struct lttng_event *ev,
-               char *filter_expression,
-               struct lttng_bytecode *filter,
-               struct lttng_event_exclusion *exclusion,
-               bool internal_event, struct ltt_ust_event **ust_event);
-struct ltt_ust_context *trace_ust_create_context(
-               const struct lttng_event_context *ctx);
+                                            char *filter_expression,
+                                            struct lttng_bytecode *filter,
+                                            struct lttng_event_exclusion *exclusion,
+                                            bool internal_event,
+                                            struct ltt_ust_event **ust_event);
+struct ltt_ust_context *trace_ust_create_context(const struct lttng_event_context *ctx);
 int trace_ust_match_context(const struct ltt_ust_context *uctx,
-               const struct lttng_event_context *ctx);
-void trace_ust_delete_channel(struct lttng_ht *ht,
-               struct ltt_ust_channel *channel);
+                           const struct lttng_event_context *ctx);
+void trace_ust_delete_channel(struct lttng_ht *ht, struct ltt_ust_channel *channel);
 
 int trace_ust_regenerate_metadata(struct ltt_ust_session *usess);
 
@@ -222,187 +222,171 @@ void trace_ust_destroy_context(struct ltt_ust_context *ctx);
 void trace_ust_free_session(struct ltt_ust_session *session);
 
 int trace_ust_id_tracker_lookup(enum lttng_process_attr process_attr,
-               struct ltt_ust_session *session,
-               int id);
-enum lttng_error_code trace_ust_process_attr_tracker_set_tracking_policy(
-               struct ltt_ust_session *session,
-               enum lttng_process_attr process_attr,
-               enum lttng_tracking_policy policy);
-enum lttng_error_code trace_ust_process_attr_tracker_inclusion_set_add_value(
-               struct ltt_ust_session *session,
-               enum lttng_process_attr process_attr,
-               const struct process_attr_value *value);
-enum lttng_error_code trace_ust_process_attr_tracker_inclusion_set_remove_value(
-               struct ltt_ust_session *session,
-               enum lttng_process_attr process_attr,
-               const struct process_attr_value *value);
-const struct process_attr_tracker *trace_ust_get_process_attr_tracker(
-               struct ltt_ust_session *session,
-               enum lttng_process_attr process_attr);
+                               struct ltt_ust_session *session,
+                               int id);
+enum lttng_error_code
+trace_ust_process_attr_tracker_set_tracking_policy(struct ltt_ust_session *session,
+                                                  enum lttng_process_attr process_attr,
+                                                  enum lttng_tracking_policy policy);
+enum lttng_error_code
+trace_ust_process_attr_tracker_inclusion_set_add_value(struct ltt_ust_session *session,
+                                                      enum lttng_process_attr process_attr,
+                                                      const struct process_attr_value *value);
+enum lttng_error_code
+trace_ust_process_attr_tracker_inclusion_set_remove_value(struct ltt_ust_session *session,
+                                                         enum lttng_process_attr process_attr,
+                                                         const struct process_attr_value *value);
+const struct process_attr_tracker *
+trace_ust_get_process_attr_tracker(struct ltt_ust_session *session,
+                                  enum lttng_process_attr process_attr);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline int trace_ust_ht_match_event(
-               struct cds_lfht_node *node __attribute__((unused)),
-               const void *_key __attribute__((unused)))
+static inline int trace_ust_ht_match_event(struct cds_lfht_node *node __attribute__((unused)),
+                                          const void *_key __attribute__((unused)))
 {
        return 0;
 }
 
-static inline int trace_ust_ht_match_event_by_name(
-               struct cds_lfht_node *node __attribute__((unused)),
-               const void *_key __attribute__((unused)))
+static inline int trace_ust_ht_match_event_by_name(struct cds_lfht_node *node
+                                                  __attribute__((unused)),
+                                                  const void *_key __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-struct ltt_ust_channel *trace_ust_find_channel_by_name(
-               struct lttng_ht *ht __attribute__((unused)),
-               const char *name __attribute__((unused)))
+static inline struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht
+                                                                    __attribute__((unused)),
+                                                                    const char *name
+                                                                    __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-struct ltt_ust_session *trace_ust_create_session(
-               unsigned int session_id __attribute__((unused)))
+static inline struct ltt_ust_session *trace_ust_create_session(unsigned int session_id
+                                                              __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-struct ltt_ust_channel *trace_ust_create_channel(
-               struct lttng_channel *attr __attribute__((unused)),
-               enum lttng_domain_type domain __attribute__((unused)))
+static inline struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr
+                                                              __attribute__((unused)),
+                                                              enum lttng_domain_type domain
+                                                              __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-enum lttng_error_code trace_ust_create_event(
-               struct lttng_event *ev __attribute__((unused)),
-               const char *filter_expression __attribute__((unused)),
-               struct lttng_bytecode *filter __attribute__((unused)),
-               struct lttng_event_exclusion *exclusion __attribute__((unused)),
-               bool internal_event __attribute__((unused)),
-               struct ltt_ust_event **ust_event __attribute__((unused)))
+static inline enum lttng_error_code
+trace_ust_create_event(struct lttng_event *ev __attribute__((unused)),
+                      const char *filter_expression __attribute__((unused)),
+                      struct lttng_bytecode *filter __attribute__((unused)),
+                      struct lttng_event_exclusion *exclusion __attribute__((unused)),
+                      bool internal_event __attribute__((unused)),
+                      struct ltt_ust_event **ust_event __attribute__((unused)))
 {
        return LTTNG_ERR_NO_UST;
 }
 
-static inline
-void trace_ust_destroy_session(
-               struct ltt_ust_session *session __attribute__((unused)))
+static inline void trace_ust_destroy_session(struct ltt_ust_session *session
+                                            __attribute__((unused)))
 {
 }
 
-static inline
-void trace_ust_destroy_channel(
-               struct ltt_ust_channel *channel __attribute__((unused)))
+static inline void trace_ust_destroy_channel(struct ltt_ust_channel *channel
+                                            __attribute__((unused)))
 {
 }
 
-static inline
-void trace_ust_destroy_event(
-               struct ltt_ust_event *event __attribute__((unused)))
+static inline void trace_ust_destroy_event(struct ltt_ust_event *event __attribute__((unused)))
 {
 }
 
-static inline
-void trace_ust_free_session(
-               struct ltt_ust_session *session __attribute__((unused)))
+static inline void trace_ust_free_session(struct ltt_ust_session *session __attribute__((unused)))
 {
 }
 
-static inline
-struct ltt_ust_context *trace_ust_create_context(
-               const struct lttng_event_context *ctx __attribute__((unused)))
+static inline struct ltt_ust_context *trace_ust_create_context(const struct lttng_event_context *ctx
+                                                              __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-int trace_ust_match_context(
-               const struct ltt_ust_context *uctx __attribute__((unused)),
-               const struct lttng_event_context *ctx __attribute__((unused)))
+static inline int trace_ust_match_context(const struct ltt_ust_context *uctx
+                                         __attribute__((unused)),
+                                         const struct lttng_event_context *ctx
+                                         __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-struct ltt_ust_event *trace_ust_find_event(
-               struct lttng_ht *ht __attribute__((unused)),
-               char *name __attribute__((unused)),
-               struct lttng_bytecode *filter __attribute__((unused)),
-               enum lttng_ust_abi_loglevel_type loglevel_type __attribute__((unused)),
-               int loglevel_value __attribute__((unused)),
-               struct lttng_event_exclusion *exclusion __attribute__((unused)))
+static inline struct ltt_ust_event *
+trace_ust_find_event(struct lttng_ht *ht __attribute__((unused)),
+                    char *name __attribute__((unused)),
+                    struct lttng_bytecode *filter __attribute__((unused)),
+                    enum lttng_ust_abi_loglevel_type loglevel_type __attribute__((unused)),
+                    int loglevel_value __attribute__((unused)),
+                    struct lttng_event_exclusion *exclusion __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-void trace_ust_delete_channel(
-               struct lttng_ht *ht __attribute__((unused)),
-               struct ltt_ust_channel *channel __attribute__((unused)))
+static inline void trace_ust_delete_channel(struct lttng_ht *ht __attribute__((unused)),
+                                           struct ltt_ust_channel *channel __attribute__((unused)))
 {
        return;
 }
 
-static inline int trace_ust_regenerate_metadata(
-               struct ltt_ust_session *usess __attribute__((unused)))
+static inline int trace_ust_regenerate_metadata(struct ltt_ust_session *usess
+                                               __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-struct agent *trace_ust_find_agent(
-               struct ltt_ust_session *session __attribute__((unused)),
-               enum lttng_domain_type domain_type __attribute__((unused)))
+static inline struct agent *trace_ust_find_agent(struct ltt_ust_session *session
+                                                __attribute__((unused)),
+                                                enum lttng_domain_type domain_type
+                                                __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline int trace_ust_id_tracker_lookup(
-               enum lttng_process_attr process_attr __attribute__((unused)),
-               struct ltt_ust_session *session __attribute__((unused)),
-               int id __attribute__((unused)))
+static inline int trace_ust_id_tracker_lookup(enum lttng_process_attr process_attr
+                                             __attribute__((unused)),
+                                             struct ltt_ust_session *session
+                                             __attribute__((unused)),
+                                             int id __attribute__((unused)))
 {
        return 0;
 }
 
-static inline enum lttng_error_code
-trace_ust_process_attr_tracker_set_tracking_policy(
-               struct ltt_ust_session *session __attribute__((unused)),
-               enum lttng_process_attr process_attr __attribute__((unused)),
-               enum lttng_tracking_policy policy __attribute__((unused)))
+static inline enum lttng_error_code trace_ust_process_attr_tracker_set_tracking_policy(
+       struct ltt_ust_session *session __attribute__((unused)),
+       enum lttng_process_attr process_attr __attribute__((unused)),
+       enum lttng_tracking_policy policy __attribute__((unused)))
 {
        return LTTNG_OK;
 }
 
-static inline enum lttng_error_code
-trace_ust_process_attr_tracker_inclusion_set_add_value(
-               struct ltt_ust_session *session __attribute__((unused)),
-               enum lttng_process_attr process_attr __attribute__((unused)),
-               const struct process_attr_value *value __attribute__((unused)))
+static inline enum lttng_error_code trace_ust_process_attr_tracker_inclusion_set_add_value(
+       struct ltt_ust_session *session __attribute__((unused)),
+       enum lttng_process_attr process_attr __attribute__((unused)),
+       const struct process_attr_value *value __attribute__((unused)))
 {
        return LTTNG_OK;
 }
 
-static inline enum lttng_error_code
-trace_ust_process_attr_tracker_inclusion_set_remove_value(
-               struct ltt_ust_session *session __attribute__((unused)),
-               enum lttng_process_attr process_attr __attribute__((unused)),
-               const struct process_attr_value *value __attribute__((unused)))
+static inline enum lttng_error_code trace_ust_process_attr_tracker_inclusion_set_remove_value(
+       struct ltt_ust_session *session __attribute__((unused)),
+       enum lttng_process_attr process_attr __attribute__((unused)),
+       const struct process_attr_value *value __attribute__((unused)))
 {
        return LTTNG_OK;
 }
 
 static inline const struct process_attr_tracker *
-trace_ust_get_process_attr_tracker(
-               struct ltt_ust_session *session __attribute__((unused)),
-               enum lttng_process_attr process_attr __attribute__((unused)))
+trace_ust_get_process_attr_tracker(struct ltt_ust_session *session __attribute__((unused)),
+                                  enum lttng_process_attr process_attr __attribute__((unused)))
 {
        return NULL;
 }
index a4edced0e9c7f2bd89729be50d752cb65d6f8955..2996113c53be140c1b0f92d6f42ace5af9d5b2ce 100644 (file)
@@ -10,6 +10,7 @@
 #define _LTT_TRACKER_H
 
 #include <common/tracker.hpp>
+
 #include <lttng/tracker.h>
 
 struct process_attr_tracker;
@@ -25,22 +26,20 @@ enum process_attr_tracker_status {
 struct process_attr_tracker *process_attr_tracker_create();
 void process_attr_tracker_destroy(struct process_attr_tracker *tracker);
 
-enum lttng_tracking_policy process_attr_tracker_get_tracking_policy(
-               const struct process_attr_tracker *tracker);
-int process_attr_tracker_set_tracking_policy(
-               struct process_attr_tracker *tracker,
-               enum lttng_tracking_policy tracking_policy);
+enum lttng_tracking_policy
+process_attr_tracker_get_tracking_policy(const struct process_attr_tracker *tracker);
+int process_attr_tracker_set_tracking_policy(struct process_attr_tracker *tracker,
+                                            enum lttng_tracking_policy tracking_policy);
 
-enum process_attr_tracker_status process_attr_tracker_inclusion_set_add_value(
-               struct process_attr_tracker *tracker,
-               const struct process_attr_value *value);
 enum process_attr_tracker_status
-process_attr_tracker_inclusion_set_remove_value(
-               struct process_attr_tracker *tracker,
-               const struct process_attr_value *value);
+process_attr_tracker_inclusion_set_add_value(struct process_attr_tracker *tracker,
+                                            const struct process_attr_value *value);
+enum process_attr_tracker_status
+process_attr_tracker_inclusion_set_remove_value(struct process_attr_tracker *tracker,
+                                               const struct process_attr_value *value);
 
-enum process_attr_tracker_status process_attr_tracker_get_inclusion_set(
-               const struct process_attr_tracker *tracker,
-               struct lttng_process_attr_values **values);
+enum process_attr_tracker_status
+process_attr_tracker_get_inclusion_set(const struct process_attr_tracker *tracker,
+                                      struct lttng_process_attr_values **values);
 
 #endif /* _LTT_TRACKER_H */
index 61a0c26e9cfdad939580ae1a7cd113528bb6e218..d8a01864b6245463db9901346ea79bc079bc5657 100644 (file)
@@ -372,8 +372,8 @@ public:
                _trace_abi(abi),
 
                _default_clock_class_name(in_default_clock_class_name ?
-                                                  in_default_clock_class_name->c_str() :
-                                                  nullptr),
+                                                 in_default_clock_class_name->c_str() :
+                                                 nullptr),
                _type_overrides(type_overrides)
        {
        }
index 1b8bd642de9b885614972a19250da54824b05e2b..0c3ceb1fde4294dc57e0477bed50fe7a2ab0a1be 100644 (file)
@@ -8,9 +8,9 @@
 #ifndef LTTNG_TSDL_TRACE_CLASS_VISITOR_H
 #define LTTNG_TSDL_TRACE_CLASS_VISITOR_H
 
-#include "trace-class.hpp"
-#include "stream-class.hpp"
 #include "event-class.hpp"
+#include "stream-class.hpp"
+#include "trace-class.hpp"
 
 #include <vendor/optional.hpp>
 
@@ -36,13 +36,13 @@ public:
        type_overrider() = default;
 
        void publish(const lttng::sessiond::trace::type& original,
-                       lttng::sessiond::trace::type::cuptr new_type_override);
-       const lttng::sessiond::trace::type& type(
-                       const lttng::sessiond::trace::type& original) const noexcept;
+                    lttng::sessiond::trace::type::cuptr new_type_override);
+       const lttng::sessiond::trace::type&
+       type(const lttng::sessiond::trace::type& original) const noexcept;
 
 private:
        std::unordered_map<const lttng::sessiond::trace::type *, lttng::sessiond::trace::type::cuptr>
-                       _overriden_types;
+               _overriden_types;
 };
 } /* namespace details. */
 
@@ -56,7 +56,7 @@ private:
 class trace_class_visitor : public lttng::sessiond::trace::trace_class_visitor {
 public:
        trace_class_visitor(const lttng::sessiond::trace::abi& trace_abi,
-                       append_metadata_fragment_function append_metadata);
+                           append_metadata_fragment_function append_metadata);
 
        virtual void visit(const lttng::sessiond::trace::trace_class& trace_class) override final;
        virtual void visit(const lttng::sessiond::trace::clock_class& clock_class) override final;
@@ -66,8 +66,8 @@ public:
 private:
        /* Coherent (parseable) fragments must be appended. */
        void append_metadata_fragment(const std::string& fragment) const;
-       const lttng::sessiond::trace::type& _lookup_field_type(
-                       const lttng::sessiond::trace::field_location& field_location) const;
+       const lttng::sessiond::trace::type&
+       _lookup_field_type(const lttng::sessiond::trace::field_location& field_location) const;
 
        const lttng::sessiond::trace::abi& _trace_abi;
        const append_metadata_fragment_function _append_metadata_fragment;
index 343be56b97ccbc3ba9c4e16644a01b3ded1ec06d..a2a0dcabb3c883756c6d521116a9d05a586febae 100644 (file)
 #ifndef LTTNG_UST_ABI_INTERNAL_H
 #define LTTNG_UST_ABI_INTERNAL_H
 
-#include <stdint.h>
 #include <common/macros.hpp>
 
+#include <stdint.h>
+
 #ifndef LTTNG_PACKED
 #error "LTTNG_PACKED should be defined"
 #endif
 
 #ifndef __ust_stringify
-#define __ust_stringify1(x)    #x
-#define __ust_stringify(x)     __ust_stringify1(x)
+#define __ust_stringify1(x) #x
+#define __ust_stringify(x)  __ust_stringify1(x)
 #endif /* __ust_stringify */
 
-#define LTTNG_UST_ABI_SYM_NAME_LEN             256
-#define LTTNG_UST_ABI_PROCNAME_LEN             16
+#define LTTNG_UST_ABI_SYM_NAME_LEN 256
+#define LTTNG_UST_ABI_PROCNAME_LEN 16
 
 /* UST comm magic number, used to validate protocol and endianness. */
-#define LTTNG_UST_ABI_COMM_MAGIC                       0xC57C57C5
+#define LTTNG_UST_ABI_COMM_MAGIC 0xC57C57C5
 
 /* Version for ABI between liblttng-ust, sessiond, consumerd */
-#define LTTNG_UST_ABI_MAJOR_VERSION                    9
-#define LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE  8
-#define LTTNG_UST_ABI_MINOR_VERSION            0
+#define LTTNG_UST_ABI_MAJOR_VERSION                  9
+#define LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE 8
+#define LTTNG_UST_ABI_MINOR_VERSION                  0
 
 enum lttng_ust_abi_instrumentation {
-       LTTNG_UST_ABI_TRACEPOINT        = 0,
-       LTTNG_UST_ABI_PROBE             = 1,
-       LTTNG_UST_ABI_FUNCTION          = 2,
+       LTTNG_UST_ABI_TRACEPOINT = 0,
+       LTTNG_UST_ABI_PROBE = 1,
+       LTTNG_UST_ABI_FUNCTION = 2,
 };
 
 enum lttng_ust_abi_loglevel_type {
-       LTTNG_UST_ABI_LOGLEVEL_ALL      = 0,
-       LTTNG_UST_ABI_LOGLEVEL_RANGE    = 1,
-       LTTNG_UST_ABI_LOGLEVEL_SINGLE   = 2,
+       LTTNG_UST_ABI_LOGLEVEL_ALL = 0,
+       LTTNG_UST_ABI_LOGLEVEL_RANGE = 1,
+       LTTNG_UST_ABI_LOGLEVEL_SINGLE = 2,
 };
 
 enum lttng_ust_abi_output {
-       LTTNG_UST_ABI_MMAP              = 0,
+       LTTNG_UST_ABI_MMAP = 0,
 };
 
 enum lttng_ust_abi_chan_type {
@@ -62,25 +63,25 @@ struct lttng_ust_abi_tracer_version {
        uint32_t patchlevel;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_CHANNEL_PADDING  (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_CHANNEL_PADDING (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 /*
  * Given that the consumerd is limited to 64k file descriptors, we
  * cannot expect much more than 1MB channel structure size. This size is
  * depends on the number of streams within a channel, which depends on
  * the number of possible CPUs on the system.
  */
-#define LTTNG_UST_ABI_CHANNEL_DATA_MAX_LEN     1048576U
+#define LTTNG_UST_ABI_CHANNEL_DATA_MAX_LEN 1048576U
 struct lttng_ust_abi_channel {
        uint64_t len;
-       int32_t type;   /* enum lttng_ust_abi_chan_type */
+       int32_t type; /* enum lttng_ust_abi_chan_type */
        char padding[LTTNG_UST_ABI_CHANNEL_PADDING];
-       char data[];    /* variable sized data */
+       char data[]; /* variable sized data */
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_STREAM_PADDING1  (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_STREAM_PADDING1 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_stream {
-       uint64_t len;           /* shm len */
-       uint32_t stream_nr;     /* stream number */
+       uint64_t len; /* shm len */
+       uint32_t stream_nr; /* stream number */
        char padding[LTTNG_UST_ABI_STREAM_PADDING1];
        /*
         * shm_fd and wakeup_fd are send over unix socket as file
@@ -110,8 +111,8 @@ struct lttng_ust_abi_counter_dimension {
 
 #define LTTNG_UST_ABI_COUNTER_CONF_PADDING1 67
 struct lttng_ust_abi_counter_conf {
-       uint32_t arithmetic;    /* enum lttng_ust_abi_counter_arithmetic */
-       uint32_t bitness;       /* enum lttng_ust_abi_counter_bitness */
+       uint32_t arithmetic; /* enum lttng_ust_abi_counter_arithmetic */
+       uint32_t bitness; /* enum lttng_ust_abi_counter_bitness */
        uint32_t number_dimensions;
        int64_t global_sum_step;
        struct lttng_ust_abi_counter_dimension dimensions[LTTNG_UST_ABI_COUNTER_DIMENSION_MAX];
@@ -125,15 +126,15 @@ struct lttng_ust_abi_counter_value {
        int64_t value;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_EVENT_PADDING1   8
-#define LTTNG_UST_ABI_EVENT_PADDING2   (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_EVENT_PADDING1 8
+#define LTTNG_UST_ABI_EVENT_PADDING2 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_event {
-       int32_t instrumentation;                /* enum lttng_ust_abi_instrumentation */
-       char name[LTTNG_UST_ABI_SYM_NAME_LEN];  /* event name */
+       int32_t instrumentation; /* enum lttng_ust_abi_instrumentation */
+       char name[LTTNG_UST_ABI_SYM_NAME_LEN]; /* event name */
 
-       int32_t loglevel_type;                  /* enum lttng_ust_abi_loglevel_type */
-       int32_t loglevel;                       /* value, -1: all */
-       uint64_t token;                         /* User-provided token */
+       int32_t loglevel_type; /* enum lttng_ust_abi_loglevel_type */
+       int32_t loglevel; /* value, -1: all */
+       uint64_t token; /* User-provided token */
        char padding[LTTNG_UST_ABI_EVENT_PADDING1];
 
        /* Per instrumentation type configuration */
@@ -142,7 +143,7 @@ struct lttng_ust_abi_event {
        } u;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_EVENT_NOTIFIER_PADDING   32
+#define LTTNG_UST_ABI_EVENT_NOTIFIER_PADDING 32
 struct lttng_ust_abi_event_notifier {
        struct lttng_ust_abi_event event;
        uint64_t error_counter_index;
@@ -156,68 +157,68 @@ struct lttng_ust_abi_event_notifier_notification {
        char padding[LTTNG_UST_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_COUNTER_PADDING1         (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
-#define LTTNG_UST_ABI_COUNTER_DATA_MAX_LEN     4096U
+#define LTTNG_UST_ABI_COUNTER_PADDING1    (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_COUNTER_DATA_MAX_LEN 4096U
 struct lttng_ust_abi_counter {
        uint64_t len;
        char padding[LTTNG_UST_ABI_COUNTER_PADDING1];
-       char data[];    /* variable sized data */
+       char data[]; /* variable sized data */
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_COUNTER_GLOBAL_PADDING1  (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_COUNTER_GLOBAL_PADDING1 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_counter_global {
-       uint64_t len;           /* shm len */
+       uint64_t len; /* shm len */
        char padding[LTTNG_UST_ABI_COUNTER_GLOBAL_PADDING1];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_COUNTER_CPU_PADDING1     (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_COUNTER_CPU_PADDING1 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_counter_cpu {
-       uint64_t len;           /* shm len */
+       uint64_t len; /* shm len */
        uint32_t cpu_nr;
        char padding[LTTNG_UST_ABI_COUNTER_CPU_PADDING1];
 } LTTNG_PACKED;
 
 enum lttng_ust_abi_field_type {
-       LTTNG_UST_ABI_FIELD_OTHER                       = 0,
-       LTTNG_UST_ABI_FIELD_INTEGER                     = 1,
-       LTTNG_UST_ABI_FIELD_ENUM                        = 2,
-       LTTNG_UST_ABI_FIELD_FLOAT                       = 3,
-       LTTNG_UST_ABI_FIELD_STRING                      = 4,
+       LTTNG_UST_ABI_FIELD_OTHER = 0,
+       LTTNG_UST_ABI_FIELD_INTEGER = 1,
+       LTTNG_UST_ABI_FIELD_ENUM = 2,
+       LTTNG_UST_ABI_FIELD_FLOAT = 3,
+       LTTNG_UST_ABI_FIELD_STRING = 4,
 };
 
-#define LTTNG_UST_ABI_FIELD_ITER_PADDING       (LTTNG_UST_ABI_SYM_NAME_LEN + 28)
+#define LTTNG_UST_ABI_FIELD_ITER_PADDING (LTTNG_UST_ABI_SYM_NAME_LEN + 28)
 struct lttng_ust_abi_field_iter {
        char event_name[LTTNG_UST_ABI_SYM_NAME_LEN];
        char field_name[LTTNG_UST_ABI_SYM_NAME_LEN];
-       int32_t type;                           /* enum lttng_ust_abi_field_type */
-       int loglevel;                           /* event loglevel */
+       int32_t type; /* enum lttng_ust_abi_field_type */
+       int loglevel; /* event loglevel */
        int nowrite;
        char padding[LTTNG_UST_ABI_FIELD_ITER_PADDING];
 } LTTNG_PACKED;
 
 enum lttng_ust_abi_context_type {
-       LTTNG_UST_ABI_CONTEXT_VTID                      = 0,
-       LTTNG_UST_ABI_CONTEXT_VPID                      = 1,
-       LTTNG_UST_ABI_CONTEXT_PTHREAD_ID                = 2,
-       LTTNG_UST_ABI_CONTEXT_PROCNAME                  = 3,
-       LTTNG_UST_ABI_CONTEXT_IP                        = 4,
-       LTTNG_UST_ABI_CONTEXT_PERF_THREAD_COUNTER       = 5,
-       LTTNG_UST_ABI_CONTEXT_CPU_ID                    = 6,
-       LTTNG_UST_ABI_CONTEXT_APP_CONTEXT               = 7,
-       LTTNG_UST_ABI_CONTEXT_CGROUP_NS                 = 8,
-       LTTNG_UST_ABI_CONTEXT_IPC_NS                    = 9,
-       LTTNG_UST_ABI_CONTEXT_MNT_NS                    = 10,
-       LTTNG_UST_ABI_CONTEXT_NET_NS                    = 11,
-       LTTNG_UST_ABI_CONTEXT_PID_NS                    = 12,
-       LTTNG_UST_ABI_CONTEXT_USER_NS                   = 13,
-       LTTNG_UST_ABI_CONTEXT_UTS_NS                    = 14,
-       LTTNG_UST_ABI_CONTEXT_VUID                      = 15,
-       LTTNG_UST_ABI_CONTEXT_VEUID                     = 16,
-       LTTNG_UST_ABI_CONTEXT_VSUID                     = 17,
-       LTTNG_UST_ABI_CONTEXT_VGID                      = 18,
-       LTTNG_UST_ABI_CONTEXT_VEGID                     = 19,
-       LTTNG_UST_ABI_CONTEXT_VSGID                     = 20,
-       LTTNG_UST_ABI_CONTEXT_TIME_NS                   = 21,
+       LTTNG_UST_ABI_CONTEXT_VTID = 0,
+       LTTNG_UST_ABI_CONTEXT_VPID = 1,
+       LTTNG_UST_ABI_CONTEXT_PTHREAD_ID = 2,
+       LTTNG_UST_ABI_CONTEXT_PROCNAME = 3,
+       LTTNG_UST_ABI_CONTEXT_IP = 4,
+       LTTNG_UST_ABI_CONTEXT_PERF_THREAD_COUNTER = 5,
+       LTTNG_UST_ABI_CONTEXT_CPU_ID = 6,
+       LTTNG_UST_ABI_CONTEXT_APP_CONTEXT = 7,
+       LTTNG_UST_ABI_CONTEXT_CGROUP_NS = 8,
+       LTTNG_UST_ABI_CONTEXT_IPC_NS = 9,
+       LTTNG_UST_ABI_CONTEXT_MNT_NS = 10,
+       LTTNG_UST_ABI_CONTEXT_NET_NS = 11,
+       LTTNG_UST_ABI_CONTEXT_PID_NS = 12,
+       LTTNG_UST_ABI_CONTEXT_USER_NS = 13,
+       LTTNG_UST_ABI_CONTEXT_UTS_NS = 14,
+       LTTNG_UST_ABI_CONTEXT_VUID = 15,
+       LTTNG_UST_ABI_CONTEXT_VEUID = 16,
+       LTTNG_UST_ABI_CONTEXT_VSUID = 17,
+       LTTNG_UST_ABI_CONTEXT_VGID = 18,
+       LTTNG_UST_ABI_CONTEXT_VEGID = 19,
+       LTTNG_UST_ABI_CONTEXT_VSGID = 20,
+       LTTNG_UST_ABI_CONTEXT_TIME_NS = 21,
 };
 
 struct lttng_ust_abi_perf_counter_ctx {
@@ -226,10 +227,10 @@ struct lttng_ust_abi_perf_counter_ctx {
        char name[LTTNG_UST_ABI_SYM_NAME_LEN];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_CONTEXT_PADDING1 16
-#define LTTNG_UST_ABI_CONTEXT_PADDING2 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_CONTEXT_PADDING1 16
+#define LTTNG_UST_ABI_CONTEXT_PADDING2 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_context {
-       int32_t ctx;     /* enum lttng_ust_abi_context_type */
+       int32_t ctx; /* enum lttng_ust_abi_context_type */
        char padding[LTTNG_UST_ABI_CONTEXT_PADDING1];
 
        union {
@@ -246,25 +247,25 @@ struct lttng_ust_abi_context {
 /*
  * Tracer channel attributes.
  */
-#define LTTNG_UST_ABI_CHANNEL_ATTR_PADDING     (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_CHANNEL_ATTR_PADDING (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_channel_attr {
-       uint64_t subbuf_size;                   /* bytes */
-       uint64_t num_subbuf;                    /* power of 2 */
-       int overwrite;                          /* 1: overwrite, 0: discard */
-       unsigned int switch_timer_interval;     /* usec */
-       unsigned int read_timer_interval;       /* usec */
-       int32_t output;                         /* enum lttng_ust_abi_output */
+       uint64_t subbuf_size; /* bytes */
+       uint64_t num_subbuf; /* power of 2 */
+       int overwrite; /* 1: overwrite, 0: discard */
+       unsigned int switch_timer_interval; /* usec */
+       unsigned int read_timer_interval; /* usec */
+       int32_t output; /* enum lttng_ust_abi_output */
        union {
                struct {
-                       int64_t blocking_timeout;       /* Blocking timeout (usec) */
+                       int64_t blocking_timeout; /* Blocking timeout (usec) */
                } s;
                char padding[LTTNG_UST_ABI_CHANNEL_ATTR_PADDING];
        } u;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_TRACEPOINT_ITER_PADDING  16
+#define LTTNG_UST_ABI_TRACEPOINT_ITER_PADDING 16
 struct lttng_ust_abi_tracepoint_iter {
-       char name[LTTNG_UST_ABI_SYM_NAME_LEN];  /* provider:name */
+       char name[LTTNG_UST_ABI_SYM_NAME_LEN]; /* provider:name */
        int loglevel;
        char padding[LTTNG_UST_ABI_TRACEPOINT_ITER_PADDING];
 } LTTNG_PACKED;
@@ -282,18 +283,18 @@ enum lttng_ust_abi_object_type {
        LTTNG_UST_ABI_OBJECT_TYPE_COUNTER_CPU = 8,
 };
 
-#define LTTNG_UST_ABI_OBJECT_DATA_PADDING1     32
-#define LTTNG_UST_ABI_OBJECT_DATA_PADDING2     (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_OBJECT_DATA_PADDING1 32
+#define LTTNG_UST_ABI_OBJECT_DATA_PADDING2 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 
 struct lttng_ust_abi_object_data {
-       int32_t type;   /* enum lttng_ust_abi_object_type */
+       int32_t type; /* enum lttng_ust_abi_object_type */
        int handle;
        uint64_t size;
        char padding1[LTTNG_UST_ABI_OBJECT_DATA_PADDING1];
        union {
                struct {
                        void *data;
-                       int32_t type;   /* enum lttng_ust_abi_chan_type */
+                       int32_t type; /* enum lttng_ust_abi_chan_type */
                        int wakeup_fd;
                } channel;
                struct {
@@ -319,10 +320,10 @@ enum lttng_ust_abi_calibrate_type {
        LTTNG_UST_ABI_CALIBRATE_TRACEPOINT,
 };
 
-#define LTTNG_UST_ABI_CALIBRATE_PADDING1       16
-#define LTTNG_UST_ABI_CALIBRATE_PADDING2       (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
+#define LTTNG_UST_ABI_CALIBRATE_PADDING1 16
+#define LTTNG_UST_ABI_CALIBRATE_PADDING2 (LTTNG_UST_ABI_SYM_NAME_LEN + 32)
 struct lttng_ust_abi_calibrate {
-       enum lttng_ust_abi_calibrate_type type;         /* type (input) */
+       enum lttng_ust_abi_calibrate_type type; /* type (input) */
        char padding[LTTNG_UST_ABI_CALIBRATE_PADDING1];
 
        union {
@@ -330,8 +331,8 @@ struct lttng_ust_abi_calibrate {
        } u;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_FILTER_BYTECODE_MAX_LEN  65536
-#define LTTNG_UST_ABI_FILTER_PADDING           32
+#define LTTNG_UST_ABI_FILTER_BYTECODE_MAX_LEN 65536
+#define LTTNG_UST_ABI_FILTER_PADDING         32
 struct lttng_ust_abi_filter_bytecode {
        uint32_t len;
        uint32_t reloc_offset;
@@ -340,8 +341,8 @@ struct lttng_ust_abi_filter_bytecode {
        char data[0];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_CAPTURE_BYTECODE_MAX_LEN 65536
-#define LTTNG_UST_ABI_CAPTURE_PADDING          32
+#define LTTNG_UST_ABI_CAPTURE_BYTECODE_MAX_LEN 65536
+#define LTTNG_UST_ABI_CAPTURE_PADDING         32
 struct lttng_ust_abi_capture_bytecode {
        uint32_t len;
        uint32_t reloc_offset;
@@ -350,80 +351,71 @@ struct lttng_ust_abi_capture_bytecode {
        char data[0];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_EXCLUSION_PADDING        32
+#define LTTNG_UST_ABI_EXCLUSION_PADDING 32
 struct lttng_ust_abi_event_exclusion {
        uint32_t count;
        char padding[LTTNG_UST_ABI_EXCLUSION_PADDING];
        char names[LTTNG_UST_ABI_SYM_NAME_LEN][0];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_ABI_CMD(minor)               (minor)
-#define LTTNG_UST_ABI_CMDR(minor, type)                (minor)
-#define LTTNG_UST_ABI_CMDW(minor, type)                (minor)
+#define LTTNG_UST_ABI_CMD(minor)       (minor)
+#define LTTNG_UST_ABI_CMDR(minor, type) (minor)
+#define LTTNG_UST_ABI_CMDW(minor, type) (minor)
 
 /* Handled by object descriptor */
-#define LTTNG_UST_ABI_RELEASE                  LTTNG_UST_ABI_CMD(0x1)
+#define LTTNG_UST_ABI_RELEASE LTTNG_UST_ABI_CMD(0x1)
 
 /* Handled by object cmd */
 
 /* LTTng-UST commands */
-#define LTTNG_UST_ABI_SESSION                  LTTNG_UST_ABI_CMD(0x40)
-#define LTTNG_UST_ABI_TRACER_VERSION           \
-       LTTNG_UST_ABI_CMDR(0x41, struct lttng_ust_abi_tracer_version)
-#define LTTNG_UST_ABI_TRACEPOINT_LIST          LTTNG_UST_ABI_CMD(0x42)
-#define LTTNG_UST_ABI_WAIT_QUIESCENT           LTTNG_UST_ABI_CMD(0x43)
-#define LTTNG_UST_ABI_REGISTER_DONE            LTTNG_UST_ABI_CMD(0x44)
-#define LTTNG_UST_ABI_TRACEPOINT_FIELD_LIST    LTTNG_UST_ABI_CMD(0x45)
-#define LTTNG_UST_ABI_EVENT_NOTIFIER_GROUP_CREATE \
-       LTTNG_UST_ABI_CMD(0x46)
+#define LTTNG_UST_ABI_SESSION                    LTTNG_UST_ABI_CMD(0x40)
+#define LTTNG_UST_ABI_TRACER_VERSION             LTTNG_UST_ABI_CMDR(0x41, struct lttng_ust_abi_tracer_version)
+#define LTTNG_UST_ABI_TRACEPOINT_LIST            LTTNG_UST_ABI_CMD(0x42)
+#define LTTNG_UST_ABI_WAIT_QUIESCENT             LTTNG_UST_ABI_CMD(0x43)
+#define LTTNG_UST_ABI_REGISTER_DONE              LTTNG_UST_ABI_CMD(0x44)
+#define LTTNG_UST_ABI_TRACEPOINT_FIELD_LIST      LTTNG_UST_ABI_CMD(0x45)
+#define LTTNG_UST_ABI_EVENT_NOTIFIER_GROUP_CREATE LTTNG_UST_ABI_CMD(0x46)
 
 /* Session commands */
-#define LTTNG_UST_ABI_CHANNEL                  \
-       LTTNG_UST_ABI_CMDW(0x51, struct lttng_ust_abi_channel)
-#define LTTNG_UST_ABI_SESSION_START            LTTNG_UST_ABI_CMD(0x52)
-#define LTTNG_UST_ABI_SESSION_STOP             LTTNG_UST_ABI_CMD(0x53)
-#define LTTNG_UST_ABI_SESSION_STATEDUMP                LTTNG_UST_ABI_CMD(0x54)
+#define LTTNG_UST_ABI_CHANNEL          LTTNG_UST_ABI_CMDW(0x51, struct lttng_ust_abi_channel)
+#define LTTNG_UST_ABI_SESSION_START    LTTNG_UST_ABI_CMD(0x52)
+#define LTTNG_UST_ABI_SESSION_STOP     LTTNG_UST_ABI_CMD(0x53)
+#define LTTNG_UST_ABI_SESSION_STATEDUMP LTTNG_UST_ABI_CMD(0x54)
 
 /* Channel commands */
-#define LTTNG_UST_ABI_STREAM                   LTTNG_UST_ABI_CMD(0x60)
-#define LTTNG_UST_ABI_EVENT                    \
-       LTTNG_UST_ABI_CMDW(0x61, struct lttng_ust_abi_event)
+#define LTTNG_UST_ABI_STREAM LTTNG_UST_ABI_CMD(0x60)
+#define LTTNG_UST_ABI_EVENT  LTTNG_UST_ABI_CMDW(0x61, struct lttng_ust_abi_event)
 
 /* Event and channel commands */
-#define LTTNG_UST_ABI_CONTEXT                  \
-       LTTNG_UST_ABI_CMDW(0x70, struct lttng_ust_abi_context)
-#define LTTNG_UST_ABI_FLUSH_BUFFER             \
-       LTTNG_UST_ABI_CMD(0x71)
+#define LTTNG_UST_ABI_CONTEXT     LTTNG_UST_ABI_CMDW(0x70, struct lttng_ust_abi_context)
+#define LTTNG_UST_ABI_FLUSH_BUFFER LTTNG_UST_ABI_CMD(0x71)
 
 /* Event, event notifier, channel and session commands */
-#define LTTNG_UST_ABI_ENABLE                   LTTNG_UST_ABI_CMD(0x80)
-#define LTTNG_UST_ABI_DISABLE                  LTTNG_UST_ABI_CMD(0x81)
+#define LTTNG_UST_ABI_ENABLE  LTTNG_UST_ABI_CMD(0x80)
+#define LTTNG_UST_ABI_DISABLE LTTNG_UST_ABI_CMD(0x81)
 
 /* Tracepoint list commands */
 #define LTTNG_UST_ABI_TRACEPOINT_LIST_GET      LTTNG_UST_ABI_CMD(0x90)
-#define LTTNG_UST_ABI_TRACEPOINT_FIELD_LIST_GET        LTTNG_UST_ABI_CMD(0x91)
+#define LTTNG_UST_ABI_TRACEPOINT_FIELD_LIST_GET LTTNG_UST_ABI_CMD(0x91)
 
 /* Event and event notifier commands */
-#define LTTNG_UST_ABI_FILTER                   LTTNG_UST_ABI_CMD(0xA0)
-#define LTTNG_UST_ABI_EXCLUSION                        LTTNG_UST_ABI_CMD(0xA1)
+#define LTTNG_UST_ABI_FILTER   LTTNG_UST_ABI_CMD(0xA0)
+#define LTTNG_UST_ABI_EXCLUSION LTTNG_UST_ABI_CMD(0xA1)
 
 /* Event notifier group commands */
-#define LTTNG_UST_ABI_EVENT_NOTIFIER_CREATE    \
+#define LTTNG_UST_ABI_EVENT_NOTIFIER_CREATE \
        LTTNG_UST_ABI_CMDW(0xB0, struct lttng_ust_abi_event_notifier)
 
 /* Event notifier commands */
-#define LTTNG_UST_ABI_CAPTURE                  LTTNG_UST_ABI_CMD(0xB6)
+#define LTTNG_UST_ABI_CAPTURE LTTNG_UST_ABI_CMD(0xB6)
 
 /* Session and event notifier group commands */
-#define LTTNG_UST_ABI_COUNTER                  \
-       LTTNG_UST_ABI_CMDW(0xC0, struct lttng_ust_abi_counter)
+#define LTTNG_UST_ABI_COUNTER LTTNG_UST_ABI_CMDW(0xC0, struct lttng_ust_abi_counter)
 
 /* Counter commands */
-#define LTTNG_UST_ABI_COUNTER_GLOBAL           \
-       LTTNG_UST_ABI_CMDW(0xD0, struct lttng_ust_abi_counter_global)
-#define LTTNG_UST_ABI_COUNTER_CPU              \
-       LTTNG_UST_ABI_CMDW(0xD1, struct lttng_ust_abi_counter_cpu)
+#define LTTNG_UST_ABI_COUNTER_GLOBAL LTTNG_UST_ABI_CMDW(0xD0, struct lttng_ust_abi_counter_global)
+#define LTTNG_UST_ABI_COUNTER_CPU    LTTNG_UST_ABI_CMDW(0xD1, struct lttng_ust_abi_counter_cpu)
 
-#define LTTNG_UST_ABI_ROOT_HANDLE      0
+#define LTTNG_UST_ABI_ROOT_HANDLE 0
 
 #endif /* LTTNG_UST_ABI_INTERNAL_H */
index 3200b654986596fb2eda518f96da35e2bccb097e..fdc00785335322d5c73c0f18d215d17296011233 100644 (file)
@@ -9,22 +9,22 @@
 #ifndef _LTT_UST_APP_H
 #define _LTT_UST_APP_H
 
-#include <stdint.h>
+#include "session.hpp"
+#include "trace-ust.hpp"
+#include "ust-field-convert.hpp"
+#include "ust-registry-session.hpp"
+#include "ust-registry.hpp"
 
-#include <common/index-allocator.hpp>
 #include <common/format.hpp>
+#include <common/index-allocator.hpp>
 #include <common/uuid.hpp>
 
-#include "trace-ust.hpp"
-#include "ust-registry.hpp"
-#include "ust-registry-session.hpp"
-#include "session.hpp"
-#include "ust-field-convert.hpp"
+#include <stdint.h>
 
 #define UST_APP_EVENT_LIST_SIZE 32
 
 /* Process name (short). */
-#define UST_APP_PROCNAME_LEN   16
+#define UST_APP_PROCNAME_LEN 16
 
 struct lttng_bytecode;
 struct lttng_ust_filter_bytecode;
@@ -67,7 +67,7 @@ struct ust_register_msg {
        uint32_t uint32_t_alignment;
        uint32_t uint64_t_alignment;
        uint32_t long_alignment;
-       int byte_order;         /* BIG_ENDIAN or LITTLE_ENDIAN */
+       int byte_order; /* BIG_ENDIAN or LITTLE_ENDIAN */
        char name[LTTNG_UST_ABI_PROCNAME_LEN];
 };
 
@@ -198,17 +198,17 @@ struct ust_app_session {
 
        bool enabled;
        /* started: has the session been in started state at any time ? */
-       bool started;  /* allows detection of start vs restart. */
-       int handle;   /* used has unique identifier for app session */
+       bool started; /* allows detection of start vs restart. */
+       int handle; /* used has unique identifier for app session */
 
-       bool deleted;   /* Session deleted flag. Check with lock held. */
+       bool deleted; /* Session deleted flag. Check with lock held. */
 
        /*
         * Tracing session ID. Multiple ust app session can have the same tracing
         * session id making this value NOT unique to the object.
         */
        uint64_t tracing_id;
-       uint64_t id;    /* Unique session identifier */
+       uint64_t id; /* Unique session identifier */
        struct lttng_ht *channels; /* Registered channels */
        struct lttng_ht_node_u64 node;
        /*
@@ -235,7 +235,7 @@ struct ust_app_session {
        struct rcu_head rcu_head;
        /* If the channel's streams have to be outputed or not. */
        unsigned int output_traces;
-       unsigned int live_timer_interval;       /* usec */
+       unsigned int live_timer_interval; /* usec */
 
        /* Metadata channel attributes. */
        struct lttng_ust_ctl_consumer_channel_attr metadata_attr;
@@ -251,14 +251,14 @@ struct ust_app_session {
 struct ust_app {
        /* Traffic initiated from the session daemon to the application. */
        int sock;
-       pthread_mutex_t sock_lock;      /* Protects sock protocol. */
+       pthread_mutex_t sock_lock; /* Protects sock protocol. */
 
        /* Traffic initiated from the application to the session daemon. */
        int notify_sock;
        pid_t pid;
        pid_t ppid;
-       uid_t uid;           /* User ID that owns the apps */
-       gid_t gid;           /* Group ID that owns the apps */
+       uid_t uid; /* User ID that owns the apps */
+       gid_t gid; /* Group ID that owns the apps */
 
        /* App ABI. */
        lttng::sessiond::trace::abi abi;
@@ -267,8 +267,8 @@ struct ust_app {
                                           supported version of the session daemon, this flag is
                                           set to 0 (NOT compatible) else 1. */
        struct lttng_ust_abi_tracer_version version;
-       uint32_t v_major;    /* Version major number */
-       uint32_t v_minor;    /* Version minor number */
+       uint32_t v_major; /* Version major number */
+       uint32_t v_minor; /* Version minor number */
        /* Extra for the NULL byte. */
        char name[UST_APP_PROCNAME_LEN + 1];
        /* Type of buffer this application uses. */
@@ -341,11 +341,17 @@ struct formatter<ust_app> : formatter<std::string> {
        template <typename FormatContextType>
        typename FormatContextType::iterator format(const ust_app& app, FormatContextType& ctx)
        {
-               return format_to(ctx.out(),
-                               "{{ procname = `{}`, ppid = {}, pid = {}, uid = {}, gid = {}, version = {}.{}, registration time = {} }}",
-                               app.name, app.ppid, app.pid, app.uid, app.gid, app.v_major,
-                               app.v_minor,
-                               lttng::utils::time_to_iso8601_str(app.registration_time));
+               return format_to(
+                       ctx.out(),
+                       "{{ procname = `{}`, ppid = {}, pid = {}, uid = {}, gid = {}, version = {}.{}, registration time = {} }}",
+                       app.name,
+                       app.ppid,
+                       app.pid,
+                       app.uid,
+                       app.gid,
+                       app.v_major,
+                       app.v_minor,
+                       lttng::utils::time_to_iso8601_str(app.registration_time));
        }
 };
 } /* namespace fmt */
@@ -362,17 +368,19 @@ int ust_app_destroy_trace_all(struct ltt_ust_session *usess);
 int ust_app_list_events(struct lttng_event **events);
 int ust_app_list_event_fields(struct lttng_event_field **fields);
 int ust_app_create_event_glb(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
-int ust_app_disable_channel_glb(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan);
-int ust_app_enable_channel_glb(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan);
+                            struct ltt_ust_channel *uchan,
+                            struct ltt_ust_event *uevent);
+int ust_app_disable_channel_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan);
+int ust_app_enable_channel_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan);
 int ust_app_enable_event_glb(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
+                            struct ltt_ust_channel *uchan,
+                            struct ltt_ust_event *uevent);
 int ust_app_disable_event_glb(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
+                             struct ltt_ust_channel *uchan,
+                             struct ltt_ust_event *uevent);
 int ust_app_add_ctx_channel_glb(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan, struct ltt_ust_context *uctx);
+                               struct ltt_ust_channel *uchan,
+                               struct ltt_ust_context *uctx);
 void ust_app_global_update(struct ltt_ust_session *usess, struct ust_app *app);
 void ust_app_global_update_all(struct ltt_ust_session *usess);
 void ust_app_global_update_event_notifier_rules(struct ust_app *app);
@@ -388,37 +396,38 @@ void ust_app_add(struct ust_app *app);
 struct ust_app *ust_app_create(struct ust_register_msg *msg, int sock);
 void ust_app_notify_sock_unregister(int sock);
 ssize_t ust_app_push_metadata(const lttng::sessiond::ust::registry_session::locked_ptr& registry,
-               struct consumer_socket *socket,
-               int send_zero_data);
+                             struct consumer_socket *socket,
+                             int send_zero_data);
 void ust_app_destroy(struct ust_app *app);
-enum lttng_error_code ust_app_snapshot_record(
-               const struct ltt_ust_session *usess,
-               const struct consumer_output *output,
-               uint64_t nb_packets_per_stream);
-uint64_t ust_app_get_size_one_more_packet_per_stream(
-               const struct ltt_ust_session *usess, uint64_t cur_nr_packets);
+enum lttng_error_code ust_app_snapshot_record(const struct ltt_ust_session *usess,
+                                             const struct consumer_output *output,
+                                             uint64_t nb_packets_per_stream);
+uint64_t ust_app_get_size_one_more_packet_per_stream(const struct ltt_ust_session *usess,
+                                                    uint64_t cur_nr_packets);
 struct ust_app *ust_app_find_by_sock(int sock);
 int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id,
-               struct cds_list_head *buffer_reg_uid_list,
-               struct consumer_output *consumer, uint64_t uchan_id,
-               int overwrite, uint64_t *discarded, uint64_t *lost);
+                                         struct cds_list_head *buffer_reg_uid_list,
+                                         struct consumer_output *consumer,
+                                         uint64_t uchan_id,
+                                         int overwrite,
+                                         uint64_t *discarded,
+                                         uint64_t *lost);
 int ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess,
-               struct ltt_ust_channel *uchan,
-               struct consumer_output *consumer,
-               int overwrite, uint64_t *discarded, uint64_t *lost);
+                                         struct ltt_ust_channel *uchan,
+                                         struct consumer_output *consumer,
+                                         int overwrite,
+                                         uint64_t *discarded,
+                                         uint64_t *lost);
 int ust_app_regenerate_statedump_all(struct ltt_ust_session *usess);
 enum lttng_error_code ust_app_rotate_session(struct ltt_session *session);
-enum lttng_error_code ust_app_create_channel_subdirectories(
-               const struct ltt_ust_session *session);
-int ust_app_release_object(struct ust_app *app,
-               struct lttng_ust_abi_object_data *data);
+enum lttng_error_code ust_app_create_channel_subdirectories(const struct ltt_ust_session *session);
+int ust_app_release_object(struct ust_app *app, struct lttng_ust_abi_object_data *data);
 enum lttng_error_code ust_app_clear_session(struct ltt_session *session);
 enum lttng_error_code ust_app_open_packets(struct ltt_session *session);
 
 int ust_app_setup_event_notifier_group(struct ust_app *app);
 
-static inline
-int ust_app_supported()
+static inline int ust_app_supported()
 {
        return 1;
 }
@@ -428,353 +437,293 @@ bool ust_app_supports_counters(const struct ust_app *app);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline
-int ust_app_destroy_trace_all(
-               struct ltt_ust_session *usess __attribute__((unused)))
+static inline int ust_app_destroy_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_start_trace(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ust_app *app __attribute__((unused)))
+static inline int ust_app_start_trace(struct ltt_ust_session *usess __attribute__((unused)),
+                                     struct ust_app *app __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_start_trace_all(
-               struct ltt_ust_session *usess __attribute__((unused)))
+static inline int ust_app_start_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_stop_trace_all(
-               struct ltt_ust_session *usess __attribute__((unused)))
+static inline int ust_app_stop_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_list_events(
-               struct lttng_event **events __attribute__((unused)))
+static inline int ust_app_list_events(struct lttng_event **events __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int ust_app_list_event_fields(
-               struct lttng_event_field **fields __attribute__((unused)))
+static inline int ust_app_list_event_fields(struct lttng_event_field **fields
+                                           __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int ust_app_register(
-               struct ust_register_msg *msg __attribute__((unused)),
-               int sock __attribute__((unused)))
+static inline int ust_app_register(struct ust_register_msg *msg __attribute__((unused)),
+                                  int sock __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int ust_app_register_done(struct ust_app *app __attribute__((unused)))
+static inline int ust_app_register_done(struct ust_app *app __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int ust_app_version(struct ust_app *app __attribute__((unused)))
+static inline int ust_app_version(struct ust_app *app __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-void ust_app_unregister(int sock __attribute__((unused)))
+static inline void ust_app_unregister(int sock __attribute__((unused)))
 {
 }
 
-static inline
-void ust_app_clean_list(void)
+static inline void ust_app_clean_list(void)
 {
 }
 
-static inline
-struct ust_app_list *ust_app_get_list(void)
+static inline struct ust_app_list *ust_app_get_list(void)
 {
        return NULL;
 }
 
-static inline
-struct ust_app *ust_app_get_by_pid(pid_t pid __attribute__((unused)))
+static inline struct ust_app *ust_app_get_by_pid(pid_t pid __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-int ust_app_ht_alloc(void)
+static inline int ust_app_ht_alloc(void)
 {
        return 0;
 }
 
-static inline
-void ust_app_global_update(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ust_app *app __attribute__((unused)))
-{}
+static inline void ust_app_global_update(struct ltt_ust_session *usess __attribute__((unused)),
+                                        struct ust_app *app __attribute__((unused)))
+{
+}
 
-static inline
-void ust_app_global_update_event_notifier_rules(
-               struct ust_app *app __attribute__((unused)))
-{}
+static inline void ust_app_global_update_event_notifier_rules(struct ust_app *app
+                                                             __attribute__((unused)))
+{
+}
 
-static inline
-void ust_app_global_update_all_event_notifier_rules(void)
-{}
+static inline void ust_app_global_update_all_event_notifier_rules(void)
+{
+}
 
-static inline
-int ust_app_setup_event_notifier_group(
-               struct ust_app *app __attribute__((unused)))
+static inline int ust_app_setup_event_notifier_group(struct ust_app *app __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_disable_channel_glb(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)))
+static inline int ust_app_disable_channel_glb(struct ltt_ust_session *usess __attribute__((unused)),
+                                             struct ltt_ust_channel *uchan __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_enable_channel_glb(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)))
+static inline int ust_app_enable_channel_glb(struct ltt_ust_session *usess __attribute__((unused)),
+                                            struct ltt_ust_channel *uchan __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_create_event_glb(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)),
-               struct ltt_ust_event *uevent __attribute__((unused)))
+static inline int ust_app_create_event_glb(struct ltt_ust_session *usess __attribute__((unused)),
+                                          struct ltt_ust_channel *uchan __attribute__((unused)),
+                                          struct ltt_ust_event *uevent __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_disable_event_glb(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)),
-               struct ltt_ust_event *uevent __attribute__((unused)))
+static inline int ust_app_disable_event_glb(struct ltt_ust_session *usess __attribute__((unused)),
+                                           struct ltt_ust_channel *uchan __attribute__((unused)),
+                                           struct ltt_ust_event *uevent __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_enable_event_glb(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)),
-               struct ltt_ust_event *uevent __attribute__((unused)))
+static inline int ust_app_enable_event_glb(struct ltt_ust_session *usess __attribute__((unused)),
+                                          struct ltt_ust_channel *uchan __attribute__((unused)),
+                                          struct ltt_ust_event *uevent __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_add_ctx_channel_glb(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)),
-               struct ltt_ust_context *uctx __attribute__((unused)))
+static inline int ust_app_add_ctx_channel_glb(struct ltt_ust_session *usess __attribute__((unused)),
+                                             struct ltt_ust_channel *uchan __attribute__((unused)),
+                                             struct ltt_ust_context *uctx __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_enable_event_pid(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)),
-               struct ltt_ust_event *uevent __attribute__((unused)),
-               pid_t pid __attribute__((unused)))
+static inline int ust_app_enable_event_pid(struct ltt_ust_session *usess __attribute__((unused)),
+                                          struct ltt_ust_channel *uchan __attribute__((unused)),
+                                          struct ltt_ust_event *uevent __attribute__((unused)),
+                                          pid_t pid __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_recv_registration(
-               int sock __attribute__((unused)),
-               struct ust_register_msg *msg __attribute__((unused)))
+static inline int ust_app_recv_registration(int sock __attribute__((unused)),
+                                           struct ust_register_msg *msg __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_recv_notify(int sock __attribute__((unused)))
+static inline int ust_app_recv_notify(int sock __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-struct ust_app *ust_app_create(
-               struct ust_register_msg *msg __attribute__((unused)),
-               int sock __attribute__((unused)))
+static inline struct ust_app *ust_app_create(struct ust_register_msg *msg __attribute__((unused)),
+                                            int sock __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-void ust_app_add(struct ust_app *app __attribute__((unused)))
+static inline void ust_app_add(struct ust_app *app __attribute__((unused)))
 {
 }
 
-static inline
-void ust_app_notify_sock_unregister(int sock __attribute__((unused)))
+static inline void ust_app_notify_sock_unregister(int sock __attribute__((unused)))
 {
 }
 
-static inline
-ssize_t ust_app_push_metadata(
-               lttng::sessiond::ust::registry_session *registry __attribute__((unused)),
-               struct consumer_socket *socket __attribute__((unused)),
-               int send_zero_data __attribute__((unused)))
+static inline ssize_t ust_app_push_metadata(lttng::sessiond::ust::registry_session *registry
+                                           __attribute__((unused)),
+                                           struct consumer_socket *socket __attribute__((unused)),
+                                           int send_zero_data __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-void ust_app_destroy(struct ust_app *app __attribute__((unused)))
+static inline void ust_app_destroy(struct ust_app *app __attribute__((unused)))
 {
        return;
 }
 
-static inline
-enum lttng_error_code ust_app_snapshot_record(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               const struct consumer_output *output __attribute__((unused)),
-               uint64_t max_stream_size __attribute__((unused)))
+static inline enum lttng_error_code
+ust_app_snapshot_record(struct ltt_ust_session *usess __attribute__((unused)),
+                       const struct consumer_output *output __attribute__((unused)),
+                       uint64_t max_stream_size __attribute__((unused)))
 {
        return LTTNG_ERR_UNK;
 }
 
-static inline
-unsigned int ust_app_get_nb_stream(
-               struct ltt_ust_session *usess __attribute__((unused)))
+static inline unsigned int ust_app_get_nb_stream(struct ltt_ust_session *usess
+                                                __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-void ust_app_update_event_notifier_error_count(
-               struct lttng_trigger *lttng_trigger __attribute__((unused)))
+static inline void ust_app_update_event_notifier_error_count(struct lttng_trigger *lttng_trigger
+                                                            __attribute__((unused)))
 {
        return;
 }
 
-static inline
-int ust_app_supported(void)
+static inline int ust_app_supported(void)
 {
        return 0;
 }
 
-static inline
-bool ust_app_supports_notifiers(
-               const struct ust_app *app __attribute__((unused)))
+static inline bool ust_app_supports_notifiers(const struct ust_app *app __attribute__((unused)))
 {
        return false;
 }
 
-static inline
-bool ust_app_supports_counters(
-               const struct ust_app *app __attribute__((unused)))
+static inline bool ust_app_supports_counters(const struct ust_app *app __attribute__((unused)))
 {
        return false;
 }
 
-static inline
-struct ust_app *ust_app_find_by_sock(int sock __attribute__((unused)))
+static inline struct ust_app *ust_app_find_by_sock(int sock __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-struct ust_app *ust_app_find_by_pid(pid_t pid __attribute__((unused)))
+static inline struct ust_app *ust_app_find_by_pid(pid_t pid __attribute__((unused)))
 {
        return NULL;
 }
 
-static inline
-uint64_t ust_app_get_size_one_more_packet_per_stream(
-               const struct ltt_ust_session *usess __attribute__((unused)),
-               uint64_t cur_nr_packets __attribute__((unused))) {
+static inline uint64_t
+ust_app_get_size_one_more_packet_per_stream(const struct ltt_ust_session *usess
+                                           __attribute__((unused)),
+                                           uint64_t cur_nr_packets __attribute__((unused)))
+{
        return 0;
 }
 
-static inline
-int ust_app_uid_get_channel_runtime_stats(
-               uint64_t ust_session_id __attribute__((unused)),
-               struct cds_list_head *buffer_reg_uid_list __attribute__((unused)),
-               struct consumer_output *consumer __attribute__((unused)),
-               int overwrite __attribute__((unused)),
-               uint64_t uchan_id __attribute__((unused)),
-               uint64_t *discarded __attribute__((unused)),
-               uint64_t *lost __attribute__((unused)))
+static inline int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id
+                                                       __attribute__((unused)),
+                                                       struct cds_list_head *buffer_reg_uid_list
+                                                       __attribute__((unused)),
+                                                       struct consumer_output *consumer
+                                                       __attribute__((unused)),
+                                                       int overwrite __attribute__((unused)),
+                                                       uint64_t uchan_id __attribute__((unused)),
+                                                       uint64_t *discarded __attribute__((unused)),
+                                                       uint64_t *lost __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_pid_get_channel_runtime_stats(
-               struct ltt_ust_session *usess __attribute__((unused)),
-               struct ltt_ust_channel *uchan __attribute__((unused)),
-               struct consumer_output *consumer __attribute__((unused)),
-               int overwrite __attribute__((unused)),
-               uint64_t *discarded __attribute__((unused)),
-               uint64_t *lost __attribute__((unused)))
+static inline int
+ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess __attribute__((unused)),
+                                     struct ltt_ust_channel *uchan __attribute__((unused)),
+                                     struct consumer_output *consumer __attribute__((unused)),
+                                     int overwrite __attribute__((unused)),
+                                     uint64_t *discarded __attribute__((unused)),
+                                     uint64_t *lost __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_app_regenerate_statedump_all(
-               struct ltt_ust_session *usess __attribute__((unused)))
+static inline int ust_app_regenerate_statedump_all(struct ltt_ust_session *usess
+                                                  __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-enum lttng_error_code ust_app_rotate_session(
-               struct ltt_session *session __attribute__((unused)))
+static inline enum lttng_error_code ust_app_rotate_session(struct ltt_session *session
+                                                          __attribute__((unused)))
 {
        return LTTNG_ERR_UNK;
 }
 
-static inline
-enum lttng_error_code ust_app_create_channel_subdirectories(
-               const struct ltt_ust_session *session __attribute__((unused)))
+static inline enum lttng_error_code
+ust_app_create_channel_subdirectories(const struct ltt_ust_session *session __attribute__((unused)))
 {
        return LTTNG_ERR_UNK;
 }
 
-static inline
-int ust_app_release_object(struct ust_app *app __attribute__((unused)),
-               struct lttng_ust_abi_object_data *data __attribute__((unused)))
+static inline int ust_app_release_object(struct ust_app *app __attribute__((unused)),
+                                        struct lttng_ust_abi_object_data *data
+                                        __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-enum lttng_error_code ust_app_clear_session(
-               struct ltt_session *session __attribute__((unused)))
+static inline enum lttng_error_code ust_app_clear_session(struct ltt_session *session
+                                                         __attribute__((unused)))
 {
        return LTTNG_ERR_UNK;
 }
 
-static inline
-enum lttng_error_code ust_app_open_packets(
-               struct ltt_session *session __attribute__((unused)))
+static inline enum lttng_error_code ust_app_open_packets(struct ltt_session *session
+                                                        __attribute__((unused)))
 {
        return LTTNG_ERR_UNK;
 }
index f752131b63b6e28fbe54b93e5561c477cfb44bf9..9fc83e6abf790458f3f989e351dcd7924de8de41 100644 (file)
 
 #include "consumer.hpp"
 #include "ust-app.hpp"
-#include <stdint.h>
+
 #include <common/trace-chunk.hpp>
 
+#include <stdint.h>
+
 int ust_consumer_ask_channel(struct ust_app_session *ua_sess,
-               struct ust_app_channel *ua_chan,
-               struct consumer_output *consumer,
-               struct consumer_socket *socket,
-               lttng::sessiond::ust::registry_session *registry,
-               struct lttng_trace_chunk *trace_chunk);
+                            struct ust_app_channel *ua_chan,
+                            struct consumer_output *consumer,
+                            struct consumer_socket *socket,
+                            lttng::sessiond::ust::registry_session *registry,
+                            struct lttng_trace_chunk *trace_chunk);
 
-int ust_consumer_get_channel(struct consumer_socket *socket,
-               struct ust_app_channel *ua_chan);
+int ust_consumer_get_channel(struct consumer_socket *socket, struct ust_app_channel *ua_chan);
 
-int ust_consumer_destroy_channel(struct consumer_socket *socket,
-               struct ust_app_channel *ua_chan);
+int ust_consumer_destroy_channel(struct consumer_socket *socket, struct ust_app_channel *ua_chan);
 
 int ust_consumer_send_stream_to_ust(struct ust_app *app,
-               struct ust_app_channel *channel, struct ust_app_stream *stream);
+                                   struct ust_app_channel *channel,
+                                   struct ust_app_stream *stream);
 
 int ust_consumer_send_channel_to_ust(struct ust_app *app,
-               struct ust_app_session *ua_sess, struct ust_app_channel *channel);
+                                    struct ust_app_session *ua_sess,
+                                    struct ust_app_channel *channel);
 
 #ifdef HAVE_LIBLTTNG_UST_CTL
 int ust_consumer_metadata_request(struct consumer_socket *sock);
 #else
-static inline
-int ust_consumer_metadata_request(
-               struct consumer_socket *sock __attribute__((unused)))
+static inline int ust_consumer_metadata_request(struct consumer_socket *sock
+                                               __attribute__((unused)))
 {
        return -ENOSYS;
 }
index aee3cd580adeeca45e328c0242c010b72db0cf61..661c947259937c3fc0caf5ae24bd1ead35f48397 100644 (file)
@@ -9,42 +9,40 @@
 #ifndef LTTNG_UST_CTL_INTERNAL_H
 #define LTTNG_UST_CTL_INTERNAL_H
 
-#include <sys/types.h>
-#include <limits.h>
-
 #include "lttng-ust-abi.hpp"
 
+#include <limits.h>
+#include <sys/types.h>
+
 #ifndef LTTNG_UST_UUID_LEN
-#define LTTNG_UST_UUID_LEN     16
+#define LTTNG_UST_UUID_LEN 16
 #endif
 
 /* Default unix socket path */
-#define LTTNG_UST_SOCK_FILENAME                                        \
-       "lttng-ust-sock-"                                       \
-       __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE)
+#define LTTNG_UST_SOCK_FILENAME \
+       "lttng-ust-sock-" __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE)
 
 /*
  * Shared memory files path are automatically related to shm root, e.g.
  * /dev/shm under linux.
  */
-#define LTTNG_UST_WAIT_FILENAME                                        \
-       "lttng-ust-wait-"                                       \
-       __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE)
+#define LTTNG_UST_WAIT_FILENAME \
+       "lttng-ust-wait-" __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE)
 
 struct lttng_ust_shm_handle;
 struct lttng_ust_lib_ring_buffer;
 
 struct lttng_ust_ctl_consumer_channel_attr {
        enum lttng_ust_abi_chan_type type;
-       uint64_t subbuf_size;                   /* bytes */
-       uint64_t num_subbuf;                    /* power of 2 */
-       int overwrite;                          /* 1: overwrite, 0: discard */
-       unsigned int switch_timer_interval;     /* usec */
-       unsigned int read_timer_interval;       /* usec */
-       enum lttng_ust_abi_output output;       /* splice, mmap */
-       uint32_t chan_id;                       /* channel ID */
+       uint64_t subbuf_size; /* bytes */
+       uint64_t num_subbuf; /* power of 2 */
+       int overwrite; /* 1: overwrite, 0: discard */
+       unsigned int switch_timer_interval; /* usec */
+       unsigned int read_timer_interval; /* usec */
+       enum lttng_ust_abi_output output; /* splice, mmap */
+       uint32_t chan_id; /* channel ID */
        unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
-       int64_t blocking_timeout;                       /* Blocking timeout (usec) */
+       int64_t blocking_timeout; /* Blocking timeout (usec) */
 } LTTNG_PACKED;
 
 /*
@@ -69,18 +67,23 @@ struct lttng_ust_context_attr {
  */
 int lttng_ust_ctl_register_done(int sock);
 int lttng_ust_ctl_create_session(int sock);
-int lttng_ust_ctl_create_event(int sock, struct lttng_ust_abi_event *ev,
-               struct lttng_ust_abi_object_data *channel_data,
-               struct lttng_ust_abi_object_data **event_data);
-int lttng_ust_ctl_add_context(int sock, struct lttng_ust_context_attr *ctx,
-               struct lttng_ust_abi_object_data *obj_data,
-               struct lttng_ust_abi_object_data **context_data);
-int lttng_ust_ctl_set_filter(int sock, struct lttng_ust_abi_filter_bytecode *bytecode,
-               struct lttng_ust_abi_object_data *obj_data);
-int lttng_ust_ctl_set_capture(int sock, struct lttng_ust_abi_capture_bytecode *bytecode,
-               struct lttng_ust_abi_object_data *obj_data);
-int lttng_ust_ctl_set_exclusion(int sock, struct lttng_ust_abi_event_exclusion *exclusion,
-               struct lttng_ust_abi_object_data *obj_data);
+int lttng_ust_ctl_create_event(int sock,
+                              struct lttng_ust_abi_event *ev,
+                              struct lttng_ust_abi_object_data *channel_data,
+                              struct lttng_ust_abi_object_data **event_data);
+int lttng_ust_ctl_add_context(int sock,
+                             struct lttng_ust_context_attr *ctx,
+                             struct lttng_ust_abi_object_data *obj_data,
+                             struct lttng_ust_abi_object_data **context_data);
+int lttng_ust_ctl_set_filter(int sock,
+                            struct lttng_ust_abi_filter_bytecode *bytecode,
+                            struct lttng_ust_abi_object_data *obj_data);
+int lttng_ust_ctl_set_capture(int sock,
+                             struct lttng_ust_abi_capture_bytecode *bytecode,
+                             struct lttng_ust_abi_object_data *obj_data);
+int lttng_ust_ctl_set_exclusion(int sock,
+                               struct lttng_ust_abi_event_exclusion *exclusion,
+                               struct lttng_ust_abi_object_data *obj_data);
 
 int lttng_ust_ctl_enable(int sock, struct lttng_ust_abi_object_data *object);
 int lttng_ust_ctl_disable(int sock, struct lttng_ust_abi_object_data *object);
@@ -94,8 +97,8 @@ int lttng_ust_ctl_stop_session(int sock, int handle);
  * of that group is fired. It returns a handle to be used when creating event
  * notifier in that group.
  */
-int lttng_ust_ctl_create_event_notifier_group(int sock, int pipe_fd,
-               struct lttng_ust_abi_object_data **event_notifier_group);
+int lttng_ust_ctl_create_event_notifier_group(
+       int sock, int pipe_fd, struct lttng_ust_abi_object_data **event_notifier_group);
 
 /*
  * lttng_ust_ctl_create_event notifier creates a event notifier in a event notifier
@@ -105,9 +108,9 @@ int lttng_ust_ctl_create_event_notifier_group(int sock, int pipe_fd,
  * notifier.
  */
 int lttng_ust_ctl_create_event_notifier(int sock,
-               struct lttng_ust_abi_event_notifier *event_notifier,
-               struct lttng_ust_abi_object_data *event_notifier_group,
-               struct lttng_ust_abi_object_data **event_notifier_data);
+                                       struct lttng_ust_abi_event_notifier *event_notifier,
+                                       struct lttng_ust_abi_object_data *event_notifier_group,
+                                       struct lttng_ust_abi_object_data **event_notifier_data);
 
 /*
  * lttng_ust_ctl_tracepoint_list returns a tracepoint list handle, or negative
@@ -120,8 +123,9 @@ int lttng_ust_ctl_tracepoint_list(int sock);
  * handle. End is iteration is reached when -LTTNG_UST_ERR_NOENT is
  * returned.
  */
-int lttng_ust_ctl_tracepoint_list_get(int sock, int tp_list_handle,
-               struct lttng_ust_abi_tracepoint_iter *iter);
+int lttng_ust_ctl_tracepoint_list_get(int sock,
+                                     int tp_list_handle,
+                                     struct lttng_ust_abi_tracepoint_iter *iter);
 
 /*
  * lttng_ust_ctl_tracepoint_field_list returns a tracepoint field list handle,
@@ -134,8 +138,9 @@ int lttng_ust_ctl_tracepoint_field_list(int sock);
  * list handle. End is iteration is reached when -LTTNG_UST_ERR_NOENT is
  * returned.
  */
-int lttng_ust_ctl_tracepoint_field_list_get(int sock, int tp_field_list_handle,
-               struct lttng_ust_abi_field_iter *iter);
+int lttng_ust_ctl_tracepoint_field_list_get(int sock,
+                                           int tp_field_list_handle,
+                                           struct lttng_ust_abi_field_iter *iter);
 
 int lttng_ust_ctl_tracer_version(int sock, struct lttng_ust_abi_tracer_version *v);
 int lttng_ust_ctl_wait_quiescent(int sock);
@@ -150,14 +155,15 @@ int lttng_ust_ctl_release_object(int sock, struct lttng_ust_abi_object_data *dat
 int lttng_ust_ctl_release_handle(int sock, int handle);
 
 int lttng_ust_ctl_recv_channel_from_consumer(int sock,
-               struct lttng_ust_abi_object_data **channel_data);
+                                            struct lttng_ust_abi_object_data **channel_data);
 int lttng_ust_ctl_recv_stream_from_consumer(int sock,
-               struct lttng_ust_abi_object_data **stream_data);
-int lttng_ust_ctl_send_channel_to_ust(int sock, int session_handle,
-               struct lttng_ust_abi_object_data *channel_data);
+                                           struct lttng_ust_abi_object_data **stream_data);
+int lttng_ust_ctl_send_channel_to_ust(int sock,
+                                     int session_handle,
+                                     struct lttng_ust_abi_object_data *channel_data);
 int lttng_ust_ctl_send_stream_to_ust(int sock,
-               struct lttng_ust_abi_object_data *channel_data,
-               struct lttng_ust_abi_object_data *stream_data);
+                                    struct lttng_ust_abi_object_data *channel_data,
+                                    struct lttng_ust_abi_object_data *stream_data);
 
 /*
  * lttng_ust_ctl_duplicate_ust_object_data allocated a new object in "dest" if
@@ -165,7 +171,7 @@ int lttng_ust_ctl_send_stream_to_ust(int sock,
  * lttng_ust_ctl_release_object() and then freed with free().
  */
 int lttng_ust_ctl_duplicate_ust_object_data(struct lttng_ust_abi_object_data **dest,
-               struct lttng_ust_abi_object_data *src);
+                                           struct lttng_ust_abi_object_data *src);
 
 /*
  * API used by consumer.
@@ -177,9 +183,8 @@ struct lttng_ust_ctl_consumer_channel_attr;
 
 int lttng_ust_ctl_get_nr_stream_per_channel(void);
 
-struct lttng_ust_ctl_consumer_channel *
-       lttng_ust_ctl_create_channel(struct lttng_ust_ctl_consumer_channel_attr *attr,
-               const int *stream_fds, int nr_stream_fds);
+struct lttng_ust_ctl_consumer_channel *lttng_ust_ctl_create_channel(
+       struct lttng_ust_ctl_consumer_channel_attr *attr, const int *stream_fds, int nr_stream_fds);
 /*
  * Each stream created needs to be destroyed before calling
  * lttng_ust_ctl_destroy_channel().
@@ -187,27 +192,25 @@ struct lttng_ust_ctl_consumer_channel *
 void lttng_ust_ctl_destroy_channel(struct lttng_ust_ctl_consumer_channel *chan);
 
 int lttng_ust_ctl_send_channel_to_sessiond(int sock,
-               struct lttng_ust_ctl_consumer_channel *channel);
+                                          struct lttng_ust_ctl_consumer_channel *channel);
 int lttng_ust_ctl_channel_close_wait_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
 int lttng_ust_ctl_channel_close_wakeup_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
 int lttng_ust_ctl_channel_get_wait_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
 int lttng_ust_ctl_channel_get_wakeup_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
 
-int lttng_ust_ctl_write_metadata_to_channel(
-               struct lttng_ust_ctl_consumer_channel *channel,
-               const char *metadata_str,       /* NOT null-terminated */
-               size_t len);                    /* metadata length */
-ssize_t lttng_ust_ctl_write_one_packet_to_channel(
-               struct lttng_ust_ctl_consumer_channel *channel,
-               const char *metadata_str,       /* NOT null-terminated */
-               size_t len);                    /* metadata length */
+int lttng_ust_ctl_write_metadata_to_channel(struct lttng_ust_ctl_consumer_channel *channel,
+                                           const char *metadata_str, /* NOT null-terminated */
+                                           size_t len); /* metadata length */
+ssize_t lttng_ust_ctl_write_one_packet_to_channel(struct lttng_ust_ctl_consumer_channel *channel,
+                                                 const char *metadata_str, /* NOT null-terminated
+                                                                            */
+                                                 size_t len); /* metadata length */
 
 /*
  * Send a NULL stream to finish iteration over all streams of a given
  * channel.
  */
-int lttng_ust_ctl_send_stream_to_sessiond(int sock,
-               struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_send_stream_to_sessiond(int sock, struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_stream_close_wait_fd(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_stream_close_wakeup_fd(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_stream_get_wait_fd(struct lttng_ust_ctl_consumer_stream *stream);
@@ -215,15 +218,13 @@ int lttng_ust_ctl_stream_get_wakeup_fd(struct lttng_ust_ctl_consumer_stream *str
 
 /* Create/destroy stream buffers for read */
 struct lttng_ust_ctl_consumer_stream *
-       lttng_ust_ctl_create_stream(struct lttng_ust_ctl_consumer_channel *channel,
-                       int cpu);
+lttng_ust_ctl_create_stream(struct lttng_ust_ctl_consumer_channel *channel, int cpu);
 void lttng_ust_ctl_destroy_stream(struct lttng_ust_ctl_consumer_stream *stream);
 
 /* For mmap mode, readable without "get" operation */
-int lttng_ust_ctl_get_mmap_len(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *len);
+int lttng_ust_ctl_get_mmap_len(struct lttng_ust_ctl_consumer_stream *stream, unsigned long *len);
 int lttng_ust_ctl_get_max_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *len);
+                                     unsigned long *len);
 
 /*
  * For mmap mode, operate on the current packet (between get/put or
@@ -231,11 +232,10 @@ int lttng_ust_ctl_get_max_subbuf_size(struct lttng_ust_ctl_consumer_stream *stre
  */
 void *lttng_ust_ctl_get_mmap_base(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_get_mmap_read_offset(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *off);
-int lttng_ust_ctl_get_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *len);
+                                      unsigned long *off);
+int lttng_ust_ctl_get_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream, unsigned long *len);
 int lttng_ust_ctl_get_padded_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *len);
+                                        unsigned long *len);
 int lttng_ust_ctl_get_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_put_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
 
@@ -244,15 +244,13 @@ int lttng_ust_ctl_put_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_snapshot(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_snapshot_sample_positions(struct lttng_ust_ctl_consumer_stream *stream);
 int lttng_ust_ctl_snapshot_get_consumed(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *pos);
+                                       unsigned long *pos);
 int lttng_ust_ctl_snapshot_get_produced(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *pos);
-int lttng_ust_ctl_get_subbuf(struct lttng_ust_ctl_consumer_stream *stream,
-               unsigned long *pos);
+                                       unsigned long *pos);
+int lttng_ust_ctl_get_subbuf(struct lttng_ust_ctl_consumer_stream *stream, unsigned long *pos);
 int lttng_ust_ctl_put_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
 
-int lttng_ust_ctl_flush_buffer(struct lttng_ust_ctl_consumer_stream *stream,
-               int producer_active);
+int lttng_ust_ctl_flush_buffer(struct lttng_ust_ctl_consumer_stream *stream, int producer_active);
 int lttng_ust_ctl_clear_buffer(struct lttng_ust_ctl_consumer_stream *stream);
 
 /* index */
@@ -263,34 +261,30 @@ int lttng_ust_ctl_clear_buffer(struct lttng_ust_ctl_consumer_stream *stream);
  */
 
 int lttng_ust_ctl_get_timestamp_begin(struct lttng_ust_ctl_consumer_stream *stream,
-               uint64_t *timestamp_begin);
+                                     uint64_t *timestamp_begin);
 int lttng_ust_ctl_get_timestamp_end(struct lttng_ust_ctl_consumer_stream *stream,
-       uint64_t *timestamp_end);
+                                   uint64_t *timestamp_end);
 int lttng_ust_ctl_get_events_discarded(struct lttng_ust_ctl_consumer_stream *stream,
-       uint64_t *events_discarded);
+                                      uint64_t *events_discarded);
 int lttng_ust_ctl_get_content_size(struct lttng_ust_ctl_consumer_stream *stream,
-       uint64_t *content_size);
+                                  uint64_t *content_size);
 int lttng_ust_ctl_get_packet_size(struct lttng_ust_ctl_consumer_stream *stream,
-       uint64_t *packet_size);
-int lttng_ust_ctl_get_sequence_number(struct lttng_ust_ctl_consumer_stream *stream,
-               uint64_t *seq);
+                                 uint64_t *packet_size);
+int lttng_ust_ctl_get_sequence_number(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *seq);
 
 /*
  * Getter returning state invariant for the stream, which can be used
  * without "get" operation.
  */
 
-int lttng_ust_ctl_get_stream_id(struct lttng_ust_ctl_consumer_stream *stream,
-               uint64_t *stream_id);
-int lttng_ust_ctl_get_instance_id(struct lttng_ust_ctl_consumer_stream *stream,
-               uint64_t *id);
+int lttng_ust_ctl_get_stream_id(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *stream_id);
+int lttng_ust_ctl_get_instance_id(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *id);
 
 /*
  * Getter returning the current timestamp as perceived from the
  * tracer.
  */
-int lttng_ust_ctl_get_current_timestamp(struct lttng_ust_ctl_consumer_stream *stream,
-               uint64_t *ts);
+int lttng_ust_ctl_get_current_timestamp(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *ts);
 
 /* returns whether UST has perf counters support. */
 int lttng_ust_ctl_has_perf_counters(void);
@@ -321,13 +315,13 @@ enum lttng_ust_ctl_channel_header {
 
 enum lttng_ust_ctl_abstract_types {
        lttng_ust_ctl_atype_integer,
-       lttng_ust_ctl_atype_enum,       /* legacy */
-       lttng_ust_ctl_atype_array,      /* legacy */
-       lttng_ust_ctl_atype_sequence,   /* legacy */
+       lttng_ust_ctl_atype_enum, /* legacy */
+       lttng_ust_ctl_atype_array, /* legacy */
+       lttng_ust_ctl_atype_sequence, /* legacy */
        lttng_ust_ctl_atype_string,
        lttng_ust_ctl_atype_float,
-       lttng_ust_ctl_atype_variant,    /* legacy */
-       lttng_ust_ctl_atype_struct,     /* legacy */
+       lttng_ust_ctl_atype_variant, /* legacy */
+       lttng_ust_ctl_atype_struct, /* legacy */
        lttng_ust_ctl_atype_enum_nestable,
        lttng_ust_ctl_atype_array_nestable,
        lttng_ust_ctl_atype_sequence_nestable,
@@ -343,27 +337,27 @@ enum lttng_ust_ctl_string_encodings {
        NR_LTTNG_UST_CTL_STRING_ENCODINGS,
 };
 
-#define LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING 24
+#define LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING 24
 struct lttng_ust_ctl_integer_type {
-       uint32_t size;          /* in bits */
+       uint32_t size; /* in bits */
        uint32_t signedness;
        uint32_t reverse_byte_order;
-       uint32_t base;          /* 2, 8, 10, 16, for pretty print */
-       int32_t encoding;       /* enum lttng_ust_ctl_string_encodings */
-       uint16_t alignment;     /* in bits */
+       uint32_t base; /* 2, 8, 10, 16, for pretty print */
+       int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
+       uint16_t alignment; /* in bits */
        char padding[LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING   24
+#define LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING 24
 struct lttng_ust_ctl_float_type {
-       uint32_t exp_dig;               /* exponent digits, in bits */
-       uint32_t mant_dig;              /* mantissa digits, in bits */
+       uint32_t exp_dig; /* exponent digits, in bits */
+       uint32_t mant_dig; /* mantissa digits, in bits */
        uint32_t reverse_byte_order;
-       uint16_t alignment;     /* in bits */
+       uint16_t alignment; /* in bits */
        char padding[LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING];
 } LTTNG_PACKED;
 
-#define LTTNG_UST_CTL_UST_ENUM_VALUE_PADDING   15
+#define LTTNG_UST_CTL_UST_ENUM_VALUE_PADDING 15
 struct lttng_ust_ctl_enum_value {
        uint64_t value;
        uint8_t signedness;
@@ -374,7 +368,7 @@ enum lttng_ust_ctl_ust_enum_entry_options {
        LTTNG_UST_CTL_UST_ENUM_ENTRY_OPTION_IS_AUTO = 1U << 0,
 };
 
-#define LTTNG_UST_CTL_UST_ENUM_ENTRY_PADDING   32
+#define LTTNG_UST_CTL_UST_ENUM_ENTRY_PADDING 32
 struct lttng_ust_ctl_enum_entry {
        struct lttng_ust_ctl_enum_value start, end; /* start and end are inclusive */
        char string[LTTNG_UST_ABI_SYM_NAME_LEN];
@@ -387,16 +381,16 @@ struct lttng_ust_ctl_enum_entry {
 } LTTNG_PACKED;
 
 /* legacy */
-#define LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING   296
+#define LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING 296
 union _lttng_ust_ctl_basic_type {
        struct lttng_ust_ctl_integer_type integer;
        struct {
                char name[LTTNG_UST_ABI_SYM_NAME_LEN];
                struct lttng_ust_ctl_integer_type container_type;
-               uint64_t id;    /* enum ID in sessiond. */
+               uint64_t id; /* enum ID in sessiond. */
        } enumeration;
        struct {
-               int32_t encoding;       /* enum lttng_ust_ctl_string_encodings */
+               int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
        } string;
        struct lttng_ust_ctl_float_type _float;
        char padding[LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING];
@@ -414,28 +408,28 @@ struct lttng_ust_ctl_basic_type {
  * Padding is derived from largest member: u.legacy.sequence which
  * contains two basic types, each with LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING.
  */
-#define LTTNG_UST_CTL_UST_TYPE_PADDING (2 * LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING)
+#define LTTNG_UST_CTL_UST_TYPE_PADDING (2 * LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING)
 struct lttng_ust_ctl_type {
        enum lttng_ust_ctl_abstract_types atype;
        union {
                struct lttng_ust_ctl_integer_type integer;
                struct lttng_ust_ctl_float_type _float;
                struct {
-                       int32_t encoding;       /* enum lttng_ust_ctl_string_encodings */
+                       int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
                } string;
                struct {
                        char name[LTTNG_UST_ABI_SYM_NAME_LEN];
-                       uint64_t id;    /* enum ID in sessiond. */
+                       uint64_t id; /* enum ID in sessiond. */
                        /* container_type follows after this struct lttng_ust_ctl_field. */
                } enum_nestable;
                struct {
-                       uint32_t length;                /* num. elems. */
+                       uint32_t length; /* num. elems. */
                        uint32_t alignment;
                        /* elem_type follows after this struct lttng_ust_ctl_field. */
                } array_nestable;
                struct {
                        char length_name[LTTNG_UST_ABI_SYM_NAME_LEN];
-                       uint32_t alignment;             /* Alignment before elements. */
+                       uint32_t alignment; /* Alignment before elements. */
                        /* elem_type follows after the length_type. */
                } sequence_nestable;
                struct {
@@ -455,7 +449,7 @@ struct lttng_ust_ctl_type {
                        union _lttng_ust_ctl_basic_type basic;
                        struct {
                                struct lttng_ust_ctl_basic_type elem_type;
-                               uint32_t length;                /* num. elems. */
+                               uint32_t length; /* num. elems. */
                        } array;
                        struct {
                                struct lttng_ust_ctl_basic_type length_type;
@@ -475,7 +469,7 @@ struct lttng_ust_ctl_type {
        } u;
 } LTTNG_PACKED;
 
-#define LTTNG_UST_CTL_UST_FIELD_PADDING        28
+#define LTTNG_UST_CTL_UST_FIELD_PADDING 28
 struct lttng_ust_ctl_field {
        char name[LTTNG_UST_ABI_SYM_NAME_LEN];
        struct lttng_ust_ctl_type type;
@@ -488,21 +482,21 @@ struct lttng_ust_ctl_field {
  * the output fields are not populated.
  */
 int lttng_ust_ctl_recv_reg_msg(int sock,
-       enum lttng_ust_ctl_socket_type *type,
-       uint32_t *major,
-       uint32_t *minor,
-       uint32_t *pid,
-       uint32_t *ppid,
-       uint32_t *uid,
-       uint32_t *gid,
-       uint32_t *bits_per_long,
-       uint32_t *uint8_t_alignment,
-       uint32_t *uint16_t_alignment,
-       uint32_t *uint32_t_alignment,
-       uint32_t *uint64_t_alignment,
-       uint32_t *long_alignment,
-       int *byte_order,
-       char *name);    /* size LTTNG_UST_ABI_PROCNAME_LEN */
+                              enum lttng_ust_ctl_socket_type *type,
+                              uint32_t *major,
+                              uint32_t *minor,
+                              uint32_t *pid,
+                              uint32_t *ppid,
+                              uint32_t *uid,
+                              uint32_t *gid,
+                              uint32_t *bits_per_long,
+                              uint32_t *uint8_t_alignment,
+                              uint32_t *uint16_t_alignment,
+                              uint32_t *uint32_t_alignment,
+                              uint32_t *uint64_t_alignment,
+                              uint32_t *long_alignment,
+                              int *byte_order,
+                              char *name); /* size LTTNG_UST_ABI_PROCNAME_LEN */
 
 /*
  * Returns 0 on success, negative UST or system error value on error.
@@ -517,63 +511,63 @@ int lttng_ust_ctl_recv_notify(int sock, enum lttng_ust_ctl_notify_cmd *notify_cm
  * Returns 0 on success, negative UST or system error value on error.
  */
 int lttng_ust_ctl_recv_register_event(int sock,
-       int *session_objd,              /* session descriptor (output) */
-       int *channel_objd,              /* channel descriptor (output) */
-       char *event_name,               /*
-                                        * event name (output,
-                                        * size LTTNG_UST_ABI_SYM_NAME_LEN)
-                                        */
-       int *loglevel,
-       char **signature,               /*
-                                        * event signature
-                                        * (output, dynamically
-                                        * allocated, must be free(3)'d
-                                        * by the caller if function
-                                        * returns success.)
-                                        */
-       size_t *nr_fields,
-       struct lttng_ust_ctl_field **fields,
-       char **model_emf_uri);
+                                     int *session_objd, /* session descriptor (output) */
+                                     int *channel_objd, /* channel descriptor (output) */
+                                     char *event_name, /*
+                                                        * event name (output,
+                                                        * size LTTNG_UST_ABI_SYM_NAME_LEN)
+                                                        */
+                                     int *loglevel,
+                                     char **signature, /*
+                                                        * event signature
+                                                        * (output, dynamically
+                                                        * allocated, must be free(3)'d
+                                                        * by the caller if function
+                                                        * returns success.)
+                                                        */
+                                     size_t *nr_fields,
+                                     struct lttng_ust_ctl_field **fields,
+                                     char **model_emf_uri);
 
 /*
  * Returns 0 on success, negative error value on error.
  */
 int lttng_ust_ctl_reply_register_event(int sock,
-       uint32_t id,                    /* event id (input) */
-       int ret_code);                  /* return code. 0 ok, negative error */
+                                      uint32_t id, /* event id (input) */
+                                      int ret_code); /* return code. 0 ok, negative error */
 
 /*
  * Returns 0 on success, negative UST or system error value on error.
  */
 int lttng_ust_ctl_recv_register_enum(int sock,
-       int *session_objd,
-       char *enum_name,
-       struct lttng_ust_ctl_enum_entry **entries,
-       size_t *nr_entries);
+                                    int *session_objd,
+                                    char *enum_name,
+                                    struct lttng_ust_ctl_enum_entry **entries,
+                                    size_t *nr_entries);
 
 /*
  * Returns 0 on success, negative error value on error.
  */
 int lttng_ust_ctl_reply_register_enum(int sock,
-       uint64_t id,                    /* enum id (input) */
-       int ret_code);
+                                     uint64_t id, /* enum id (input) */
+                                     int ret_code);
 
 /*
  * Returns 0 on success, negative UST or system error value on error.
  */
 int lttng_ust_ctl_recv_register_channel(int sock,
-       int *session_objd,              /* session descriptor (output) */
-       int *channel_objd,              /* channel descriptor (output) */
-       size_t *nr_fields,              /* context fields */
-       struct lttng_ust_ctl_field **fields);
+                                       int *session_objd, /* session descriptor (output) */
+                                       int *channel_objd, /* channel descriptor (output) */
+                                       size_t *nr_fields, /* context fields */
+                                       struct lttng_ust_ctl_field **fields);
 
 /*
  * Returns 0 on success, negative error value on error.
  */
 int lttng_ust_ctl_reply_register_channel(int sock,
-       uint32_t chan_id,
-       enum lttng_ust_ctl_channel_header header_type,
-       int ret_code);                  /* return code. 0 ok, negative error */
+                                        uint32_t chan_id,
+                                        enum lttng_ust_ctl_channel_header header_type,
+                                        int ret_code); /* return code. 0 ok, negative error */
 
 /*
  * Counter API.
@@ -585,8 +579,8 @@ enum lttng_ust_ctl_counter_bitness {
 };
 
 enum lttng_ust_ctl_counter_arithmetic {
-       LTTNG_UST_CTL_COUNTER_ARITHMETIC_MODULAR        = 0,
-       LTTNG_UST_CTL_COUNTER_ARITHMETIC_SATURATION     = 1,
+       LTTNG_UST_CTL_COUNTER_ARITHMETIC_MODULAR = 0,
+       LTTNG_UST_CTL_COUNTER_ARITHMETIC_SATURATION = 1,
 };
 
 /* Used as alloc flags. */
@@ -608,24 +602,25 @@ struct lttng_ust_ctl_counter_dimension {
 };
 
 struct lttng_ust_ctl_daemon_counter *
-       lttng_ust_ctl_create_counter(size_t nr_dimensions,
-               const struct lttng_ust_ctl_counter_dimension *dimensions,
-               int64_t global_sum_step,
-               int global_counter_fd,
-               int nr_counter_cpu_fds,
-               const int *counter_cpu_fds,
-               enum lttng_ust_ctl_counter_bitness bitness,
-               enum lttng_ust_ctl_counter_arithmetic arithmetic,
-               uint32_t alloc_flags,
-               bool coalesce_hits);
+lttng_ust_ctl_create_counter(size_t nr_dimensions,
+                            const struct lttng_ust_ctl_counter_dimension *dimensions,
+                            int64_t global_sum_step,
+                            int global_counter_fd,
+                            int nr_counter_cpu_fds,
+                            const int *counter_cpu_fds,
+                            enum lttng_ust_ctl_counter_bitness bitness,
+                            enum lttng_ust_ctl_counter_arithmetic arithmetic,
+                            uint32_t alloc_flags,
+                            bool coalesce_hits);
 
 int lttng_ust_ctl_create_counter_data(struct lttng_ust_ctl_daemon_counter *counter,
-               struct lttng_ust_abi_object_data **counter_data);
+                                     struct lttng_ust_abi_object_data **counter_data);
 
 int lttng_ust_ctl_create_counter_global_data(struct lttng_ust_ctl_daemon_counter *counter,
-               struct lttng_ust_abi_object_data **counter_global_data);
-int lttng_ust_ctl_create_counter_cpu_data(struct lttng_ust_ctl_daemon_counter *counter, int cpu,
-               struct lttng_ust_abi_object_data **counter_cpu_data);
+                                            struct lttng_ust_abi_object_data **counter_global_data);
+int lttng_ust_ctl_create_counter_cpu_data(struct lttng_ust_ctl_daemon_counter *counter,
+                                         int cpu,
+                                         struct lttng_ust_abi_object_data **counter_cpu_data);
 
 /*
  * Each counter data and counter cpu data created need to be destroyed
@@ -633,25 +628,30 @@ int lttng_ust_ctl_create_counter_cpu_data(struct lttng_ust_ctl_daemon_counter *c
  */
 void lttng_ust_ctl_destroy_counter(struct lttng_ust_ctl_daemon_counter *counter);
 
-int lttng_ust_ctl_send_counter_data_to_ust(int sock, int parent_handle,
-               struct lttng_ust_abi_object_data *counter_data);
-int lttng_ust_ctl_send_counter_global_data_to_ust(int sock,
-               struct lttng_ust_abi_object_data *counter_data,
-               struct lttng_ust_abi_object_data *counter_global_data);
+int lttng_ust_ctl_send_counter_data_to_ust(int sock,
+                                          int parent_handle,
+                                          struct lttng_ust_abi_object_data *counter_data);
+int lttng_ust_ctl_send_counter_global_data_to_ust(
+       int sock,
+       struct lttng_ust_abi_object_data *counter_data,
+       struct lttng_ust_abi_object_data *counter_global_data);
 int lttng_ust_ctl_send_counter_cpu_data_to_ust(int sock,
-               struct lttng_ust_abi_object_data *counter_data,
-               struct lttng_ust_abi_object_data *counter_cpu_data);
+                                              struct lttng_ust_abi_object_data *counter_data,
+                                              struct lttng_ust_abi_object_data *counter_cpu_data);
 
 int lttng_ust_ctl_counter_read(struct lttng_ust_ctl_daemon_counter *counter,
-               const size_t *dimension_indexes,
-               int cpu, int64_t *value,
-               bool *overflow, bool *underflow);
+                              const size_t *dimension_indexes,
+                              int cpu,
+                              int64_t *value,
+                              bool *overflow,
+                              bool *underflow);
 int lttng_ust_ctl_counter_aggregate(struct lttng_ust_ctl_daemon_counter *counter,
-               const size_t *dimension_indexes,
-               int64_t *value,
-               bool *overflow, bool *underflow);
+                                   const size_t *dimension_indexes,
+                                   int64_t *value,
+                                   bool *overflow,
+                                   bool *underflow);
 int lttng_ust_ctl_counter_clear(struct lttng_ust_ctl_daemon_counter *counter,
-               const size_t *dimension_indexes);
+                               const size_t *dimension_indexes);
 
 void lttng_ust_ctl_sigbus_handle(void *addr);
 
index 1cf05f2e32f303307136c052ad2e564e9398c2a0..7e59d07542121b26a25efb28a70cf3ed511d0739 100644 (file)
  * These declarations should NOT be considered stable API.
  */
 
+#include "lttng-ust-abi.hpp"
+
 #include <limits.h>
 #include <unistd.h>
 
-#include "lttng-ust-abi.hpp"
-
 /*
  * ustcomm error code.
  */
 enum lttng_ust_error_code {
-       LTTNG_UST_OK = 0,                       /* Ok */
-       LTTNG_UST_ERR = 1024,                   /* Unknown Error */
-       LTTNG_UST_ERR_NOENT = 1025,             /* No entry */
-       LTTNG_UST_ERR_EXIST = 1026,             /* Object exists */
-       LTTNG_UST_ERR_INVAL = 1027,             /* Invalid argument */
-       LTTNG_UST_ERR_PERM  = 1028,             /* Permission denied */
-       LTTNG_UST_ERR_NOSYS = 1029,             /* Not implemented */
-       LTTNG_UST_ERR_EXITING = 1030,           /* Process is exiting */
-
-       LTTNG_UST_ERR_INVAL_MAGIC = 1031,       /* Invalid magic number */
-       LTTNG_UST_ERR_INVAL_SOCKET_TYPE = 1032, /* Invalid socket type */
-       LTTNG_UST_ERR_UNSUP_MAJOR = 1033,       /* Unsupported major version */
+       LTTNG_UST_OK = 0, /* Ok */
+       LTTNG_UST_ERR = 1024, /* Unknown Error */
+       LTTNG_UST_ERR_NOENT = 1025, /* No entry */
+       LTTNG_UST_ERR_EXIST = 1026, /* Object exists */
+       LTTNG_UST_ERR_INVAL = 1027, /* Invalid argument */
+       LTTNG_UST_ERR_PERM = 1028, /* Permission denied */
+       LTTNG_UST_ERR_NOSYS = 1029, /* Not implemented */
+       LTTNG_UST_ERR_EXITING = 1030, /* Process is exiting */
+
+       LTTNG_UST_ERR_INVAL_MAGIC = 1031, /* Invalid magic number */
+       LTTNG_UST_ERR_INVAL_SOCKET_TYPE = 1032, /* Invalid socket type */
+       LTTNG_UST_ERR_UNSUP_MAJOR = 1033, /* Unsupported major version */
 
        /* MUST be last element */
-       LTTNG_UST_ERR_NR,                       /* Last element */
+       LTTNG_UST_ERR_NR, /* Last element */
 };
 
 /*
@@ -46,4 +46,4 @@ enum lttng_ust_error_code {
  */
 extern const char *lttng_ust_strerror(int code);
 
-#endif /* _LTTNG_UST_ERROR_H */
+#endif /* _LTTNG_UST_ERROR_H */
index c0e663983267c2315c0dcc6e0c2a921b8c7beff4..063abcd6808f9eae972e819dedebb16d2b91237a 100644 (file)
@@ -9,12 +9,12 @@
 #define LTTNG_UST_FIELD_CONVERT_H
 
 #include "field.hpp"
-#include "ust-registry.hpp"
 #include "ust-registry-session.hpp"
+#include "ust-registry.hpp"
 
 #include <cstddef>
-#include <vector>
 #include <type_traits>
+#include <vector>
 
 namespace lttng {
 namespace sessiond {
@@ -42,12 +42,12 @@ inline ctl_field_quirks operator|(ctl_field_quirks lhs, ctl_field_quirks rhs)
        return ctl_field_quirks(static_cast<enum_type>(lhs) | static_cast<enum_type>(rhs));
 }
 
-std::vector<trace::field::cuptr> create_trace_fields_from_ust_ctl_fields(
-               const lttng::sessiond::ust::registry_session& session,
-               const lttng_ust_ctl_field *fields,
-               std::size_t field_count,
-               trace::field_location::root lookup_root,
-               ctl_field_quirks quirks = ctl_field_quirks::NONE);
+std::vector<trace::field::cuptr>
+create_trace_fields_from_ust_ctl_fields(const lttng::sessiond::ust::registry_session& session,
+                                       const lttng_ust_ctl_field *fields,
+                                       std::size_t field_count,
+                                       trace::field_location::root lookup_root,
+                                       ctl_field_quirks quirks = ctl_field_quirks::NONE);
 
 } /* namespace ust */
 } /* namespace sessiond */
index 4e7229a69afa8ef8cd471d4c5422f184d3e4c8d4..636de94aa9979ebfbf8a23e8d95a5a1c7a32e046 100644 (file)
@@ -15,8 +15,8 @@
 
 #include <lttng/lttng.h>
 
-#include <urcu.h>
 #include <functional>
+#include <urcu.h>
 
 struct ust_app;
 
@@ -29,23 +29,24 @@ class registry_event;
 class registry_channel : public lttng::sessiond::trace::stream_class {
 public:
        using registered_listener_fn = std::function<void(const registry_channel&)>;
-       using event_added_listener_fn = std::function<void(const registry_channel&, const registry_event &)>;
+       using event_added_listener_fn =
+               std::function<void(const registry_channel&, const registry_event&)>;
 
        registry_channel(uint32_t channel_id,
-                       const lttng::sessiond::trace::abi& trace_abi,
-                       std::string default_clock_class_name,
-                       registered_listener_fn channel_registered_listener,
-                       event_added_listener_fn new_event_listener);
+                        const lttng::sessiond::trace::abi& trace_abi,
+                        std::string default_clock_class_name,
+                        registered_listener_fn channel_registered_listener,
+                        event_added_listener_fn new_event_listener);
        void add_event(int session_objd,
-                       int channel_objd,
-                       std::string name,
-                       std::string signature,
-                       std::vector<lttng::sessiond::trace::field::cuptr> event_fields,
-                       int loglevel_value,
-                       nonstd::optional<std::string> model_emf_uri,
-                       lttng_buffer_type buffer_type,
-                       const ust_app& app,
-                       uint32_t& out_event_id);
+                      int channel_objd,
+                      std::string name,
+                      std::string signature,
+                      std::vector<lttng::sessiond::trace::field::cuptr> event_fields,
+                      int loglevel_value,
+                      nonstd::optional<std::string> model_emf_uri,
+                      lttng_buffer_type buffer_type,
+                      const ust_app& app,
+                      uint32_t& out_event_id);
        ~registry_channel() override;
        registry_channel(const registry_channel&) = delete;
        registry_channel(registry_channel&&) = delete;
@@ -75,7 +76,7 @@ public:
 
 private:
        void _accept_on_event_classes(
-                       lttng::sessiond::trace::trace_class_visitor& trace_class_visitor) const final;
+               lttng::sessiond::trace::trace_class_visitor& trace_class_visitor) const final;
 
        registered_listener_fn _is_registered_listener;
        event_added_listener_fn _event_added_listener;
index fe325fced2fb4d91b5de03a2fa28adb3606a81b3..38d96eb8fbd179b9a6982bac0377b1ce68cb7d4c 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <common/format.hpp>
 #include <common/hashtable/hashtable.hpp>
+
 #include <vendor/optional.hpp>
 
 #include <typeinfo>
@@ -28,14 +29,14 @@ namespace ust {
 class registry_event : public lttng::sessiond::trace::event_class {
 public:
        registry_event(unsigned int id,
-                       unsigned int stream_class_id,
-                       int session_objd,
-                       int channel_objd,
-                       std::string name,
-                       std::string signature,
-                       std::vector<lttng::sessiond::trace::field::cuptr> fields,
-                       int loglevel_value,
-                       nonstd::optional<std::string> model_emf_uri);
+                      unsigned int stream_class_id,
+                      int session_objd,
+                      int channel_objd,
+                      std::string name,
+                      std::string signature,
+                      std::vector<lttng::sessiond::trace::field::cuptr> fields,
+                      int loglevel_value,
+                      nonstd::optional<std::string> model_emf_uri);
        ~registry_event() override = default;
        registry_event(const registry_event&) = delete;
        registry_event(registry_event&&) = delete;
@@ -75,13 +76,17 @@ namespace fmt {
 template <>
 struct formatter<lttng::sessiond::ust::registry_event> : formatter<std::string> {
        template <typename FormatContextType>
-       typename FormatContextType::iterator format(
-                       const lttng::sessiond::ust::registry_event& event, FormatContextType& ctx)
+       typename FormatContextType::iterator
+       format(const lttng::sessiond::ust::registry_event& event, FormatContextType& ctx)
        {
-               return format_to(ctx.out(),
-                               "{{ name = `{}`, signature = `{}`, id = {}, session objd = {}, channel objd = {} }}",
-                               event.name, event.signature, event.id, event.session_objd,
-                               event.channel_objd);
+               return format_to(
+                       ctx.out(),
+                       "{{ name = `{}`, signature = `{}`, id = {}, session objd = {}, channel objd = {} }}",
+                       event.name,
+                       event.signature,
+                       event.id,
+                       event.session_objd,
+                       event.channel_objd);
        }
 };
 } /* namespace fmt */
index 4c414a1ec8e6cb0ea827a1f40e4737f039969f54..4cd9911d4f30cde22f3459beb94063bb68296bda 100644 (file)
 #include "trace-class.hpp"
 #include "ust-registry-session.hpp"
 
+#include <lttng/lttng.h>
+
 #include <cstdint>
 #include <ctime>
-#include <lttng/lttng.h>
 #include <string>
 #include <unistd.h>
 
@@ -24,18 +25,18 @@ namespace ust {
 class registry_session_per_pid : public registry_session {
 public:
        registry_session_per_pid(const struct ust_app& app,
-                       const struct lttng::sessiond::trace::abi& trace_abi,
-                       uint32_t major,
-                       uint32_t minor,
-                       const char *root_shm_path,
-                       const char *shm_path,
-                       uid_t euid,
-                       gid_t egid,
-                       uint64_t tracing_id);
+                                const struct lttng::sessiond::trace::abi& trace_abi,
+                                uint32_t major,
+                                uint32_t minor,
+                                const char *root_shm_path,
+                                const char *shm_path,
+                                uid_t euid,
+                                gid_t egid,
+                                uint64_t tracing_id);
 
        virtual lttng_buffer_type buffering_scheme() const noexcept override final;
        virtual void accept(lttng::sessiond::trace::trace_class_environment_visitor&
-                                       environment_visitor) const override final;
+                                   environment_visitor) const override final;
 
 private:
        const unsigned int _tracer_patch_level_version;
index 01f55fc2ebd83e19134efd07a6a63509b5fb8eda..69dc68c25df9e680af3f65d3f0e4b01008f4ed10 100644 (file)
@@ -11,8 +11,9 @@
 #include "trace-class.hpp"
 #include "ust-registry-session.hpp"
 
-#include <cstdint>
 #include <lttng/lttng.h>
+
+#include <cstdint>
 #include <unistd.h>
 
 namespace lttng {
@@ -22,21 +23,20 @@ namespace ust {
 class registry_session_per_uid : public registry_session {
 public:
        registry_session_per_uid(const struct lttng::sessiond::trace::abi& trace_abi,
-                       uint32_t major,
-                       uint32_t minor,
-                       const char *root_shm_path,
-                       const char *shm_path,
-                       uid_t euid,
-                       gid_t egid,
-                       uint64_t tracing_id,
-                       uid_t tracing_uid);
+                                uint32_t major,
+                                uint32_t minor,
+                                const char *root_shm_path,
+                                const char *shm_path,
+                                uid_t euid,
+                                gid_t egid,
+                                uint64_t tracing_id,
+                                uid_t tracing_uid);
 
        virtual lttng_buffer_type buffering_scheme() const noexcept override final;
        virtual void accept(lttng::sessiond::trace::trace_class_environment_visitor&
-                                       environment_visitor) const override final;
+                                   environment_visitor) const override final;
 
 private:
-
        const uid_t _tracing_uid;
 };
 
index 5a26d1aab4215caea21328b7954d13ddbc50b770..bfffe5b50c925b4ef53a7dd630accb4fa4799d6a 100644 (file)
 
 #include <common/make-unique-wrapper.hpp>
 
+#include <lttng/lttng.h>
+
 #include <cstdint>
 #include <ctime>
-#include <lttng/lttng.h>
 #include <string>
 #include <unistd.h>
 
@@ -36,10 +37,11 @@ void locked_registry_session_release(registry_session *session);
 
 class registry_session : public lttng::sessiond::trace::trace_class {
 public:
-       using locked_ptr = std::unique_ptr<registry_session,
-                       lttng::details::create_unique_class<registry_session,
-                                       details::locked_registry_session_release>::
-                                       deleter>;
+       using locked_ptr =
+               std::unique_ptr<registry_session,
+                               lttng::details::create_unique_class<
+                                       registry_session,
+                                       details::locked_registry_session_release>::deleter>;
 
        virtual lttng_buffer_type buffering_scheme() const noexcept = 0;
        locked_ptr lock() noexcept;
@@ -52,12 +54,12 @@ public:
        void remove_channel(uint64_t channel_key, bool notify);
 
        void create_or_find_enum(int session_objd,
-                       const char *enum_name,
-                       struct lttng_ust_ctl_enum_entry *raw_entries,
-                       size_t nr_entries,
-                       uint64_t *enum_id);
-       registry_enum::const_rcu_protected_reference enumeration(
-                       const char *enum_name, uint64_t enum_id) const;
+                                const char *enum_name,
+                                struct lttng_ust_ctl_enum_entry *raw_entries,
+                                size_t nr_entries,
+                                uint64_t *enum_id);
+       registry_enum::const_rcu_protected_reference enumeration(const char *enum_name,
+                                                                uint64_t enum_id) const;
 
        void regenerate_metadata();
 
@@ -102,15 +104,14 @@ public:
 protected:
        /* Prevent instanciation of this base class. */
        registry_session(const struct lttng::sessiond::trace::abi& abi,
-                       unsigned int app_tracer_version_major,
-                       unsigned int app_tracer_version_minor,
-                       const char *root_shm_path,
-                       const char *shm_path,
-                       uid_t euid,
-                       gid_t egid,
-                       uint64_t tracing_id);
-       void accept(
-                       trace::trace_class_environment_visitor& environment_visitor) const override;
+                        unsigned int app_tracer_version_major,
+                        unsigned int app_tracer_version_minor,
+                        const char *root_shm_path,
+                        const char *shm_path,
+                        uid_t euid,
+                        gid_t egid,
+                        uint64_t tracing_id);
+       void accept(trace::trace_class_environment_visitor& environment_visitor) const override;
        void _generate_metadata();
 
 private:
@@ -123,11 +124,9 @@ private:
        lttng::sessiond::trace::type::cuptr _create_packet_header() const;
 
        void _accept_on_clock_classes(
-                       lttng::sessiond::trace::trace_class_visitor& trace_class_visitor)
-                       const final;
+               lttng::sessiond::trace::trace_class_visitor& trace_class_visitor) const final;
        void _accept_on_stream_classes(
-                       lttng::sessiond::trace::trace_class_visitor& trace_class_visitor)
-                       const final;
+               lttng::sessiond::trace::trace_class_visitor& trace_class_visitor) const final;
 
        /* Next channel ID available for a newly registered channel. */
        uint32_t _next_channel_id = 0;
index 5d8bdb7cee020407098f78bbce22eab9236fed1f..4bb14be6fcc7d3a1f6c76ffa674bc847927c3650 100644 (file)
@@ -34,8 +34,8 @@
 #include <string>
 #include <type_traits>
 
-#define CTF_SPEC_MAJOR 1
-#define CTF_SPEC_MINOR 8
+#define CTF_SPEC_MAJOR 1
+#define CTF_SPEC_MINOR 8
 
 struct ust_app;
 
@@ -48,8 +48,8 @@ class registry_session;
 namespace details {
 
 template <class MappingIntegerType>
-typename trace::typed_enumeration_type<MappingIntegerType>::mappings mappings_from_ust_ctl_entries(
-               const lttng_ust_ctl_enum_entry *in_entries, size_t in_entry_count)
+typename trace::typed_enumeration_type<MappingIntegerType>::mappings
+mappings_from_ust_ctl_entries(const lttng_ust_ctl_enum_entry *in_entries, size_t in_entry_count)
 {
        typename trace::typed_enumeration_type<MappingIntegerType>::mappings mappings;
 
@@ -66,10 +66,10 @@ typename trace::typed_enumeration_type<MappingIntegerType>::mappings mappings_fr
                }
 
                next_range_begin = range_end + 1;
-               mappings.emplace_back(entry.string,
-                               typename trace::typed_enumeration_type<
-                                               MappingIntegerType>::mapping::range_t{
-                                               range_begin, range_end});
+               mappings.emplace_back(
+                       entry.string,
+                       typename trace::typed_enumeration_type<MappingIntegerType>::mapping::range_t{
+                               range_begin, range_end });
        }
 
        return mappings;
@@ -78,9 +78,11 @@ typename trace::typed_enumeration_type<MappingIntegerType>::mappings mappings_fr
 
 class registry_enum {
 public:
-       using const_rcu_protected_reference = lttng::locked_reference<const registry_enum, lttng::urcu::unique_read_lock>;
+       using const_rcu_protected_reference =
+               lttng::locked_reference<const registry_enum, lttng::urcu::unique_read_lock>;
 
-       registry_enum(std::string name, enum lttng::sessiond::trace::integer_type::signedness signedness);
+       registry_enum(std::string name,
+                     enum lttng::sessiond::trace::integer_type::signedness signedness);
        virtual ~registry_enum() = default;
        registry_enum(const registry_enum&) = delete;
        registry_enum(registry_enum&&) = delete;
@@ -97,6 +99,7 @@ public:
        struct rcu_head rcu_head;
 
        friend bool operator==(const registry_enum& lhs, const registry_enum& rhs) noexcept;
+
 protected:
        virtual bool _is_equal(const registry_enum& other) const noexcept = 0;
 };
@@ -107,27 +110,27 @@ template <class MappingIntegerType>
 class registry_typed_enum : public registry_enum {
 public:
        registry_typed_enum(const char *in_name,
-                       const lttng_ust_ctl_enum_entry *entries,
-                       size_t entry_count) :
+                           const lttng_ust_ctl_enum_entry *entries,
+                           size_t entry_count) :
                registry_enum(in_name,
-                               std::is_signed<MappingIntegerType>::value ?
-                                               lttng::sessiond::trace::integer_type::signedness::SIGNED :
-                                                     lttng::sessiond::trace::integer_type::signedness::UNSIGNED),
-               _mappings{std::make_shared<
-                               typename trace::typed_enumeration_type<MappingIntegerType>::mappings>(
-                               details::mappings_from_ust_ctl_entries<MappingIntegerType>(
-                                               entries, entry_count))}
+                             std::is_signed<MappingIntegerType>::value ?
+                                     lttng::sessiond::trace::integer_type::signedness::SIGNED :
+                                     lttng::sessiond::trace::integer_type::signedness::UNSIGNED),
+               _mappings{ std::make_shared<
+                       typename trace::typed_enumeration_type<MappingIntegerType>::mappings>(
+                       details::mappings_from_ust_ctl_entries<MappingIntegerType>(entries,
+                                                                                  entry_count)) }
        {
        }
 
        const typename std::shared_ptr<const typename lttng::sessiond::trace::typed_enumeration_type<
-                       MappingIntegerType>::mappings>
-                       _mappings;
+               MappingIntegerType>::mappings>
+               _mappings;
 
 protected:
        bool _is_equal(const registry_enum& base_other) const noexcept override
        {
-               const auto &other = static_cast<decltype(*this)&>(base_other);
+               const autoother = static_cast<decltype(*this)&>(base_other);
 
                /* Don't compare IDs as some comparisons are performed before an id is assigned. */
                return this->name == other.name && *this->_mappings == *other._mappings;
@@ -148,112 +151,112 @@ using registry_unsigned_enum = registry_typed_enum<uint64_t>;
  *
  * Return new instance on success, nullptr on error.
  */
-lttng::sessiond::ust::registry_session *ust_registry_session_per_uid_create(
-               const lttng::sessiond::trace::abi& abi,
-               uint32_t major,
-               uint32_t minor,
-               const char *root_shm_path,
-               const char *shm_path,
-               uid_t euid,
-               gid_t egid,
-               uint64_t tracing_id,
-               uid_t tracing_uid);
+lttng::sessiond::ust::registry_session *
+ust_registry_session_per_uid_create(const lttng::sessiond::trace::abi& abi,
+                                   uint32_t major,
+                                   uint32_t minor,
+                                   const char *root_shm_path,
+                                   const char *shm_path,
+                                   uid_t euid,
+                                   gid_t egid,
+                                   uint64_t tracing_id,
+                                   uid_t tracing_uid);
 
 /*
  * Create per-pid registry with default values.
  *
  * Return new instance on success, nullptr on error.
  */
-lttng::sessiond::ust::registry_session *ust_registry_session_per_pid_create(struct ust_app *app,
-               const lttng::sessiond::trace::abi& abi,
-               uint32_t major,
-               uint32_t minor,
-               const char *root_shm_path,
-               const char *shm_path,
-               uid_t euid,
-               gid_t egid,
-               uint64_t tracing_id);
+lttng::sessiond::ust::registry_session *
+ust_registry_session_per_pid_create(struct ust_app *app,
+                                   const lttng::sessiond::trace::abi& abi,
+                                   uint32_t major,
+                                   uint32_t minor,
+                                   const char *root_shm_path,
+                                   const char *shm_path,
+                                   uid_t euid,
+                                   gid_t egid,
+                                   uint64_t tracing_id);
 void ust_registry_session_destroy(lttng::sessiond::ust::registry_session *session);
 
 void ust_registry_channel_destroy_event(lttng::sessiond::ust::registry_channel *chan,
-               lttng::sessiond::ust::registry_event *event);
+                                       lttng::sessiond::ust::registry_event *event);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline
-lttng::sessiond::ust::registry_session *ust_registry_session_per_uid_create(
-               uint32_t bits_per_long __attribute__((unused)),
-               uint32_t uint8_t_alignment __attribute__((unused)),
-               uint32_t uint16_t_alignment __attribute__((unused)),
-               uint32_t uint32_t_alignment __attribute__((unused)),
-               uint32_t uint64_t_alignment __attribute__((unused)),
-               uint32_t long_alignment __attribute__((unused)),
-               int byte_order __attribute__((unused)),
-               uint32_t major __attribute__((unused)),
-               uint32_t minor __attribute__((unused)),
-               const char *root_shm_path __attribute__((unused)),
-               const char *shm_path __attribute__((unused)),
-               uid_t euid __attribute__((unused)),
-               gid_t egid __attribute__((unused)),
-               uint64_t tracing_id __attribute__((unused)),
-               uid_t tracing_uid __attribute__((unused)))
+static inline lttng::sessiond::ust::registry_session *
+ust_registry_session_per_uid_create(uint32_t bits_per_long __attribute__((unused)),
+                                   uint32_t uint8_t_alignment __attribute__((unused)),
+                                   uint32_t uint16_t_alignment __attribute__((unused)),
+                                   uint32_t uint32_t_alignment __attribute__((unused)),
+                                   uint32_t uint64_t_alignment __attribute__((unused)),
+                                   uint32_t long_alignment __attribute__((unused)),
+                                   int byte_order __attribute__((unused)),
+                                   uint32_t major __attribute__((unused)),
+                                   uint32_t minor __attribute__((unused)),
+                                   const char *root_shm_path __attribute__((unused)),
+                                   const char *shm_path __attribute__((unused)),
+                                   uid_t euid __attribute__((unused)),
+                                   gid_t egid __attribute__((unused)),
+                                   uint64_t tracing_id __attribute__((unused)),
+                                   uid_t tracing_uid __attribute__((unused)))
 {
        return nullptr;
 }
 
-static inline
-lttng::sessiond::ust::registry_session *ust_registry_session_per_pid_create(
-               struct ust_app *app __attribute__((unused)),
-               uint32_t bits_per_long __attribute__((unused)),
-               uint32_t uint8_t_alignment __attribute__((unused)),
-               uint32_t uint16_t_alignment __attribute__((unused)),
-               uint32_t uint32_t_alignment __attribute__((unused)),
-               uint32_t uint64_t_alignment __attribute__((unused)),
-               uint32_t long_alignment __attribute__((unused)),
-               int byte_order __attribute__((unused)),
-               uint32_t major __attribute__((unused)),
-               uint32_t minor __attribute__((unused)),
-               const char *root_shm_path __attribute__((unused)),
-               const char *shm_path __attribute__((unused)),
-               uid_t euid __attribute__((unused)),
-               gid_t egid __attribute__((unused)),
-               uint64_t tracing_id __attribute__((unused)))
+static inline lttng::sessiond::ust::registry_session *
+ust_registry_session_per_pid_create(struct ust_app *app __attribute__((unused)),
+                                   uint32_t bits_per_long __attribute__((unused)),
+                                   uint32_t uint8_t_alignment __attribute__((unused)),
+                                   uint32_t uint16_t_alignment __attribute__((unused)),
+                                   uint32_t uint32_t_alignment __attribute__((unused)),
+                                   uint32_t uint64_t_alignment __attribute__((unused)),
+                                   uint32_t long_alignment __attribute__((unused)),
+                                   int byte_order __attribute__((unused)),
+                                   uint32_t major __attribute__((unused)),
+                                   uint32_t minor __attribute__((unused)),
+                                   const char *root_shm_path __attribute__((unused)),
+                                   const char *shm_path __attribute__((unused)),
+                                   uid_t euid __attribute__((unused)),
+                                   gid_t egid __attribute__((unused)),
+                                   uint64_t tracing_id __attribute__((unused)))
 {
        return nullptr;
 }
 
-static inline
-void ust_registry_session_destroy(
-               lttng::sessiond::ust::registry_session *session __attribute__((unused)))
-{}
+static inline void ust_registry_session_destroy(lttng::sessiond::ust::registry_session *session
+                                               __attribute__((unused)))
+{
+}
 
-static inline
-void ust_registry_destroy_event(
-               lttng::sessiond::ust::registry_channel *chan __attribute__((unused)),
-               lttng::sessiond::ust::registry_event *event __attribute__((unused)))
-{}
+static inline void ust_registry_destroy_event(lttng::sessiond::ust::registry_channel *chan
+                                             __attribute__((unused)),
+                                             lttng::sessiond::ust::registry_event *event
+                                             __attribute__((unused)))
+{
+}
 
 /* The app object can be NULL for registry shared across applications. */
-static inline
-int ust_metadata_session_statedump(
-               lttng::sessiond::ust::registry_session *session __attribute__((unused)))
+static inline int ust_metadata_session_statedump(lttng::sessiond::ust::registry_session *session
+                                                __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_metadata_channel_statedump(
-               lttng::sessiond::ust::registry_session *session __attribute__((unused)),
-               lttng::sessiond::ust::registry_channel *chan __attribute__((unused)))
+static inline int ust_metadata_channel_statedump(lttng::sessiond::ust::registry_session *session
+                                                __attribute__((unused)),
+                                                lttng::sessiond::ust::registry_channel *chan
+                                                __attribute__((unused)))
 {
        return 0;
 }
 
-static inline
-int ust_metadata_event_statedump(
-               lttng::sessiond::ust::registry_session *session __attribute__((unused)),
-               lttng::sessiond::ust::registry_channel *chan __attribute__((unused)),
-               lttng::sessiond::ust::registry_event *event __attribute__((unused)))
+static inline int ust_metadata_event_statedump(lttng::sessiond::ust::registry_session *session
+                                              __attribute__((unused)),
+                                              lttng::sessiond::ust::registry_channel *chan
+                                              __attribute__((unused)),
+                                              lttng::sessiond::ust::registry_event *event
+                                              __attribute__((unused)))
 {
        return 0;
 }
index 5c1ff2e7335be1202337c53468b167a50b0a0e25..f87a4aced738f17a40019fc82dc4601c6fea0ed5 100644 (file)
@@ -14,8 +14,7 @@ void lttng_ust_handle_sigbus(void *address);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline
-void lttng_ust_handle_sigbus(void *address __attribute__((unused)))
+static inline void lttng_ust_handle_sigbus(void *address __attribute__((unused)))
 {
 }
 
index 5cbf7487ff5abb7a1b7e3cbbdcdfab550e754b5b..9ad48e1060cee85c17f9ccd89de538fb250782e3 100644 (file)
@@ -14,8 +14,11 @@ struct consumer_output;
 
 const char *get_home_dir(void);
 int notify_thread_pipe(int wpipe);
-int loglevels_match(int a_loglevel_type, int a_loglevel_value,
-       int b_loglevel_type, int b_loglevel_value, int loglevel_all_type);
+int loglevels_match(int a_loglevel_type,
+                   int a_loglevel_value,
+                   int b_loglevel_type,
+                   int b_loglevel_value,
+                   int loglevel_all_type);
 const char *session_get_base_path(const struct ltt_session *session);
 const char *consumer_output_get_base_path(const struct consumer_output *output);
 
index c707267cdbbed622d5b2d8685f8249dddf697657..2545104ed582e2dac77791da0a98d75661d1e4fc 100644 (file)
@@ -8,32 +8,32 @@
 #ifndef _LTTNG_CMD_H
 #define _LTTNG_CMD_H
 
-#include <lttng/lttng.h>
+#include "conf.hpp"
+#include "utils.hpp"
+
 #include <common/common.hpp>
 #include <common/defaults.hpp>
 
-#include "conf.hpp"
-#include "utils.hpp"
+#include <lttng/lttng.h>
 
-#define DECL_COMMAND(_name) \
-       extern int cmd_##_name(int, const char **)
+#define DECL_COMMAND(_name) extern int cmd_##_name(int, const char **)
 
 #ifdef LTTNG_EMBED_HELP
-# define HELP_MSG_NAME         help_msg
-# define SHOW_HELP_ERROR_LINE  ERR("Cannot show --help for `lttng-%s`", argv[0]);
+#define HELP_MSG_NAME       help_msg
+#define SHOW_HELP_ERROR_LINE ERR("Cannot show --help for `lttng-%s`", argv[0]);
 #else
-# define HELP_MSG_NAME         NULL
-# define SHOW_HELP_ERROR_LINE  ;
+#define HELP_MSG_NAME       NULL
+#define SHOW_HELP_ERROR_LINE ;
 #endif
 
-#define SHOW_HELP()                                                    \
-       do {                                                            \
-               ret = show_cmd_help(argv[0], HELP_MSG_NAME);            \
-                                                                       \
-               if (ret) {                                              \
-                       SHOW_HELP_ERROR_LINE                            \
-                       ret = CMD_ERROR;                                \
-               }                                                       \
+#define SHOW_HELP()                                          \
+       do {                                                 \
+               ret = show_cmd_help(argv[0], HELP_MSG_NAME); \
+                                                             \
+               if (ret) {                                   \
+                       SHOW_HELP_ERROR_LINE                 \
+                       ret = CMD_ERROR;                     \
+               }                                            \
        } while (0)
 
 enum cmd_error_code {
@@ -81,7 +81,6 @@ DECL_COMMAND(add_trigger);
 DECL_COMMAND(list_triggers);
 DECL_COMMAND(remove_trigger);
 
-extern int cmd_help(int argc, const char **argv,
-               const struct cmd_struct commands[]);
+extern int cmd_help(int argc, const char **argv, const struct cmd_struct commands[]);
 
 #endif /* _LTTNG_CMD_H */
index 454cb755c9d0b11de0f99ce80b42770dae58239f..40e85e7c8afe6b447f1cacda25ba6d4d20ef0de9 100644 (file)
@@ -210,7 +210,8 @@ static int disable_events(char *session_name, char *event_list)
        event.type = (lttng_event_type) opt_event_type;
 
        if (opt_disable_all) {
-               const int disable_ret = lttng_disable_event_ext(handle, &event, channel_name, nullptr);
+               const int disable_ret =
+                       lttng_disable_event_ext(handle, &event, channel_name, nullptr);
 
                if (disable_ret < 0) {
                        ERR("%s", lttng_strerror(command_ret));
index f2cc9139b3914bc10e9ff3d77c1bc78e5e685d2e..76c5ce021e2a26759ba8dfd3415ef9b40ac91fe1 100644 (file)
@@ -8,35 +8,33 @@
 #ifndef _LTTNG_LOGLEVEL_UTILS_H
 #define _LTTNG_LOGLEVEL_UTILS_H
 
-#include <lttng/lttng.h>
 #include <common/macros.hpp>
 
+#include <lttng/lttng.h>
+
 int loglevel_name_to_value(const char *name, enum lttng_loglevel *loglevel);
 
 bool loglevel_parse_range_string(const char *str,
-               enum lttng_loglevel *min,
-               enum lttng_loglevel *max);
+                                enum lttng_loglevel *min,
+                                enum lttng_loglevel *max);
 
-int loglevel_log4j_name_to_value(
-               const char *name, enum lttng_loglevel_log4j *loglevel);
+int loglevel_log4j_name_to_value(const char *name, enum lttng_loglevel_log4j *loglevel);
 
 bool loglevel_log4j_parse_range_string(const char *str,
-               enum lttng_loglevel_log4j *min,
-               enum lttng_loglevel_log4j *max);
+                                      enum lttng_loglevel_log4j *min,
+                                      enum lttng_loglevel_log4j *max);
 
-int loglevel_jul_name_to_value(
-               const char *name, enum lttng_loglevel_jul *loglevel);
+int loglevel_jul_name_to_value(const char *name, enum lttng_loglevel_jul *loglevel);
 
 bool loglevel_jul_parse_range_string(const char *str,
-               enum lttng_loglevel_jul *min,
-               enum lttng_loglevel_jul *max);
+                                    enum lttng_loglevel_jul *min,
+                                    enum lttng_loglevel_jul *max);
 
-int loglevel_python_name_to_value(
-               const char *name, enum lttng_loglevel_python *loglevel);
+int loglevel_python_name_to_value(const char *name, enum lttng_loglevel_python *loglevel);
 
 bool loglevel_python_parse_range_string(const char *str,
-               enum lttng_loglevel_python *min,
-               enum lttng_loglevel_python *max);
+                                       enum lttng_loglevel_python *min,
+                                       enum lttng_loglevel_python *max);
 
 const char *loglevel_value_to_name(int loglevel);
 
index 83733129142fb1b2cd39b2148f9fb8c1b77e66da..413dd02ab0fc7fb66c362ea1f8613975a3386b2f 100644 (file)
@@ -12,7 +12,6 @@
 
 struct lttng_userspace_probe_location;
 
-int parse_userspace_probe_opts(const char *opt,
-               struct lttng_userspace_probe_location **uprobe_loc);
+int parse_userspace_probe_opts(const char *opt, struct lttng_userspace_probe_location **uprobe_loc);
 
 #endif /* SRC_BIN_LTTNG_UPROBE_H */
index bb1c2cdfbbbbeba767fec438a51d3d14c9750f17..64605575e94c33da7c3fdb0f2e4d52bf67a817b0 100644 (file)
@@ -8,15 +8,16 @@
 #ifndef _LTTNG_UTILS_H
 #define _LTTNG_UTILS_H
 
-#include <popt.h>
 #include <common/argpar/argpar.h>
 #include <common/dynamic-array.hpp>
 
 #include <lttng/lttng.h>
 
+#include <popt.h>
+
 extern char *opt_relayd_path;
 extern int opt_no_sessiond;
-extern char * opt_sessiond_path;
+extern char *opt_sessiond_path;
 extern pid_t sessiond_pid;
 
 struct cmd_struct;
@@ -47,8 +48,7 @@ int get_count_order_ulong(unsigned long x);
 
 const char *get_event_type_str(enum lttng_event_type event_type);
 
-int print_missing_or_multiple_domains(unsigned int domain_count,
-               bool include_agent_domains);
+int print_missing_or_multiple_domains(unsigned int domain_count, bool include_agent_domains);
 
 int spawn_relayd(const char *pathname, int port);
 int check_relayd(void);
@@ -56,11 +56,10 @@ void print_session_stats(const char *session_name);
 int get_session_stats_str(const char *session_name, char **str);
 int show_cmd_help(const char *cmd_name, const char *help_msg);
 
-int print_trace_archive_location(
-               const struct lttng_trace_archive_location *location,
-               const char *session_name);
+int print_trace_archive_location(const struct lttng_trace_archive_location *location,
+                                const char *session_name);
 
 int validate_exclusion_list(const char *event_name,
-               const struct lttng_dynamic_pointer_array *exclusions);
+                           const struct lttng_dynamic_pointer_array *exclusions);
 
 #endif /* _LTTNG_UTILS_H */
index c957824af72d265800a1bd2ab0cd5e3179d3c051..fab15af8c77619c5b68a79e9c7d7c70b69911637 100644 (file)
  * Align value to the next multiple of align. Returns val if it already is a
  * multiple of align. Align must be a power of two.
  */
-#define __lttng_align_ceil_mask(v, mask)       (((v) + (mask)) & ~(mask))
+#define __lttng_align_ceil_mask(v, mask) (((v) + (mask)) & ~(mask))
 
-#define lttng_align_ceil(v, align) \
-       __lttng_align_ceil_mask(v, (__typeof__(v)) (align) - 1)
+#define lttng_align_ceil(v, align) __lttng_align_ceil_mask(v, (__typeof__(v)) (align) -1)
 
 /*
  * Align value to the previous multiple of align. Returns val if it already is a
  * multiple of align. Align must be a power of two.
  */
-#define __lttng_align_floor_mask(v, mask)      ((v) & ~(mask))
+#define __lttng_align_floor_mask(v, mask) ((v) & ~(mask))
 
-#define lttng_align_floor(v, align) \
-       __lttng_align_floor_mask(v, (__typeof__(v)) (align) - 1)
+#define lttng_align_floor(v, align) __lttng_align_floor_mask(v, (__typeof__(v)) (align) -1)
 
 /**
  * lttng_offset_align - Calculate the offset needed to align an object on its natural
  * Returns the offset that must be added to align towards higher
  * addresses.
  */
-#define lttng_offset_align(align_drift, alignment)                                    \
-       ({                                                                     \
-               LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0                    \
-                                  || ((alignment) & ((alignment) - 1)));      \
-               (((alignment) - (align_drift)) & ((alignment) - 1));           \
+#define lttng_offset_align(align_drift, alignment)                                                \
+       ({                                                                                        \
+               LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0 || ((alignment) & ((alignment) -1))); \
+               (((alignment) - (align_drift)) & ((alignment) -1));                               \
        })
 
 /**
  *
  * Returns the offset that must be substracted to align towards lower addresses.
  */
-#define lttng_offset_align_floor(align_drift, alignment)                              \
-       ({                                                                     \
-               LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0                    \
-                                  || ((alignment) & ((alignment) - 1)));      \
-               (((align_drift) - (alignment)) & ((alignment) - 1));           \
+#define lttng_offset_align_floor(align_drift, alignment)                                          \
+       ({                                                                                        \
+               LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0 || ((alignment) & ((alignment) -1))); \
+               (((align_drift) - (alignment)) & ((alignment) -1));                               \
        })
 
 #endif /* _LTTNG_ALIGN_H */
index b77609edd5b53f35ea08da0b9e8f38c052c97d88..4d25b3a705ad13c3fbffeb764036a4c1d612d8fb 100644 (file)
@@ -8,20 +8,19 @@
 #ifndef COMMON_ARGPAR_UTILS_H
 #define COMMON_ARGPAR_UTILS_H
 
-#include <stdarg.h>
-
-#include <common/macros.hpp>
 #include <common/argpar/argpar.h>
+#include <common/macros.hpp>
 #include <common/string-utils/format.hpp>
 
+#include <stdarg.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #define WHILE_PARSING_ARG_N_ARG_FMT "While parsing argument #%d (`%s`): "
 
-enum parse_next_item_status
-{
+enum parse_next_item_status {
        PARSE_NEXT_ITEM_STATUS_OK = 0,
        PARSE_NEXT_ITEM_STATUS_END = 1,
        PARSE_NEXT_ITEM_STATUS_ERROR = -1,
@@ -53,10 +52,13 @@ enum parse_next_item_status
  */
 ATTR_FORMAT_PRINTF(7, 8)
 enum parse_next_item_status parse_next_item(struct argpar_iter *iter,
-               const struct argpar_item **item, int argc_offset,
-               const char **argv, bool unknown_opt_is_error,
-               const struct argpar_error **error_out,
-               const char *context_fmt, ...);
+                                           const struct argpar_item **item,
+                                           int argc_offset,
+                                           const char **argv,
+                                           bool unknown_opt_is_error,
+                                           const struct argpar_error **error_out,
+                                           const char *context_fmt,
+                                           ...);
 
 #ifdef __cplusplus
 }
index 82b561ceaae707002f36754c55e828d35b882206..f8280ce1423a5c609fd34e5451bab875c4e186eb 100644 (file)
@@ -5,19 +5,17 @@
  * Copyright (c) 2020-2021 Simon Marchi <simon.marchi@efficios.com>
  */
 
+#include "argpar.h"
+
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "argpar.h"
-
-#define ARGPAR_REALLOC(_ptr, _type, _nmemb)                            \
-       ((_type *) realloc(_ptr, (_nmemb) * sizeof(_type)))
+#define ARGPAR_REALLOC(_ptr, _type, _nmemb) ((_type *) realloc(_ptr, (_nmemb) * sizeof(_type)))
 
-#define ARGPAR_CALLOC(_type, _nmemb)                                   \
-       ((_type *) calloc((_nmemb), sizeof(_type)))
+#define ARGPAR_CALLOC(_type, _nmemb) ((_type *) calloc((_nmemb), sizeof(_type)))
 
 #define ARGPAR_ZALLOC(_type) ARGPAR_CALLOC(_type, 1)
 
  * Force usage of the assertion condition to prevent unused variable warnings
  * when `assert()` are disabled by the `NDEBUG` definition.
  */
-# define ARGPAR_ASSERT(_cond) ((void) sizeof((void) (_cond), 0))
+#define ARGPAR_ASSERT(_cond) ((void) sizeof((void) (_cond), 0))
 #else
-# include <assert.h>
-# define ARGPAR_ASSERT(_cond) assert(_cond)
+#include <assert.h>
+#define ARGPAR_ASSERT(_cond) assert(_cond)
 #endif
 
 /*
@@ -45,7 +43,7 @@ struct argpar_iter {
         */
        struct {
                unsigned int argc;
-               const char * const *argv;
+               const char *const *argv;
                const struct argpar_opt_descr *descrs;
        } user;
 
@@ -128,15 +126,14 @@ struct argpar_error {
 };
 
 ARGPAR_HIDDEN
-enum argpar_item_type argpar_item_type(const struct argpar_item * const item)
+enum argpar_item_type argpar_item_type(const struct argpar_item *const item)
 {
        ARGPAR_ASSERT(item);
        return item->type;
 }
 
 ARGPAR_HIDDEN
-const struct argpar_opt_descr *argpar_item_opt_descr(
-               const struct argpar_item * const item)
+const struct argpar_opt_descr *argpar_item_opt_descr(const struct argpar_item *const item)
 {
        ARGPAR_ASSERT(item);
        ARGPAR_ASSERT(item->type == ARGPAR_ITEM_TYPE_OPT);
@@ -144,7 +141,7 @@ const struct argpar_opt_descr *argpar_item_opt_descr(
 }
 
 ARGPAR_HIDDEN
-const char *argpar_item_opt_arg(const struct argpar_item * const item)
+const char *argpar_item_opt_arg(const struct argpar_item *const item)
 {
        ARGPAR_ASSERT(item);
        ARGPAR_ASSERT(item->type == ARGPAR_ITEM_TYPE_OPT);
@@ -152,7 +149,7 @@ const char *argpar_item_opt_arg(const struct argpar_item * const item)
 }
 
 ARGPAR_HIDDEN
-const char *argpar_item_non_opt_arg(const struct argpar_item * const item)
+const char *argpar_item_non_opt_arg(const struct argpar_item *const item)
 {
        ARGPAR_ASSERT(item);
        ARGPAR_ASSERT(item->type == ARGPAR_ITEM_TYPE_NON_OPT);
@@ -160,8 +157,7 @@ const char *argpar_item_non_opt_arg(const struct argpar_item * const item)
 }
 
 ARGPAR_HIDDEN
-unsigned int argpar_item_non_opt_orig_index(
-               const struct argpar_item * const item)
+unsigned int argpar_item_non_opt_orig_index(const struct argpar_item *const item)
 {
        ARGPAR_ASSERT(item);
        ARGPAR_ASSERT(item->type == ARGPAR_ITEM_TYPE_NON_OPT);
@@ -169,8 +165,7 @@ unsigned int argpar_item_non_opt_orig_index(
 }
 
 ARGPAR_HIDDEN
-unsigned int argpar_item_non_opt_non_opt_index(
-               const struct argpar_item * const item)
+unsigned int argpar_item_non_opt_non_opt_index(const struct argpar_item *const item)
 {
        ARGPAR_ASSERT(item);
        ARGPAR_ASSERT(item->type == ARGPAR_ITEM_TYPE_NON_OPT);
@@ -178,15 +173,14 @@ unsigned int argpar_item_non_opt_non_opt_index(
 }
 
 ARGPAR_HIDDEN
-void argpar_item_destroy(const struct argpar_item * const item)
+void argpar_item_destroy(const struct argpar_item *const item)
 {
        if (!item) {
                goto end;
        }
 
        if (item->type == ARGPAR_ITEM_TYPE_OPT) {
-               struct argpar_item_opt * const opt_item =
-                       (struct argpar_item_opt *) item;
+               struct argpar_item_opt *const opt_item = (struct argpar_item_opt *) item;
 
                free(opt_item->arg);
        }
@@ -203,13 +197,10 @@ end:
  *
  * Returns `NULL` on memory error.
  */
-static
-struct argpar_item_opt *create_opt_item(
-               const struct argpar_opt_descr * const descr,
-               const char * const arg)
+static struct argpar_item_opt *create_opt_item(const struct argpar_opt_descr *const descr,
+                                              const char *const arg)
 {
-       struct argpar_item_opt *opt_item =
-               ARGPAR_ZALLOC(struct argpar_item_opt);
+       struct argpar_item_opt *opt_item = ARGPAR_ZALLOC(struct argpar_item_opt);
 
        if (!opt_item) {
                goto end;
@@ -242,13 +233,11 @@ end:
  *
  * Returns `NULL` on memory error.
  */
-static
-struct argpar_item_non_opt *create_non_opt_item(const char * const arg,
-               const unsigned int orig_index,
-               const unsigned int non_opt_index)
+static struct argpar_item_non_opt *create_non_opt_item(const char *const arg,
+                                                      const unsigned int orig_index,
+                                                      const unsigned int non_opt_index)
 {
-       struct argpar_item_non_opt * const non_opt_item =
-               ARGPAR_ZALLOC(struct argpar_item_non_opt);
+       struct argpar_item_non_opt *const non_opt_item = ARGPAR_ZALLOC(struct argpar_item_non_opt);
 
        if (!non_opt_item) {
                goto end;
@@ -274,12 +263,11 @@ end:
  * Returns 0 on success (including if `error` is `NULL`) or -1 on memory
  * error.
  */
-static
-int set_error(struct argpar_error ** const error,
-               enum argpar_error_type type,
-               const char * const unknown_opt_name,
-               const struct argpar_opt_descr * const opt_descr,
-               const bool is_short)
+static int set_error(struct argpar_error **const error,
+                    enum argpar_error_type type,
+                    const char *const unknown_opt_name,
+                    const struct argpar_opt_descr *const opt_descr,
+                    const bool is_short)
 {
        int ret = 0;
 
@@ -295,8 +283,8 @@ int set_error(struct argpar_error ** const error,
        (*error)->type = type;
 
        if (unknown_opt_name) {
-               (*error)->unknown_opt_name = ARGPAR_CALLOC(char,
-                       strlen(unknown_opt_name) + 1 + (is_short ? 1 : 2));
+               (*error)->unknown_opt_name =
+                       ARGPAR_CALLOC(char, strlen(unknown_opt_name) + 1 + (is_short ? 1 : 2));
                if (!(*error)->unknown_opt_name) {
                        goto error;
                }
@@ -323,23 +311,21 @@ end:
 }
 
 ARGPAR_HIDDEN
-enum argpar_error_type argpar_error_type(
-               const struct argpar_error * const error)
+enum argpar_error_type argpar_error_type(const struct argpar_error *const error)
 {
        ARGPAR_ASSERT(error);
        return error->type;
 }
 
 ARGPAR_HIDDEN
-unsigned int argpar_error_orig_index(const struct argpar_error * const error)
+unsigned int argpar_error_orig_index(const struct argpar_error *const error)
 {
        ARGPAR_ASSERT(error);
        return error->orig_index;
 }
 
 ARGPAR_HIDDEN
-const char *argpar_error_unknown_opt_name(
-               const struct argpar_error * const error)
+const char *argpar_error_unknown_opt_name(const struct argpar_error *const error)
 {
        ARGPAR_ASSERT(error);
        ARGPAR_ASSERT(error->type == ARGPAR_ERROR_TYPE_UNKNOWN_OPT);
@@ -348,12 +334,12 @@ const char *argpar_error_unknown_opt_name(
 }
 
 ARGPAR_HIDDEN
-const struct argpar_opt_descr *argpar_error_opt_descr(
-               const struct argpar_error * const error, bool * const is_short)
+const struct argpar_opt_descr *argpar_error_opt_descr(const struct argpar_error *const error,
+                                                     bool *const is_short)
 {
        ARGPAR_ASSERT(error);
        ARGPAR_ASSERT(error->type == ARGPAR_ERROR_TYPE_MISSING_OPT_ARG ||
-               error->type == ARGPAR_ERROR_TYPE_UNEXPECTED_OPT_ARG);
+                     error->type == ARGPAR_ERROR_TYPE_UNEXPECTED_OPT_ARG);
        ARGPAR_ASSERT(error->opt_descr);
 
        if (is_short) {
@@ -364,7 +350,7 @@ const struct argpar_opt_descr *argpar_error_opt_descr(
 }
 
 ARGPAR_HIDDEN
-void argpar_error_destroy(const struct argpar_error * const error)
+void argpar_error_destroy(const struct argpar_error *const error)
 {
        if (error) {
                free(error->unknown_opt_name);
@@ -383,21 +369,18 @@ void argpar_error_destroy(const struct argpar_error * const error)
  *
  * Returns `NULL` if no descriptor is found.
  */
-static
-const struct argpar_opt_descr *find_descr(
-               const struct argpar_opt_descr * const descrs,
-               const char short_name, const char * const long_name)
+static const struct argpar_opt_descr *find_descr(const struct argpar_opt_descr *const descrs,
+                                                const char short_name,
+                                                const char *const long_name)
 {
        const struct argpar_opt_descr *descr;
 
        for (descr = descrs; descr->short_name || descr->long_name; descr++) {
-               if (short_name && descr->short_name &&
-                               short_name == descr->short_name) {
+               if (short_name && descr->short_name && short_name == descr->short_name) {
                        goto end;
                }
 
-               if (long_name && descr->long_name &&
-                               strcmp(long_name, descr->long_name) == 0) {
+               if (long_name && descr->long_name && strcmp(long_name, descr->long_name) == 0) {
                        goto end;
                }
        }
@@ -422,14 +405,13 @@ enum parse_orig_arg_opt_ret {
  * On error (except for `PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY`), sets
  * `*error`.
  */
-static
-enum parse_orig_arg_opt_ret parse_short_opt_group(
-               const char * const short_opt_group,
-               const char * const next_orig_arg,
-               const struct argpar_opt_descr * const descrs,
-               struct argpar_iter * const iter,
-               struct argpar_error ** const error,
-               struct argpar_item ** const item)
+static enum parse_orig_arg_opt_ret
+parse_short_opt_group(const char *const short_opt_group,
+                     const char *const next_orig_arg,
+                     const struct argpar_opt_descr *const descrs,
+                     struct argpar_iter *const iter,
+                     struct argpar_error **const error,
+                     struct argpar_item **const item)
 {
        enum parse_orig_arg_opt_ret ret = PARSE_ORIG_ARG_OPT_RET_OK;
        bool used_next_orig_arg = false;
@@ -446,13 +428,11 @@ enum parse_orig_arg_opt_ret parse_short_opt_group(
        /* Find corresponding option descriptor */
        descr = find_descr(descrs, *iter->short_opt_group_ch, NULL);
        if (!descr) {
-               const char unknown_opt_name[] =
-                       {*iter->short_opt_group_ch, '\0'};
+               const char unknown_opt_name[] = { *iter->short_opt_group_ch, '\0' };
 
                ret = PARSE_ORIG_ARG_OPT_RET_ERROR;
 
-               if (set_error(error, ARGPAR_ERROR_TYPE_UNKNOWN_OPT,
-                               unknown_opt_name, NULL, true)) {
+               if (set_error(error, ARGPAR_ERROR_TYPE_UNKNOWN_OPT, unknown_opt_name, NULL, true)) {
                        ret = PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY;
                }
 
@@ -473,12 +453,10 @@ enum parse_orig_arg_opt_ret parse_short_opt_group(
                 * We accept `-o ''` (empty option argument), but not
                 * `-o` alone if an option argument is expected.
                 */
-               if (!opt_arg || (iter->short_opt_group_ch[1] &&
-                               strlen(opt_arg) == 0)) {
+               if (!opt_arg || (iter->short_opt_group_ch[1] && strlen(opt_arg) == 0)) {
                        ret = PARSE_ORIG_ARG_OPT_RET_ERROR;
 
-                       if (set_error(error, ARGPAR_ERROR_TYPE_MISSING_OPT_ARG,
-                                       NULL, descr, true)) {
+                       if (set_error(error, ARGPAR_ERROR_TYPE_MISSING_OPT_ARG, NULL, descr, true)) {
                                ret = PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY;
                        }
 
@@ -524,13 +502,12 @@ end:
  * On error (except for `PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY`), sets
  * `*error`.
  */
-static
-enum parse_orig_arg_opt_ret parse_long_opt(const char * const long_opt_arg,
-               const char * const next_orig_arg,
-               const struct argpar_opt_descr * const descrs,
-               struct argpar_iter * const iter,
-               struct argpar_error ** const error,
-               struct argpar_item ** const item)
+static enum parse_orig_arg_opt_ret parse_long_opt(const char *const long_opt_arg,
+                                                 const char *const next_orig_arg,
+                                                 const struct argpar_opt_descr *const descrs,
+                                                 struct argpar_iter *const iter,
+                                                 struct argpar_error **const error,
+                                                 struct argpar_item **const item)
 {
        enum parse_orig_arg_opt_ret ret = PARSE_ORIG_ARG_OPT_RET_OK;
        const struct argpar_opt_descr *descr;
@@ -556,8 +533,8 @@ enum parse_orig_arg_opt_ret parse_long_opt(const char * const long_opt_arg,
                /* Isolate the option name */
                while (long_opt_name_size > iter->tmp_buf.size - 1) {
                        iter->tmp_buf.size *= 2;
-                       iter->tmp_buf.data = ARGPAR_REALLOC(iter->tmp_buf.data,
-                               char, iter->tmp_buf.size);
+                       iter->tmp_buf.data =
+                               ARGPAR_REALLOC(iter->tmp_buf.data, char, iter->tmp_buf.size);
                        if (!iter->tmp_buf.data) {
                                ret = PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY;
                                goto error;
@@ -574,8 +551,7 @@ enum parse_orig_arg_opt_ret parse_long_opt(const char * const long_opt_arg,
        if (!descr) {
                ret = PARSE_ORIG_ARG_OPT_RET_ERROR;
 
-               if (set_error(error, ARGPAR_ERROR_TYPE_UNKNOWN_OPT,
-                               long_opt_name, NULL, false)) {
+               if (set_error(error, ARGPAR_ERROR_TYPE_UNKNOWN_OPT, long_opt_name, NULL, false)) {
                        ret = PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY;
                }
 
@@ -592,8 +568,11 @@ enum parse_orig_arg_opt_ret parse_long_opt(const char * const long_opt_arg,
                        if (!next_orig_arg) {
                                ret = PARSE_ORIG_ARG_OPT_RET_ERROR;
 
-                               if (set_error(error, ARGPAR_ERROR_TYPE_MISSING_OPT_ARG,
-                                               NULL, descr, false)) {
+                               if (set_error(error,
+                                             ARGPAR_ERROR_TYPE_MISSING_OPT_ARG,
+                                             NULL,
+                                             descr,
+                                             false)) {
                                        ret = PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY;
                                }
 
@@ -610,8 +589,7 @@ enum parse_orig_arg_opt_ret parse_long_opt(const char * const long_opt_arg,
                 */
                ret = PARSE_ORIG_ARG_OPT_RET_ERROR;
 
-               if (set_error(error, ARGPAR_ERROR_TYPE_UNEXPECTED_OPT_ARG,
-                               NULL, descr, false)) {
+               if (set_error(error, ARGPAR_ERROR_TYPE_UNEXPECTED_OPT_ARG, NULL, descr, false)) {
                        ret = PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY;
                }
 
@@ -648,13 +626,12 @@ end:
  * On error (except for `PARSE_ORIG_ARG_OPT_RET_ERROR_MEMORY`), sets
  * `*error`.
  */
-static
-enum parse_orig_arg_opt_ret parse_orig_arg_opt(const char * const orig_arg,
-               const char * const next_orig_arg,
-               const struct argpar_opt_descr * const descrs,
-               struct argpar_iter * const iter,
-               struct argpar_error ** const error,
-               struct argpar_item ** const item)
+static enum parse_orig_arg_opt_ret parse_orig_arg_opt(const char *const orig_arg,
+                                                     const char *const next_orig_arg,
+                                                     const struct argpar_opt_descr *const descrs,
+                                                     struct argpar_iter *const iter,
+                                                     struct argpar_error **const error,
+                                                     struct argpar_item **const item)
 {
        enum parse_orig_arg_opt_ret ret = PARSE_ORIG_ARG_OPT_RET_OK;
 
@@ -662,12 +639,10 @@ enum parse_orig_arg_opt_ret parse_orig_arg_opt(const char * const orig_arg,
 
        if (orig_arg[1] == '-') {
                /* Long option */
-               ret = parse_long_opt(&orig_arg[2],
-                       next_orig_arg, descrs, iter, error, item);
+               ret = parse_long_opt(&orig_arg[2], next_orig_arg, descrs, iter, error, item);
        } else {
                /* Short option */
-               ret = parse_short_opt_group(&orig_arg[1],
-                       next_orig_arg, descrs, iter, error, item);
+               ret = parse_short_opt_group(&orig_arg[1], next_orig_arg, descrs, iter, error, item);
        }
 
        return ret;
@@ -675,8 +650,8 @@ enum parse_orig_arg_opt_ret parse_orig_arg_opt(const char * const orig_arg,
 
 ARGPAR_HIDDEN
 struct argpar_iter *argpar_iter_create(const unsigned int argc,
-               const char * const * const argv,
-               const struct argpar_opt_descr * const descrs)
+                                      const char *const *const argv,
+                                      const struct argpar_opt_descr *const descrs)
 {
        struct argpar_iter *iter = ARGPAR_ZALLOC(struct argpar_iter);
 
@@ -700,7 +675,7 @@ end:
 }
 
 ARGPAR_HIDDEN
-void argpar_iter_destroy(struct argpar_iter * const iter)
+void argpar_iter_destroy(struct argpar_iter *const iter)
 {
        if (iter) {
                free(iter->tmp_buf.data);
@@ -709,16 +684,15 @@ void argpar_iter_destroy(struct argpar_iter * const iter)
 }
 
 ARGPAR_HIDDEN
-enum argpar_iter_next_status argpar_iter_next(
-               struct argpar_iter * const iter,
-               const struct argpar_item ** const item,
-               const struct argpar_error ** const error)
+enum argpar_iter_next_status argpar_iter_next(struct argpar_iter *const iter,
+                                             const struct argpar_item **const item,
+                                             const struct argpar_error **const error)
 {
        enum argpar_iter_next_status status;
        enum parse_orig_arg_opt_ret parse_orig_arg_opt_ret;
        const char *orig_arg;
        const char *next_orig_arg;
-       struct argpar_error ** const nc_error = (struct argpar_error **) error;
+       struct argpar_error **const nc_error = (struct argpar_error **) error;
 
        ARGPAR_ASSERT(iter->i <= iter->user.argc);
 
@@ -732,16 +706,12 @@ enum argpar_iter_next_status argpar_iter_next(
        }
 
        orig_arg = iter->user.argv[iter->i];
-       next_orig_arg =
-               iter->i < (iter->user.argc - 1) ?
-                       iter->user.argv[iter->i + 1] : NULL;
+       next_orig_arg = iter->i < (iter->user.argc - 1) ? iter->user.argv[iter->i + 1] : NULL;
 
-       if (strcmp(orig_arg, "-") == 0 || strcmp(orig_arg, "--") == 0 ||
-                       orig_arg[0] != '-') {
+       if (strcmp(orig_arg, "-") == 0 || strcmp(orig_arg, "--") == 0 || orig_arg[0] != '-') {
                /* Non-option argument */
-               const struct argpar_item_non_opt * const non_opt_item =
-                       create_non_opt_item(orig_arg, iter->i,
-                               iter->non_opt_index);
+               const struct argpar_item_non_opt *const non_opt_item =
+                       create_non_opt_item(orig_arg, iter->i, iter->non_opt_index);
 
                if (!non_opt_item) {
                        status = ARGPAR_ITER_NEXT_STATUS_ERROR_MEMORY;
@@ -757,8 +727,11 @@ enum argpar_iter_next_status argpar_iter_next(
 
        /* Option argument */
        parse_orig_arg_opt_ret = parse_orig_arg_opt(orig_arg,
-               next_orig_arg, iter->user.descrs, iter, nc_error,
-               (struct argpar_item **) item);
+                                                   next_orig_arg,
+                                                   iter->user.descrs,
+                                                   iter,
+                                                   nc_error,
+                                                   (struct argpar_item **) item);
        switch (parse_orig_arg_opt_ret) {
        case PARSE_ORIG_ARG_OPT_RET_OK:
                status = ARGPAR_ITER_NEXT_STATUS_OK;
@@ -782,8 +755,7 @@ end:
 }
 
 ARGPAR_HIDDEN
-unsigned int argpar_iter_ingested_orig_args(
-               const struct argpar_iter * const iter)
+unsigned int argpar_iter_ingested_orig_args(const struct argpar_iter *const iter)
 {
        return iter->i;
 }
index af9df9f5bee69caf8c8ff6bd99e52acd67889ea0..909da9cb3cce4ae3ff15633be0090271f058e985 100644 (file)
@@ -119,9 +119,9 @@ argpar_iter_next() produces the following items, in this order:
  * <https://gcc.gnu.org/wiki/Visibility>.
  */
 #if defined(_WIN32) || defined(__CYGWIN__)
-# define ARGPAR_HIDDEN
+#define ARGPAR_HIDDEN
 #else
-# define ARGPAR_HIDDEN __attribute__((visibility("hidden")))
+#define ARGPAR_HIDDEN __attribute__((visibility("hidden")))
 #endif
 
 struct argpar_opt_descr;
@@ -190,8 +190,7 @@ enum argpar_item_type argpar_item_type(const struct argpar_item *item);
 /// @cond hidden_macro
 ARGPAR_HIDDEN
 /// @endcond
-const struct argpar_opt_descr *argpar_item_opt_descr(
-               const struct argpar_item *item);
+const struct argpar_opt_descr *argpar_item_opt_descr(const struct argpar_item *item);
 
 /*!
 @brief
@@ -331,10 +330,10 @@ void argpar_item_destroy(const struct argpar_item *item);
     Item to destroy and variable to reset
     (<code>const struct argpar_item *</code> type).
 */
-#define ARGPAR_ITEM_DESTROY_AND_RESET(_item)                           \
-       {                                                               \
-               argpar_item_destroy(_item);                             \
-               ((_item)) = NULL;                                               \
+#define ARGPAR_ITEM_DESTROY_AND_RESET(_item) \
+       {                                    \
+               argpar_item_destroy(_item);  \
+               ((_item)) = NULL;            \
        }
 
 /// @}
@@ -468,8 +467,8 @@ const char *argpar_error_unknown_opt_name(const struct argpar_error *error);
 /// @cond hidden_macro
 ARGPAR_HIDDEN
 /// @endcond
-const struct argpar_opt_descr *argpar_error_opt_descr(
-               const struct argpar_error *error, bool *is_short);
+const struct argpar_opt_descr *argpar_error_opt_descr(const struct argpar_error *error,
+                                                     bool *is_short);
 
 /*!
 @brief
@@ -516,7 +515,7 @@ struct argpar_opt_descr {
        const char short_name;
 
        /// Long option name (without the <code>\--</code> prefix), or \c NULL
-       const char * const long_name;
+       const char *const long_name;
 
        /// \c true if this option has an argument
        const bool with_arg;
@@ -537,7 +536,10 @@ const struct argpar_opt_descr descrs[] = {
 };
 @endcode
 */
-#define ARGPAR_OPT_DESCR_SENTINEL      { -1, '\0', NULL, false }
+#define ARGPAR_OPT_DESCR_SENTINEL     \
+       {                             \
+               -1, '\0', NULL, false \
+       }
 
 /*!
 @struct argpar_iter
@@ -607,8 +609,8 @@ argpar_iter_next().
 ARGPAR_HIDDEN
 /// @endcond
 struct argpar_iter *argpar_iter_create(unsigned int argc,
-               const char * const *argv,
-               const struct argpar_opt_descr *descrs);
+                                      const char *const *argv,
+                                      const struct argpar_opt_descr *descrs);
 
 /*!
 @brief
@@ -681,9 +683,9 @@ If there are no more original arguments to parse, this function returns
 /// @cond hidden_macro
 ARGPAR_HIDDEN
 /// @endcond
-enum argpar_iter_next_status argpar_iter_next(
-               struct argpar_iter *iter, const struct argpar_item **item,
-               const struct argpar_error **error);
+enum argpar_iter_next_status argpar_iter_next(struct argpar_iter *iter,
+                                             const struct argpar_item **item,
+                                             const struct argpar_error **error);
 
 /*
  * Returns the number of ingested elements from `argv`, as passed to
index 7e638c05eca0837bed50c2d7e17b17f0f2d60f20..131275af2805e3279ed55c18edb270dc1a53a9ff 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_BUFFER_VIEW_H
 
 #include <common/macros.hpp>
+
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
@@ -31,8 +32,7 @@ struct lttng_buffer_view {
  * Note that a buffer view never assumes the ownership of the memory it
  * references.
  */
-struct lttng_buffer_view lttng_buffer_view_init(
-               const char *src, size_t offset, ptrdiff_t len);
+struct lttng_buffer_view lttng_buffer_view_init(const char *src, size_t offset, ptrdiff_t len);
 
 /**
  * Checks if a buffer view is safe to access.
@@ -58,9 +58,8 @@ bool lttng_buffer_view_is_valid(const struct lttng_buffer_view *view);
  * Note that a buffer view never assumes the ownership of the memory it
  * references.
  */
-struct lttng_buffer_view lttng_buffer_view_from_view(
-               const struct lttng_buffer_view *src, size_t offset,
-               ptrdiff_t len);
+struct lttng_buffer_view
+lttng_buffer_view_from_view(const struct lttng_buffer_view *src, size_t offset, ptrdiff_t len);
 
 /**
  * Return a buffer view referencing a subset of the memory referenced by a
@@ -76,8 +75,7 @@ struct lttng_buffer_view lttng_buffer_view_from_view(
  * references.
  */
 struct lttng_buffer_view lttng_buffer_view_from_dynamic_buffer(
-               const struct lttng_dynamic_buffer *src, size_t offset,
-               ptrdiff_t len);
+       const struct lttng_dynamic_buffer *src, size_t offset, ptrdiff_t len);
 
 /**
  * Verify that `buf` contains a string starting at `str` of length
@@ -89,7 +87,7 @@ struct lttng_buffer_view lttng_buffer_view_from_dynamic_buffer(
  *                             NULL terminator.
  */
 bool lttng_buffer_view_contains_string(const struct lttng_buffer_view *buf,
-               const char *str,
-               size_t len_with_null_terminator);
+                                      const char *str,
+                                      size_t len_with_null_terminator);
 
 #endif /* LTTNG_BUFFER_VIEW_H */
index f77c775a7ff23a190ad36808ff429645e77f9dc3..758fcf70c5be9d176ac6f5e97ad1963dde1b7d20 100644 (file)
@@ -8,22 +8,19 @@
 #ifndef _LTTNG_BUG_H
 #define _LTTNG_BUG_H
 
-#include <urcu/compiler.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <urcu/compiler.h>
 
-#define LTTNG_BUG_ON(condition)                                                \
-       do {                                                            \
-               if (caa_unlikely(condition)) {                          \
-                       fprintf(stderr,                                 \
-                               "LTTng BUG in file %s, line %d.\n",     \
-                               __FILE__, __LINE__);                    \
-                       exit(EXIT_FAILURE);                             \
-               }                                                       \
+#define LTTNG_BUG_ON(condition)                                                                  \
+       do {                                                                                     \
+               if (caa_unlikely(condition)) {                                                   \
+                       fprintf(stderr, "LTTng BUG in file %s, line %d.\n", __FILE__, __LINE__); \
+                       exit(EXIT_FAILURE);                                                      \
+               }                                                                                \
        } while (0)
 
-#define LTTNG_BUILD_BUG_ON(condition)                                  \
-       ((void) sizeof(char[-!!(condition)]))
+#define LTTNG_BUILD_BUG_ON(condition) ((void) sizeof(char[-!!(condition)]))
 
 /**
  * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime
  * if the condition is ever true. If the condition is constant and false, no
  * code is emitted.
  */
-#define LTTNG_BUILD_RUNTIME_BUG_ON(condition)                  \
-       do {                                                    \
-               if (__builtin_constant_p(condition))            \
-                       LTTNG_BUILD_BUG_ON(condition);          \
-               else                                            \
-                       LTTNG_BUG_ON(condition);                \
+#define LTTNG_BUILD_RUNTIME_BUG_ON(condition)          \
+       do {                                           \
+               if (__builtin_constant_p(condition))   \
+                       LTTNG_BUILD_BUG_ON(condition); \
+               else                                   \
+                       LTTNG_BUG_ON(condition);       \
        } while (0)
 
 #endif
index 426cc489dfd02e453dec7eeb7ce56fe53f741dad..306a7ff767d4b0b484408561ee2396f053b22148 100644 (file)
@@ -8,11 +8,11 @@
 #ifndef LTTNG_COMMON_BYTECODE_H
 #define LTTNG_COMMON_BYTECODE_H
 
-#include <stdint.h>
-
 #include "common/macros.hpp"
 #include "common/sessiond-comm/sessiond-comm.hpp"
 
+#include <stdint.h>
+
 /*
  * offsets are absolute from start of bytecode.
  */
@@ -44,149 +44,149 @@ struct literal_double {
 } LTTNG_PACKED;
 
 enum bytecode_op {
-       BYTECODE_OP_UNKNOWN                             = 0,
+       BYTECODE_OP_UNKNOWN = 0,
 
-       BYTECODE_OP_RETURN                              = 1,
+       BYTECODE_OP_RETURN = 1,
 
        /* binary */
-       BYTECODE_OP_MUL                                 = 2,
-       BYTECODE_OP_DIV                                 = 3,
-       BYTECODE_OP_MOD                                 = 4,
-       BYTECODE_OP_PLUS                                = 5,
-       BYTECODE_OP_MINUS                               = 6,
-       BYTECODE_OP_BIT_RSHIFT                          = 7,
-       BYTECODE_OP_BIT_LSHIFT                          = 8,
-       BYTECODE_OP_BIT_AND                             = 9,
-       BYTECODE_OP_BIT_OR                              = 10,
-       BYTECODE_OP_BIT_XOR                             = 11,
+       BYTECODE_OP_MUL = 2,
+       BYTECODE_OP_DIV = 3,
+       BYTECODE_OP_MOD = 4,
+       BYTECODE_OP_PLUS = 5,
+       BYTECODE_OP_MINUS = 6,
+       BYTECODE_OP_BIT_RSHIFT = 7,
+       BYTECODE_OP_BIT_LSHIFT = 8,
+       BYTECODE_OP_BIT_AND = 9,
+       BYTECODE_OP_BIT_OR = 10,
+       BYTECODE_OP_BIT_XOR = 11,
 
        /* binary comparators */
-       BYTECODE_OP_EQ                                  = 12,
-       BYTECODE_OP_NE                                  = 13,
-       BYTECODE_OP_GT                                  = 14,
-       BYTECODE_OP_LT                                  = 15,
-       BYTECODE_OP_GE                                  = 16,
-       BYTECODE_OP_LE                                  = 17,
+       BYTECODE_OP_EQ = 12,
+       BYTECODE_OP_NE = 13,
+       BYTECODE_OP_GT = 14,
+       BYTECODE_OP_LT = 15,
+       BYTECODE_OP_GE = 16,
+       BYTECODE_OP_LE = 17,
 
        /* string binary comparator: apply to  */
-       BYTECODE_OP_EQ_STRING                           = 18,
-       BYTECODE_OP_NE_STRING                           = 19,
-       BYTECODE_OP_GT_STRING                           = 20,
-       BYTECODE_OP_LT_STRING                           = 21,
-       BYTECODE_OP_GE_STRING                           = 22,
-       BYTECODE_OP_LE_STRING                           = 23,
+       BYTECODE_OP_EQ_STRING = 18,
+       BYTECODE_OP_NE_STRING = 19,
+       BYTECODE_OP_GT_STRING = 20,
+       BYTECODE_OP_LT_STRING = 21,
+       BYTECODE_OP_GE_STRING = 22,
+       BYTECODE_OP_LE_STRING = 23,
 
        /* s64 binary comparator */
-       BYTECODE_OP_EQ_S64                              = 24,
-       BYTECODE_OP_NE_S64                              = 25,
-       BYTECODE_OP_GT_S64                              = 26,
-       BYTECODE_OP_LT_S64                              = 27,
-       BYTECODE_OP_GE_S64                              = 28,
-       BYTECODE_OP_LE_S64                              = 29,
+       BYTECODE_OP_EQ_S64 = 24,
+       BYTECODE_OP_NE_S64 = 25,
+       BYTECODE_OP_GT_S64 = 26,
+       BYTECODE_OP_LT_S64 = 27,
+       BYTECODE_OP_GE_S64 = 28,
+       BYTECODE_OP_LE_S64 = 29,
 
        /* double binary comparator */
-       BYTECODE_OP_EQ_DOUBLE                           = 30,
-       BYTECODE_OP_NE_DOUBLE                           = 31,
-       BYTECODE_OP_GT_DOUBLE                           = 32,
-       BYTECODE_OP_LT_DOUBLE                           = 33,
-       BYTECODE_OP_GE_DOUBLE                           = 34,
-       BYTECODE_OP_LE_DOUBLE                           = 35,
+       BYTECODE_OP_EQ_DOUBLE = 30,
+       BYTECODE_OP_NE_DOUBLE = 31,
+       BYTECODE_OP_GT_DOUBLE = 32,
+       BYTECODE_OP_LT_DOUBLE = 33,
+       BYTECODE_OP_GE_DOUBLE = 34,
+       BYTECODE_OP_LE_DOUBLE = 35,
 
        /* Mixed S64-double binary comparators */
-       BYTECODE_OP_EQ_DOUBLE_S64                       = 36,
-       BYTECODE_OP_NE_DOUBLE_S64                       = 37,
-       BYTECODE_OP_GT_DOUBLE_S64                       = 38,
-       BYTECODE_OP_LT_DOUBLE_S64                       = 39,
-       BYTECODE_OP_GE_DOUBLE_S64                       = 40,
-       BYTECODE_OP_LE_DOUBLE_S64                       = 41,
-
-       BYTECODE_OP_EQ_S64_DOUBLE                       = 42,
-       BYTECODE_OP_NE_S64_DOUBLE                       = 43,
-       BYTECODE_OP_GT_S64_DOUBLE                       = 44,
-       BYTECODE_OP_LT_S64_DOUBLE                       = 45,
-       BYTECODE_OP_GE_S64_DOUBLE                       = 46,
-       BYTECODE_OP_LE_S64_DOUBLE                       = 47,
+       BYTECODE_OP_EQ_DOUBLE_S64 = 36,
+       BYTECODE_OP_NE_DOUBLE_S64 = 37,
+       BYTECODE_OP_GT_DOUBLE_S64 = 38,
+       BYTECODE_OP_LT_DOUBLE_S64 = 39,
+       BYTECODE_OP_GE_DOUBLE_S64 = 40,
+       BYTECODE_OP_LE_DOUBLE_S64 = 41,
+
+       BYTECODE_OP_EQ_S64_DOUBLE = 42,
+       BYTECODE_OP_NE_S64_DOUBLE = 43,
+       BYTECODE_OP_GT_S64_DOUBLE = 44,
+       BYTECODE_OP_LT_S64_DOUBLE = 45,
+       BYTECODE_OP_GE_S64_DOUBLE = 46,
+       BYTECODE_OP_LE_S64_DOUBLE = 47,
 
        /* unary */
-       BYTECODE_OP_UNARY_PLUS                          = 48,
-       BYTECODE_OP_UNARY_MINUS                         = 49,
-       BYTECODE_OP_UNARY_NOT                           = 50,
-       BYTECODE_OP_UNARY_PLUS_S64                      = 51,
-       BYTECODE_OP_UNARY_MINUS_S64                     = 52,
-       BYTECODE_OP_UNARY_NOT_S64                       = 53,
-       BYTECODE_OP_UNARY_PLUS_DOUBLE                   = 54,
-       BYTECODE_OP_UNARY_MINUS_DOUBLE                  = 55,
-       BYTECODE_OP_UNARY_NOT_DOUBLE                    = 56,
+       BYTECODE_OP_UNARY_PLUS = 48,
+       BYTECODE_OP_UNARY_MINUS = 49,
+       BYTECODE_OP_UNARY_NOT = 50,
+       BYTECODE_OP_UNARY_PLUS_S64 = 51,
+       BYTECODE_OP_UNARY_MINUS_S64 = 52,
+       BYTECODE_OP_UNARY_NOT_S64 = 53,
+       BYTECODE_OP_UNARY_PLUS_DOUBLE = 54,
+       BYTECODE_OP_UNARY_MINUS_DOUBLE = 55,
+       BYTECODE_OP_UNARY_NOT_DOUBLE = 56,
 
        /* logical */
-       BYTECODE_OP_AND                                 = 57,
-       BYTECODE_OP_OR                                  = 58,
+       BYTECODE_OP_AND = 57,
+       BYTECODE_OP_OR = 58,
 
        /* load field ref */
-       BYTECODE_OP_LOAD_FIELD_REF                      = 59,
-       BYTECODE_OP_LOAD_FIELD_REF_STRING               = 60,
-       BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE             = 61,
-       BYTECODE_OP_LOAD_FIELD_REF_S64                  = 62,
-       BYTECODE_OP_LOAD_FIELD_REF_DOUBLE               = 63,
+       BYTECODE_OP_LOAD_FIELD_REF = 59,
+       BYTECODE_OP_LOAD_FIELD_REF_STRING = 60,
+       BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE = 61,
+       BYTECODE_OP_LOAD_FIELD_REF_S64 = 62,
+       BYTECODE_OP_LOAD_FIELD_REF_DOUBLE = 63,
 
        /* load immediate from operand */
-       BYTECODE_OP_LOAD_STRING                         = 64,
-       BYTECODE_OP_LOAD_S64                            = 65,
-       BYTECODE_OP_LOAD_DOUBLE                         = 66,
+       BYTECODE_OP_LOAD_STRING = 64,
+       BYTECODE_OP_LOAD_S64 = 65,
+       BYTECODE_OP_LOAD_DOUBLE = 66,
 
        /* cast */
-       BYTECODE_OP_CAST_TO_S64                         = 67,
-       BYTECODE_OP_CAST_DOUBLE_TO_S64                  = 68,
-       BYTECODE_OP_CAST_NOP                            = 69,
+       BYTECODE_OP_CAST_TO_S64 = 67,
+       BYTECODE_OP_CAST_DOUBLE_TO_S64 = 68,
+       BYTECODE_OP_CAST_NOP = 69,
 
        /* get context ref */
-       BYTECODE_OP_GET_CONTEXT_REF                     = 70,
-       BYTECODE_OP_GET_CONTEXT_REF_STRING              = 71,
-       BYTECODE_OP_GET_CONTEXT_REF_S64                 = 72,
-       BYTECODE_OP_GET_CONTEXT_REF_DOUBLE              = 73,
+       BYTECODE_OP_GET_CONTEXT_REF = 70,
+       BYTECODE_OP_GET_CONTEXT_REF_STRING = 71,
+       BYTECODE_OP_GET_CONTEXT_REF_S64 = 72,
+       BYTECODE_OP_GET_CONTEXT_REF_DOUBLE = 73,
 
        /* load userspace field ref */
-       BYTECODE_OP_LOAD_FIELD_REF_USER_STRING          = 74,
-       BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE        = 75,
+       BYTECODE_OP_LOAD_FIELD_REF_USER_STRING = 74,
+       BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE = 75,
 
        /*
         * load immediate star globbing pattern (literal string)
         * from immediate
         */
-       BYTECODE_OP_LOAD_STAR_GLOB_STRING               = 76,
+       BYTECODE_OP_LOAD_STAR_GLOB_STRING = 76,
 
        /* globbing pattern binary operator: apply to */
-       BYTECODE_OP_EQ_STAR_GLOB_STRING                 = 77,
-       BYTECODE_OP_NE_STAR_GLOB_STRING                 = 78,
+       BYTECODE_OP_EQ_STAR_GLOB_STRING = 77,
+       BYTECODE_OP_NE_STAR_GLOB_STRING = 78,
 
        /*
         * Instructions for recursive traversal through composed types.
         */
-       BYTECODE_OP_GET_CONTEXT_ROOT                    = 79,
-       BYTECODE_OP_GET_APP_CONTEXT_ROOT                = 80,
-       BYTECODE_OP_GET_PAYLOAD_ROOT                    = 81,
-
-       BYTECODE_OP_GET_SYMBOL                          = 82,
-       BYTECODE_OP_GET_SYMBOL_FIELD                    = 83,
-       BYTECODE_OP_GET_INDEX_U16                       = 84,
-       BYTECODE_OP_GET_INDEX_U64                       = 85,
-
-       BYTECODE_OP_LOAD_FIELD                          = 86,
-       BYTECODE_OP_LOAD_FIELD_S8                       = 87,
-       BYTECODE_OP_LOAD_FIELD_S16                      = 88,
-       BYTECODE_OP_LOAD_FIELD_S32                      = 89,
-       BYTECODE_OP_LOAD_FIELD_S64                      = 90,
-       BYTECODE_OP_LOAD_FIELD_U8                       = 91,
-       BYTECODE_OP_LOAD_FIELD_U16                      = 92,
-       BYTECODE_OP_LOAD_FIELD_U32                      = 93,
-       BYTECODE_OP_LOAD_FIELD_U64                      = 94,
-       BYTECODE_OP_LOAD_FIELD_STRING                   = 95,
-       BYTECODE_OP_LOAD_FIELD_SEQUENCE                 = 96,
-       BYTECODE_OP_LOAD_FIELD_DOUBLE                   = 97,
-
-       BYTECODE_OP_UNARY_BIT_NOT                       = 98,
-
-       BYTECODE_OP_RETURN_S64                          = 99,
+       BYTECODE_OP_GET_CONTEXT_ROOT = 79,
+       BYTECODE_OP_GET_APP_CONTEXT_ROOT = 80,
+       BYTECODE_OP_GET_PAYLOAD_ROOT = 81,
+
+       BYTECODE_OP_GET_SYMBOL = 82,
+       BYTECODE_OP_GET_SYMBOL_FIELD = 83,
+       BYTECODE_OP_GET_INDEX_U16 = 84,
+       BYTECODE_OP_GET_INDEX_U64 = 85,
+
+       BYTECODE_OP_LOAD_FIELD = 86,
+       BYTECODE_OP_LOAD_FIELD_S8 = 87,
+       BYTECODE_OP_LOAD_FIELD_S16 = 88,
+       BYTECODE_OP_LOAD_FIELD_S32 = 89,
+       BYTECODE_OP_LOAD_FIELD_S64 = 90,
+       BYTECODE_OP_LOAD_FIELD_U8 = 91,
+       BYTECODE_OP_LOAD_FIELD_U16 = 92,
+       BYTECODE_OP_LOAD_FIELD_U32 = 93,
+       BYTECODE_OP_LOAD_FIELD_U64 = 94,
+       BYTECODE_OP_LOAD_FIELD_STRING = 95,
+       BYTECODE_OP_LOAD_FIELD_SEQUENCE = 96,
+       BYTECODE_OP_LOAD_FIELD_DOUBLE = 97,
+
+       BYTECODE_OP_UNARY_BIT_NOT = 98,
+
+       BYTECODE_OP_RETURN_S64 = 99,
 
        NR_BYTECODE_OPS,
 };
@@ -214,7 +214,7 @@ struct unary_op {
 /* skip_offset is absolute from start of bytecode */
 struct logical_op {
        bytecode_opcode_t op;
-       uint16_t skip_offset;   /* bytecode insn, if skip second test */
+       uint16_t skip_offset; /* bytecode insn, if skip second test */
 } LTTNG_PACKED;
 
 struct cast_op {
@@ -231,29 +231,23 @@ struct lttng_bytecode_alloc {
 };
 
 int bytecode_init(struct lttng_bytecode_alloc **fb);
-int bytecode_push(struct lttng_bytecode_alloc **fb,
-               const void *data, uint32_t align, uint32_t len);
+int bytecode_push(struct lttng_bytecode_alloc **fb, const void *data, uint32_t align, uint32_t len);
 int bytecode_push_logical(struct lttng_bytecode_alloc **fb,
-               struct logical_op *data, uint32_t align, uint32_t len,
-               uint16_t *skip_offset);
-struct lttng_bytecode *lttng_bytecode_copy(
-               const struct lttng_bytecode *orig_f);
-
-int bytecode_push_get_payload_root(
-               struct lttng_bytecode_alloc **bytecode);
-int bytecode_push_get_context_root(
-               struct lttng_bytecode_alloc **bytecode);
-int bytecode_push_get_app_context_root(
-               struct lttng_bytecode_alloc **bytecode);
-int bytecode_push_get_index_u64(
-               struct lttng_bytecode_alloc **bytecode, uint64_t index);
-int bytecode_push_get_symbol(
-               struct lttng_bytecode_alloc **bytecode,
-               struct lttng_bytecode_alloc **bytecode_reloc,
-               const char *symbol);
-
-static inline
-unsigned int bytecode_get_len(struct lttng_bytecode *bytecode)
+                         struct logical_op *data,
+                         uint32_t align,
+                         uint32_t len,
+                         uint16_t *skip_offset);
+struct lttng_bytecode *lttng_bytecode_copy(const struct lttng_bytecode *orig_f);
+
+int bytecode_push_get_payload_root(struct lttng_bytecode_alloc **bytecode);
+int bytecode_push_get_context_root(struct lttng_bytecode_alloc **bytecode);
+int bytecode_push_get_app_context_root(struct lttng_bytecode_alloc **bytecode);
+int bytecode_push_get_index_u64(struct lttng_bytecode_alloc **bytecode, uint64_t index);
+int bytecode_push_get_symbol(struct lttng_bytecode_alloc **bytecode,
+                            struct lttng_bytecode_alloc **bytecode_reloc,
+                            const char *symbol);
+
+static inline unsigned int bytecode_get_len(struct lttng_bytecode *bytecode)
 {
        return bytecode->len;
 }
index 926ebf36dc75a6a1a5f5c9ff4a98251c64617b68..b784e5c0cd798b2f7bf8cafd0fd5bacf23dafdf3 100644 (file)
@@ -11,8 +11,8 @@
 
 #include "error.hpp"
 #include "macros.hpp"
-#include "runas.hpp"
 #include "readwrite.hpp"
+#include "runas.hpp"
 #include "time.hpp"
 
 #endif /* _COMMON_H */
index ced720e5a307edd66d91c34606119e3f376b9fc7..108ec4c862d0479280837d62b875361dc0afff45 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common/credentials.hpp>
 #include <common/macros.hpp>
+
 #include <sys/stat.h>
 #include <urcu/ref.h>
 
@@ -39,9 +40,7 @@ struct lttng_directory_handle {
        void *destroy_cb_data;
 };
 
-static inline
-int lttng_directory_handle_get_dirfd(
-               const struct lttng_directory_handle *handle)
+static inline int lttng_directory_handle_get_dirfd(const struct lttng_directory_handle *handle)
 {
        return handle->dirfd;
 }
@@ -60,8 +59,7 @@ struct lttng_directory_handle {
  * The reference to the directory handle must be released using
  * lttng_directory_handle_put().
  */
-struct lttng_directory_handle *lttng_directory_handle_create(
-               const char *path);
+struct lttng_directory_handle *lttng_directory_handle_create(const char *path);
 
 /*
  * Create a new directory handle to a path relative to an existing handle.
@@ -76,9 +74,9 @@ struct lttng_directory_handle *lttng_directory_handle_create(
  * The reference to the directory handle must be released using
  * lttng_directory_handle_put().
  */
-struct lttng_directory_handle *lttng_directory_handle_create_from_handle(
-               const char *path,
-               const struct lttng_directory_handle *ref_handle);
+struct lttng_directory_handle *
+lttng_directory_handle_create_from_handle(const char *path,
+                                         const struct lttng_directory_handle *ref_handle);
 
 /*
  * Create a new directory handle from an existing directory fd.
@@ -90,8 +88,7 @@ struct lttng_directory_handle *lttng_directory_handle_create_from_handle(
  * The reference to the directory handle must be released using
  * lttng_directory_handle_put().
  */
-struct lttng_directory_handle *lttng_directory_handle_create_from_dirfd(
-               int dirfd);
+struct lttng_directory_handle *lttng_directory_handle_create_from_dirfd(int dirfd);
 
 /*
  * Copy a directory handle.
@@ -99,8 +96,8 @@ struct lttng_directory_handle *lttng_directory_handle_create_from_dirfd(
  * The reference to the directory handle must be released using
  * lttng_directory_handle_put().
  */
-struct lttng_directory_handle *lttng_directory_handle_copy(
-               const struct lttng_directory_handle *handle);
+struct lttng_directory_handle *
+lttng_directory_handle_copy(const struct lttng_directory_handle *handle);
 
 /*
  * Acquire a reference to a directory handle.
@@ -115,105 +112,97 @@ void lttng_directory_handle_put(struct lttng_directory_handle *handle);
 /*
  * Create a subdirectory relative to a directory handle.
  */
-int lttng_directory_handle_create_subdirectory(
-               const struct lttng_directory_handle *handle,
-               const char *subdirectory,
-               mode_t mode);
+int lttng_directory_handle_create_subdirectory(const struct lttng_directory_handle *handle,
+                                              const char *subdirectory,
+                                              mode_t mode);
 
 /*
  * Create a subdirectory relative to a directory handle
  * as a given user.
  */
-int lttng_directory_handle_create_subdirectory_as_user(
-               const struct lttng_directory_handle *handle,
-               const char *subdirectory,
-               mode_t mode, const struct lttng_credentials *creds);
+int lttng_directory_handle_create_subdirectory_as_user(const struct lttng_directory_handle *handle,
+                                                      const char *subdirectory,
+                                                      mode_t mode,
+                                                      const struct lttng_credentials *creds);
 
 /*
  * Recursively create a directory relative to a directory handle.
  */
 int lttng_directory_handle_create_subdirectory_recursive(
-               const struct lttng_directory_handle *handle,
-               const char *subdirectory_path,
-               mode_t mode);
+       const struct lttng_directory_handle *handle, const char *subdirectory_path, mode_t mode);
 
 /*
  * Recursively create a directory relative to a directory handle
  * as a given user.
  */
 int lttng_directory_handle_create_subdirectory_recursive_as_user(
-               const struct lttng_directory_handle *handle,
-               const char *subdirectory_path,
-               mode_t mode, const struct lttng_credentials *creds);
+       const struct lttng_directory_handle *handle,
+       const char *subdirectory_path,
+       mode_t mode,
+       const struct lttng_credentials *creds);
 
 /*
  * Open a file descriptor to a path relative to a directory handle.
  */
-int lttng_directory_handle_open_file(
-               const struct lttng_directory_handle *handle,
-               const char *filename,
-               int flags, mode_t mode);
+int lttng_directory_handle_open_file(const struct lttng_directory_handle *handle,
+                                    const char *filename,
+                                    int flags,
+                                    mode_t mode);
 
 /*
  * Open a file descriptor to a path relative to a directory handle
  * as a given user.
  */
-int lttng_directory_handle_open_file_as_user(
-               const struct lttng_directory_handle *handle,
-               const char *filename,
-               int flags, mode_t mode,
-               const struct lttng_credentials *creds);
+int lttng_directory_handle_open_file_as_user(const struct lttng_directory_handle *handle,
+                                            const char *filename,
+                                            int flags,
+                                            mode_t mode,
+                                            const struct lttng_credentials *creds);
 
 /*
  * Unlink a file to a path relative to a directory handle.
  */
-int lttng_directory_handle_unlink_file(
-               const struct lttng_directory_handle *handle,
-               const char *filename);
+int lttng_directory_handle_unlink_file(const struct lttng_directory_handle *handle,
+                                      const char *filename);
 
 /*
  * Unlink a file to a path relative to a directory handle as a given user.
  */
-int lttng_directory_handle_unlink_file_as_user(
-               const struct lttng_directory_handle *handle,
-               const char *filename,
-               const struct lttng_credentials *creds);
+int lttng_directory_handle_unlink_file_as_user(const struct lttng_directory_handle *handle,
+                                              const char *filename,
+                                              const struct lttng_credentials *creds);
 
 /*
  * Rename a file from a path relative to a directory handle to a new
  * name relative to another directory handle.
  */
-int lttng_directory_handle_rename(
-               const struct lttng_directory_handle *old_handle,
-               const char *old_name,
-               const struct lttng_directory_handle *new_handle,
-               const char *new_name);
+int lttng_directory_handle_rename(const struct lttng_directory_handle *old_handle,
+                                 const char *old_name,
+                                 const struct lttng_directory_handle *new_handle,
+                                 const char *new_name);
 
 /*
  * Rename a file from a path relative to a directory handle to a new
  * name relative to another directory handle as a given user.
  */
-int lttng_directory_handle_rename_as_user(
-               const struct lttng_directory_handle *old_handle,
-               const char *old_name,
-               const struct lttng_directory_handle *new_handle,
-               const char *new_name,
-               const struct lttng_credentials *creds);
+int lttng_directory_handle_rename_as_user(const struct lttng_directory_handle *old_handle,
+                                         const char *old_name,
+                                         const struct lttng_directory_handle *new_handle,
+                                         const char *new_name,
+                                         const struct lttng_credentials *creds);
 
 /*
  * Remove a subdirectory relative to a directory handle.
  */
-int lttng_directory_handle_remove_subdirectory(
-               const struct lttng_directory_handle *handle,
-               const char *name);
+int lttng_directory_handle_remove_subdirectory(const struct lttng_directory_handle *handle,
+                                              const char *name);
 
 /*
  * Remove a subdirectory relative to a directory handle as a given user.
  */
-int lttng_directory_handle_remove_subdirectory_as_user(
-               const struct lttng_directory_handle *handle,
-               const char *name,
-               const struct lttng_credentials *creds);
+int lttng_directory_handle_remove_subdirectory_as_user(const struct lttng_directory_handle *handle,
+                                                      const char *name,
+                                                      const struct lttng_credentials *creds);
 
 /*
  * Remove a subdirectory and remove its contents if it only
@@ -221,8 +210,7 @@ int lttng_directory_handle_remove_subdirectory_as_user(
  * @flags: enum lttng_directory_handle_rmdir_recursive_flags
  */
 int lttng_directory_handle_remove_subdirectory_recursive(
-               const struct lttng_directory_handle *handle,
-               const char *name, int flags);
+       const struct lttng_directory_handle *handle, const char *name, int flags);
 
 /*
  * Remove a subdirectory and remove its contents if it only
@@ -230,25 +218,23 @@ int lttng_directory_handle_remove_subdirectory_recursive(
  * @flags: enum lttng_directory_handle_rmdir_recursive_flags
  */
 int lttng_directory_handle_remove_subdirectory_recursive_as_user(
-               const struct lttng_directory_handle *handle,
-               const char *name,
-               const struct lttng_credentials *creds,
-               int flags);
+       const struct lttng_directory_handle *handle,
+       const char *name,
+       const struct lttng_credentials *creds,
+       int flags);
 
 /*
  * stat() a file relative to a directory handle.
  */
-int lttng_directory_handle_stat(
-               const struct lttng_directory_handle *handle,
-               const char *name,
-               struct stat *stat_buf);
+int lttng_directory_handle_stat(const struct lttng_directory_handle *handle,
+                               const char *name,
+                               struct stat *stat_buf);
 
 /*
  * Returns true if this directory handle is backed by a file
  * descriptor, false otherwise.
  */
-bool lttng_directory_handle_uses_fd(
-               const struct lttng_directory_handle *handle);
+bool lttng_directory_handle_uses_fd(const struct lttng_directory_handle *handle);
 
 /*
  * Compare two directory handles.
@@ -256,7 +242,6 @@ bool lttng_directory_handle_uses_fd(
  * Returns true if the two directory handles are equal, false otherwise.
  */
 bool lttng_directory_handle_equals(const struct lttng_directory_handle *lhs,
-               const struct lttng_directory_handle *rhs);
-
+                                  const struct lttng_directory_handle *rhs);
 
 #endif /* _COMPAT_PATH_HANDLE_H */
index b760ed2db7d3f245e051e8c8de7585dcfd87c054..d2dc5ed60819f07d21f58213c43b8f6c0d0a6c8e 100644 (file)
 #include <dirent.h>
 
 #ifdef HAVE_DIRFD
-static inline
-int lttng_dirfd(DIR *dir) {
+static inline int lttng_dirfd(DIR *dir)
+{
        return dirfd(dir);
 }
 #else
-# ifndef __XOPEN_OR_POSIX
-static inline
-int lttng_dirfd(DIR *dir) {
+#ifndef __XOPEN_OR_POSIX
+static inline int lttng_dirfd(DIR *dir)
+{
        return dir->dd_fd;
 }
-# else
-static inline
-int lttng_dirfd(DIR *dir) {
+#else
+static inline int lttng_dirfd(DIR *dir)
+{
        return dir->d_fd;
 }
-# endif
+#endif
 #endif
 
 #endif /* _COMPAT_DIRENT_H */
index ff383763461f19e32d76439275755f27524ea5a3..642e23b0c433cd7bd0765c961e7a97fdd2b6cb98 100644 (file)
@@ -38,8 +38,8 @@
 #define _COMPAT_ENDIAN_H
 
 #if defined(__linux__) || defined(__CYGWIN__)
-#include <endian.h>
 #include <byteswap.h>
+#include <endian.h>
 
 /*
  * htobe/betoh are not defined for glibc <2.9, so add them
  */
 #ifdef __USE_BSD
 /* Conversion interfaces. */
-# include <byteswap.h>
-
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-#  ifndef htobe16
-#   define htobe16(x) __bswap_16(x)
-#  endif
-#  ifndef htole16
-#   define htole16(x) (x)
-#  endif
-#  ifndef be16toh
-#   define be16toh(x) __bswap_16(x)
-#  endif
-#  ifndef le16toh
-#   define le16toh(x) (x)
-#  endif
-
-#  ifndef htobe32
-#   define htobe32(x) __bswap_32(x)
-#  endif
-#  ifndef htole32
-#   define htole32(x) (x)
-#  endif
-#  ifndef be32toh
-#   define be32toh(x) __bswap_32(x)
-#  endif
-#  ifndef le32toh
-#   define le32toh(x) (x)
-#  endif
-
-#  ifndef htobe64
-#   define htobe64(x) __bswap_64(x)
-#  endif
-#  ifndef htole64
-#   define htole64(x) (x)
-#  endif
-#  ifndef be64toh
-#   define be64toh(x) __bswap_64(x)
-#  endif
-#  ifndef le64toh
-#   define le64toh(x) (x)
-#  endif
-
-# else /* __BYTE_ORDER == __LITTLE_ENDIAN */
-#  ifndef htobe16
-#   define htobe16(x) (x)
-#  endif
-#  ifndef htole16
-#   define htole16(x) __bswap_16(x)
-#  endif
-#  ifndef be16toh
-#   define be16toh(x) (x)
-#  endif
-#  ifndef le16toh
-#   define le16toh(x) __bswap_16(x)
-#  endif
-
-#  ifndef htobe32
-#   define htobe32(x) (x)
-#  endif
-#  ifndef htole32
-#   define htole32(x) __bswap_32(x)
-#  endif
-#  ifndef be32toh
-#   define be32toh(x) (x)
-#  endif
-#  ifndef le32toh
-#   define le32toh(x) __bswap_32(x)
-#  endif
-
-#  ifndef htobe64
-#   define htobe64(x) (x)
-#  endif
-#  ifndef htole64
-#   define htole64(x) __bswap_64(x)
-#  endif
-#  ifndef be64toh
-#   define be64toh(x) (x)
-#  endif
-#  ifndef le64toh
-#   define le64toh(x) __bswap_64(x)
-#  endif
-
-# endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
+#include <byteswap.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef htobe16
+#define htobe16(x) __bswap_16(x)
+#endif
+#ifndef htole16
+#define htole16(x) (x)
+#endif
+#ifndef be16toh
+#define be16toh(x) __bswap_16(x)
+#endif
+#ifndef le16toh
+#define le16toh(x) (x)
+#endif
+
+#ifndef htobe32
+#define htobe32(x) __bswap_32(x)
+#endif
+#ifndef htole32
+#define htole32(x) (x)
+#endif
+#ifndef be32toh
+#define be32toh(x) __bswap_32(x)
+#endif
+#ifndef le32toh
+#define le32toh(x) (x)
+#endif
+
+#ifndef htobe64
+#define htobe64(x) __bswap_64(x)
+#endif
+#ifndef htole64
+#define htole64(x) (x)
+#endif
+#ifndef be64toh
+#define be64toh(x) __bswap_64(x)
+#endif
+#ifndef le64toh
+#define le64toh(x) (x)
+#endif
+
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+#ifndef htobe16
+#define htobe16(x) (x)
+#endif
+#ifndef htole16
+#define htole16(x) __bswap_16(x)
+#endif
+#ifndef be16toh
+#define be16toh(x) (x)
+#endif
+#ifndef le16toh
+#define le16toh(x) __bswap_16(x)
+#endif
+
+#ifndef htobe32
+#define htobe32(x) (x)
+#endif
+#ifndef htole32
+#define htole32(x) __bswap_32(x)
+#endif
+#ifndef be32toh
+#define be32toh(x) (x)
+#endif
+#ifndef le32toh
+#define le32toh(x) __bswap_32(x)
+#endif
+
+#ifndef htobe64
+#define htobe64(x) (x)
+#endif
+#ifndef htole64
+#define htole64(x) __bswap_64(x)
+#endif
+#ifndef be64toh
+#define be64toh(x) (x)
+#endif
+#ifndef le64toh
+#define le64toh(x) __bswap_64(x)
+#endif
+
+#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
 #endif /* __USE_BSD */
 
 #elif defined(__FreeBSD__)
 #include <sys/endian.h>
 
-#define bswap_16(x)    bswap16(x)
-#define bswap_32(x)    bswap32(x)
-#define bswap_64(x)    bswap64(x)
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
 
 #elif defined(__sun__)
 #include <sys/byteorder.h>
 #define __BYTE_ORDER __BIG_ENDIAN
 #endif /* _BIG_ENDIAN */
 
-#define LITTLE_ENDIAN  __LITTLE_ENDIAN
-#define BIG_ENDIAN     __BIG_ENDIAN
-#define BYTE_ORDER     __BYTE_ORDER
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#define BIG_ENDIAN    __BIG_ENDIAN
+#define BYTE_ORDER    __BYTE_ORDER
 
 #define betoh16(x) BE_16(x)
 #define letoh16(x) LE_16(x)
 #define be64toh(x) BE_64(x)
 
 #elif defined(__APPLE__)
-# include <machine/endian.h>
-# include <libkern/OSByteOrder.h>
-
-# if BYTE_ORDER == LITTLE_ENDIAN
-#  define htobe16(x) OSSwapConstInt16(x)
-#  define htole16(x) (x)
-#  define be16toh(x) OSSwapConstInt16(x)
-#  define le16toh(x) (x)
-
-#  define htobe32(x) OSSwapConstInt32(x)
-#  define htole32(x) (x)
-#  define be32toh(x) OSSwapConstInt32(x)
-#  define le32toh(x) (x)
-
-#  define htobe64(x) OSSwapConstInt64(x)
-#  define htole64(x) (x)
-#  define be64toh(x) OSSwapConstInt64(x)
-#  define le64toh(x) (x)
-
-# else /* BYTE_ORDER == LITTLE_ENDIAN */
-#  define htobe16(x) (x)
-#  define htole16(x) OSSwapConstInt16(x)
-#  define be16toh(x) (x)
-#  define le16toh(x) OSSwapConstInt16(x)
-
-#  define htobe32(x) (x)
-#  define htole32(x) OSSwapConstInt32(x)
-#  define be32toh(x) (x)
-#  define le32toh(x) OSSwapConstInt32(x)
-
-#  define htobe64(x) (x)
-#  define htole64(x) OSSwapConstInt64(x)
-#  define be64toh(x) (x)
-#  define le64toh(x) OSSwapConstInt64(x)
-# endif
+#include <libkern/OSByteOrder.h>
+#include <machine/endian.h>
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define htobe16(x) OSSwapConstInt16(x)
+#define htole16(x) (x)
+#define be16toh(x) OSSwapConstInt16(x)
+#define le16toh(x) (x)
+
+#define htobe32(x) OSSwapConstInt32(x)
+#define htole32(x) (x)
+#define be32toh(x) OSSwapConstInt32(x)
+#define le32toh(x) (x)
+
+#define htobe64(x) OSSwapConstInt64(x)
+#define htole64(x) (x)
+#define be64toh(x) OSSwapConstInt64(x)
+#define le64toh(x) (x)
+
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#define htobe16(x) (x)
+#define htole16(x) OSSwapConstInt16(x)
+#define be16toh(x) (x)
+#define le16toh(x) OSSwapConstInt16(x)
+
+#define htobe32(x) (x)
+#define htole32(x) OSSwapConstInt32(x)
+#define be32toh(x) (x)
+#define le32toh(x) OSSwapConstInt32(x)
+
+#define htobe64(x) (x)
+#define htole64(x) OSSwapConstInt64(x)
+#define be64toh(x) (x)
+#define le64toh(x) OSSwapConstInt64(x)
+#endif
 
 #else
 #error "Please add support for your OS."
index 08fe02cf4c44bb97eaa5e3801d847e0284e5d6ad..ba8f05a95c4e1fb046ca41ce94835792da0e4e18 100644 (file)
@@ -8,11 +8,11 @@
 #ifndef _COMPAT_FCNTL_H
 #define _COMPAT_FCNTL_H
 
+#include <common/compat/errno.hpp>
+
 #include <fcntl.h>
 #include <sys/types.h>
 
-#include <common/compat/errno.hpp>
-
 static_assert(sizeof(off_t) == sizeof(int64_t),
              "Build system is misconfigured, off_t must be 64-bit wide");
 
@@ -21,8 +21,7 @@ typedef off64_t loff_t;
 #endif
 
 #ifdef __linux__
-extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes,
-               unsigned int flags);
+extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes, unsigned int flags);
 #define lttng_sync_file_range(fd, offset, nbytes, flags) \
        compat_sync_file_range(fd, offset, nbytes, flags)
 
@@ -32,15 +31,14 @@ extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes,
 /*
  * Possible flags under Linux. Simply nullify them and avoid wrapper.
  */
-#define SYNC_FILE_RANGE_WAIT_AFTER    0
-#define SYNC_FILE_RANGE_WAIT_BEFORE   0
-#define SYNC_FILE_RANGE_WRITE         0
+#define SYNC_FILE_RANGE_WAIT_AFTER  0
+#define SYNC_FILE_RANGE_WAIT_BEFORE 0
+#define SYNC_FILE_RANGE_WRITE      0
 
-static inline int lttng_sync_file_range(
-               int fd __attribute__((unused)),
-               off_t offset __attribute__((unused)),
-               off_t nbytes __attribute__((unused)),
-               unsigned int flags __attribute__((unused)))
+static inline int lttng_sync_file_range(int fd __attribute__((unused)),
+                                       off_t offset __attribute__((unused)),
+                                       off_t nbytes __attribute__((unused)),
+                                       unsigned int flags __attribute__((unused)))
 {
        return -ENOSYS;
 }
@@ -50,24 +48,24 @@ static inline int lttng_sync_file_range(
 /*
  * Possible flags under Linux. Simply nullify them and avoid wrappers.
  */
-#define SPLICE_F_MOVE       0
-#define SPLICE_F_NONBLOCK   0
-#define SPLICE_F_MORE       0
-#define SPLICE_F_GIFT       0
+#define SPLICE_F_MOVE    0
+#define SPLICE_F_NONBLOCK 0
+#define SPLICE_F_MORE    0
+#define SPLICE_F_GIFT    0
 
-static inline ssize_t splice(
-               int fd_in __attribute__((unused)),
-               loff_t *off_in __attribute__((unused)),
-               int fd_out __attribute__((unused)),
-               loff_t *off_out __attribute__((unused)),
-               size_t len __attribute__((unused)),
-               unsigned int flags __attribute__((unused)))
+static inline ssize_t splice(int fd_in __attribute__((unused)),
+                            loff_t *off_in __attribute__((unused)),
+                            int fd_out __attribute__((unused)),
+                            loff_t *off_out __attribute__((unused)),
+                            size_t len __attribute__((unused)),
+                            unsigned int flags __attribute__((unused)))
 {
        return -ENOSYS;
 }
 #endif
 
-#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__sun__) || defined(__APPLE__))
+#if !(defined(__linux__) || defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__sun__) || \
+      defined(__APPLE__))
 #error "Please add support for your OS."
 #endif /* __linux__ , __FreeBSD__, __CYGWIN__, __sun__, __APPLE__ */
 
index 18b5dee97d9ab750f79e0ee0c7f3c26fe1147927..d37db05fc72ba53f8e8fcd65244666213876484d 100644 (file)
@@ -8,23 +8,22 @@
  *
  */
 
+#include <common/error.hpp>
+
 #include <stdlib.h>
-#include <unistd.h>
 #include <sys/types.h>
-#include <common/error.hpp>
+#include <unistd.h>
 
-static inline
-int lttng_is_setuid_setgid()
+static inline int lttng_is_setuid_setgid()
 {
        return geteuid() != getuid() || getegid() != getgid();
 }
 
-static inline
-char *lttng_secure_getenv(const char *name)
+static inline char *lttng_secure_getenv(const char *name)
 {
        if (lttng_is_setuid_setgid()) {
                WARN("Getting environment variable '%s' from setuid/setgid binary refused for security reasons.",
-                       name);
+                    name);
                return nullptr;
        }
        return getenv(name);
index a8bf7e2d08d8efc3a34fdccad7260d210ce974aa..0f75771ca12526fdd20e9ddc401b6fe38a4b1241 100644 (file)
 #include <netdb.h>
 
 #ifdef HAVE_GETHOSTBYNAME2
-static inline
-struct hostent *lttng_gethostbyname2(const char *name, int af) {
+static inline struct hostent *lttng_gethostbyname2(const char *name, int af)
+{
        return gethostbyname2(name, af);
 }
 #elif HAVE_GETIPNODEBYNAME
-static inline
-struct hostent *lttng_gethostbyname2(const char *name, int af) {
+static inline struct hostent *lttng_gethostbyname2(const char *name, int af)
+{
        int unused;
 
        return getipnodebyname(name, af, AI_DEFAULT, &unused);
 }
 #else
-# error "Missing compat for gethostbyname2()"
+#error "Missing compat for gethostbyname2()"
 #endif
 
 #endif /* _COMPAT_NETDB_H */
index 0203ae80db0074d3893f97c0d15558fcf1910e21..235538b42df88da7e1f8f9a9449ab2ace5d4edb6 100644 (file)
@@ -11,7 +11,7 @@
 #ifdef HAVE_PATHS_H
 #include <paths.h>
 #else
-# define _PATH_DEVNULL "/dev/null"
+#define _PATH_DEVNULL "/dev/null"
 #endif
 
 #endif /* _COMPAT_PATHS_H */
index e6de51474bfce238d96f50a9c993bf7a1c79784d..bfb3da82be7dc8459d8c8b8f459682ad93131757 100644 (file)
@@ -8,11 +8,11 @@
 #ifndef _LTT_POLL_H
 #define _LTT_POLL_H
 
+#include <common/common.hpp>
+
 #include <string.h>
 #include <unistd.h>
 
-#include <common/common.hpp>
-
 /*
  * Used by lttng_poll_clean to free the events structure in a lttng_poll_event.
  */
@@ -25,11 +25,12 @@ static inline void __lttng_poll_free(void *events)
  * epoll(7) implementation.
  */
 #ifdef HAVE_EPOLL
-#include <sys/epoll.h>
-#include <stdio.h>
-#include <features.h>
 #include <common/compat/fcntl.hpp>
 
+#include <features.h>
+#include <stdio.h>
+#include <sys/epoll.h>
+
 /* See man epoll(7) for this define path */
 #define COMPAT_EPOLL_PROC_PATH "/proc/sys/fs/epoll/max_user_watches"
 
@@ -47,7 +48,7 @@ enum {
        LPOLLHUP = EPOLLHUP,
        LPOLLNVAL = EPOLLHUP,
        LPOLLRDHUP = EPOLLRDHUP,
-       /* Close on exec feature of epoll */
+/* Close on exec feature of epoll */
 #if defined(HAVE_EPOLL_CREATE1) && defined(EPOLL_CLOEXEC)
        LTTNG_CLOEXEC = EPOLL_CLOEXEC,
 #else
@@ -63,15 +64,15 @@ enum {
 
 struct compat_epoll_event {
        int epfd;
-       uint32_t nb_fd;       /* Current number of fd in events */
+       uint32_t nb_fd; /* Current number of fd in events */
        uint32_t alloc_size; /* Size of events array */
-       uint32_t init_size;     /* Initial size of events array */
+       uint32_t init_size; /* Initial size of events array */
        struct epoll_event *events;
 };
 #define lttng_poll_event compat_epoll_event
 
-static inline int __lttng_epoll_get_prev_fd(struct lttng_poll_event *events,
-               int index, uint32_t nb_fd)
+static inline int
+__lttng_epoll_get_prev_fd(struct lttng_poll_event *events, int index, uint32_t nb_fd)
 {
        LTTNG_ASSERT(events);
        LTTNG_ASSERT(index != nb_fd);
@@ -87,22 +88,18 @@ static inline int __lttng_epoll_get_prev_fd(struct lttng_poll_event *events,
  * For the following calls, consider 'e' to be a lttng_poll_event pointer and i
  * being the index of the events array.
  */
-#define LTTNG_POLL_GETFD(e, i) LTTNG_REF(e)->events[i].data.fd
-#define LTTNG_POLL_GETEV(e, i) LTTNG_REF(e)->events[i].events
-#define LTTNG_POLL_GETNB(e) LTTNG_REF(e)->nb_fd
-#define LTTNG_POLL_GETSZ(e) LTTNG_REF(e)->events_size
-#define LTTNG_POLL_GET_PREV_FD(e, i, nb_fd) \
-       __lttng_epoll_get_prev_fd(LTTNG_REF(e), i, nb_fd)
+#define LTTNG_POLL_GETFD(e, i)             LTTNG_REF(e)->events[i].data.fd
+#define LTTNG_POLL_GETEV(e, i)             LTTNG_REF(e)->events[i].events
+#define LTTNG_POLL_GETNB(e)                LTTNG_REF(e)->nb_fd
+#define LTTNG_POLL_GETSZ(e)                LTTNG_REF(e)->events_size
+#define LTTNG_POLL_GET_PREV_FD(e, i, nb_fd) __lttng_epoll_get_prev_fd(LTTNG_REF(e), i, nb_fd)
 
 /* Create the epoll set. */
-extern int compat_epoll_create(struct lttng_poll_event *events,
-               int size, int flags);
-#define lttng_poll_create(events, size, flags) \
-       compat_epoll_create(events, size, flags)
+extern int compat_epoll_create(struct lttng_poll_event *events, int size, int flags);
+#define lttng_poll_create(events, size, flags) compat_epoll_create(events, size, flags)
 
 #if defined(HAVE_EPOLL_CREATE1) && defined(EPOLL_CLOEXEC)
-static inline int compat_glibc_epoll_create(int size __attribute__((unused)),
-               int flags)
+static inline int compat_glibc_epoll_create(int size __attribute__((unused)), int flags)
 {
        return epoll_create1(flags);
 }
@@ -125,42 +122,33 @@ static inline int compat_glibc_epoll_create(int size, int flags)
  * Wait on epoll set with the number of fd registered to the lttng_poll_event
  * data structure (events).
  */
-extern int compat_epoll_wait(struct lttng_poll_event *events, int timeout,
-               bool interruptible);
-#define lttng_poll_wait(events, timeout) \
-       compat_epoll_wait(events, timeout, false)
-#define lttng_poll_wait_interruptible(events, timeout) \
-       compat_epoll_wait(events, timeout, true)
+extern int compat_epoll_wait(struct lttng_poll_event *events, int timeout, bool interruptible);
+#define lttng_poll_wait(events, timeout)              compat_epoll_wait(events, timeout, false)
+#define lttng_poll_wait_interruptible(events, timeout) compat_epoll_wait(events, timeout, true)
 
 /*
  * Add a fd to the epoll set and resize the epoll_event structure if needed.
  */
-extern int compat_epoll_add(struct lttng_poll_event *events,
-               int fd, uint32_t req_events);
-#define lttng_poll_add(events, fd, req_events) \
-       compat_epoll_add(events, fd, req_events)
+extern int compat_epoll_add(struct lttng_poll_event *events, int fd, uint32_t req_events);
+#define lttng_poll_add(events, fd, req_events) compat_epoll_add(events, fd, req_events)
 
 /*
  * Remove a fd from the epoll set.
  */
 extern int compat_epoll_del(struct lttng_poll_event *events, int fd);
-#define lttng_poll_del(events, fd) \
-       compat_epoll_del(events, fd)
+#define lttng_poll_del(events, fd) compat_epoll_del(events, fd)
 
 /*
  * Modify an fd's events in the epoll set.
  */
-extern int compat_epoll_mod(struct lttng_poll_event *events,
-               int fd, uint32_t req_events);
-#define lttng_poll_mod(events, fd, req_events) \
-       compat_epoll_mod(events, fd, req_events)
+extern int compat_epoll_mod(struct lttng_poll_event *events, int fd, uint32_t req_events);
+#define lttng_poll_mod(events, fd, req_events) compat_epoll_mod(events, fd, req_events)
 
 /*
  * Set up the poll set limits variable poll_max_size
  */
 extern int compat_epoll_set_max_size();
-#define lttng_poll_set_max_size() \
-       compat_epoll_set_max_size()
+#define lttng_poll_set_max_size() compat_epoll_set_max_size()
 
 /*
  * This function memset with zero the structure since it can be reused at each
@@ -170,8 +158,7 @@ extern int compat_epoll_set_max_size();
 static inline void lttng_poll_reset(struct lttng_poll_event *events)
 {
        if (events && events->events) {
-               memset(events->events, 0,
-                               events->nb_fd * sizeof(struct epoll_event));
+               memset(events->events, 0, events->nb_fd * sizeof(struct epoll_event));
        }
 }
 
@@ -208,7 +195,7 @@ static inline void lttng_poll_clean(struct lttng_poll_event *events)
        __lttng_poll_free((void *) events->events);
 }
 
-#else  /* HAVE_EPOLL */
+#else /* HAVE_EPOLL */
 /*
  * Fallback on poll(2) API
  */
@@ -239,7 +226,7 @@ enum {
 };
 
 struct compat_poll_event_array {
-       uint32_t nb_fd;       /* Current number of fd in events */
+       uint32_t nb_fd; /* Current number of fd in events */
        uint32_t alloc_size; /* Size of events array */
        /* Initial size of the pollset. We never shrink below that. */
        uint32_t init_size;
@@ -261,10 +248,10 @@ struct compat_poll_event {
        /* Indicate if wait.events need to be updated from current. */
        int need_update:1;
 };
-#define lttng_poll_event compat_poll_event
+#define lttng_poll_event                              compat_poll_event
 
-static inline int __lttng_poll_get_prev_fd(struct lttng_poll_event *events,
-               int index, uint32_t nb_fd)
+static inline int
+__lttng_poll_get_prev_fd(struct lttng_poll_event *events, int index, uint32_t nb_fd)
 {
        LTTNG_ASSERT(events);
        LTTNG_ASSERT(index != nb_fd);
@@ -282,38 +269,31 @@ static inline int __lttng_poll_get_prev_fd(struct lttng_poll_event *events,
  * LTTNG_POLL_GETNB is always used after lttng_poll_wait, thus we can use the
  * current list for test compatibility purposes.
  */
-#define LTTNG_POLL_GETFD(e, i) LTTNG_REF(e)->wait.events[i].fd
-#define LTTNG_POLL_GETEV(e, i) LTTNG_REF(e)->wait.events[i].revents
-#define LTTNG_POLL_GETNB(e) LTTNG_REF(e)->current.nb_fd
-#define LTTNG_POLL_GETSZ(e) LTTNG_REF(e)->wait.events_size
-#define LTTNG_POLL_GET_PREV_FD(e, i, nb_fd) \
-       __lttng_poll_get_prev_fd(LTTNG_REF(e), i, nb_fd)
+#define LTTNG_POLL_GETFD(e, i)                        LTTNG_REF(e)->wait.events[i].fd
+#define LTTNG_POLL_GETEV(e, i)                        LTTNG_REF(e)->wait.events[i].revents
+#define LTTNG_POLL_GETNB(e)                           LTTNG_REF(e)->current.nb_fd
+#define LTTNG_POLL_GETSZ(e)                           LTTNG_REF(e)->wait.events_size
+#define LTTNG_POLL_GET_PREV_FD(e, i, nb_fd)           __lttng_poll_get_prev_fd(LTTNG_REF(e), i, nb_fd)
 
 /*
  * Create a pollfd structure of size 'size'.
  */
 extern int compat_poll_create(struct lttng_poll_event *events, int size);
-#define lttng_poll_create(events, size, flags) \
-       compat_poll_create(events, size)
+#define lttng_poll_create(events, size, flags)        compat_poll_create(events, size)
 
 /*
  * Wait on poll(2) event with nb_fd registered to the lttng_poll_event data
  * structure.
  */
-extern int compat_poll_wait(struct lttng_poll_event *events, int timeout,
-               bool interruptible);
-#define lttng_poll_wait(events, timeout) \
-       compat_poll_wait(events, timeout, false)
-#define lttng_poll_wait_interruptible(events, timeout) \
-       compat_poll_wait(events, timeout, true)
+extern int compat_poll_wait(struct lttng_poll_event *events, int timeout, bool interruptible);
+#define lttng_poll_wait(events, timeout)              compat_poll_wait(events, timeout, false)
+#define lttng_poll_wait_interruptible(events, timeout) compat_poll_wait(events, timeout, true)
 
 /*
  * Add the fd to the pollfd structure. Resize if needed.
  */
-extern int compat_poll_add(struct lttng_poll_event *events,
-               int fd, uint32_t req_events);
-#define lttng_poll_add(events, fd, req_events) \
-       compat_poll_add(events, fd, req_events)
+extern int compat_poll_add(struct lttng_poll_event *events, int fd, uint32_t req_events);
+#define lttng_poll_add(events, fd, req_events)        compat_poll_add(events, fd, req_events)
 
 /*
  * Remove the fd from the pollfd. Memory allocation is done to recreate a new
@@ -321,30 +301,26 @@ extern int compat_poll_add(struct lttng_poll_event *events,
  * one is freed().
  */
 extern int compat_poll_del(struct lttng_poll_event *events, int fd);
-#define lttng_poll_del(events, fd) \
-       compat_poll_del(events, fd)
+#define lttng_poll_del(events, fd)                    compat_poll_del(events, fd)
 
 /*
  * Modify an fd's events in the poll set.
  */
-extern int compat_poll_mod(struct lttng_poll_event *events,
-               int fd, uint32_t req_events);
-#define lttng_poll_mod(events, fd, req_events) \
-       compat_poll_mod(events, fd, req_events)
+extern int compat_poll_mod(struct lttng_poll_event *events, int fd, uint32_t req_events);
+#define lttng_poll_mod(events, fd, req_events)        compat_poll_mod(events, fd, req_events)
 
 /*
  * Set up the poll set limits variable poll_max_size
  */
 extern int compat_poll_set_max_size(void);
-#define lttng_poll_set_max_size() \
-       compat_poll_set_max_size()
+#define lttng_poll_set_max_size()                     compat_poll_set_max_size()
 
 /*
  * No need to reset a pollfd structure for poll(2)
  */
-static inline void lttng_poll_reset(
-               struct lttng_poll_event *events __attribute__((unused)))
-{}
+static inline void lttng_poll_reset(struct lttng_poll_event *events __attribute__((unused)))
+{
+}
 
 /*
  * Initialize an already allocated poll event data structure.
index 7883cd1ba303c5ecbcb88c5e842af6a3d7e0a61f..f8908992436853c78231637b274ae7028e0170ee 100644 (file)
@@ -8,8 +8,9 @@
 #ifndef _COMPAT_PTHREAD_H
 #define _COMPAT_PTHREAD_H
 
-#include <pthread.h>
 #include <common/compat/errno.hpp>
+
+#include <pthread.h>
 #include <string.h>
 
 #ifdef __FreeBSD__
@@ -19,8 +20,7 @@
 #define LTTNG_PTHREAD_NAMELEN 16
 
 #if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID)
-static inline
-int lttng_pthread_setname_np(const char *name)
+static inline int lttng_pthread_setname_np(const char *name)
 {
        /*
         * Some implementations don't error out, replicate this behavior for
@@ -33,15 +33,13 @@ int lttng_pthread_setname_np(const char *name)
        return pthread_setname_np(pthread_self(), name);
 }
 #elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID)
-static inline
-int lttng_pthread_setname_np(const char *name)
+static inline int lttng_pthread_setname_np(const char *name)
 {
        return pthread_setname_np(name);
 }
 #elif defined(HAVE_PTHREAD_SET_NAME_NP_WITH_TID)
 
-static inline
-int lttng_pthread_setname_np(const char *name)
+static inline int lttng_pthread_setname_np(const char *name)
 {
        /* Replicate pthread_setname_np's behavior. */
        if (strnlen(name, LTTNG_PTHREAD_NAMELEN) >= LTTNG_PTHREAD_NAMELEN) {
@@ -56,8 +54,7 @@ int lttng_pthread_setname_np(const char *name)
 /* Fallback on prtctl on Linux */
 #include <sys/prctl.h>
 
-static inline
-int lttng_pthread_setname_np(const char *name)
+static inline int lttng_pthread_setname_np(const char *name)
 {
        /* Replicate pthread_setname_np's behavior. */
        if (strnlen(name, LTTNG_PTHREAD_NAMELEN) >= LTTNG_PTHREAD_NAMELEN) {
@@ -69,29 +66,24 @@ int lttng_pthread_setname_np(const char *name)
 /*
  * For platforms without thread name support, do nothing.
  */
-static inline
-int lttng_pthread_setname_np(const char *name)
+static inline int lttng_pthread_setname_np(const char *name)
 {
        return -ENOSYS;
 }
 #endif
 
-
 #if defined(HAVE_PTHREAD_GETNAME_NP_WITH_TID)
-static inline
-int lttng_pthread_getname_np(char *name, size_t len)
+static inline int lttng_pthread_getname_np(char *name, size_t len)
 {
        return pthread_getname_np(pthread_self(), name, len);
 }
 #elif defined(HAVE_PTHREAD_GETNAME_NP_WITHOUT_TID)
-static inline
-int lttng_pthread_getname_np(char *name, size_t len)
+static inline int lttng_pthread_getname_np(char *name, size_t len)
 {
        return pthread_getname_np(name, len);
 }
 #elif defined(HAVE_PTHREAD_GET_NAME_NP_WITH_TID)
-static inline
-int lttng_pthread_getname_np(char *name, size_t len)
+static inline int lttng_pthread_getname_np(char *name, size_t len)
 {
        pthread_get_name_np(pthread_self(), name, len);
        return 0;
@@ -101,8 +93,7 @@ int lttng_pthread_getname_np(char *name, size_t len)
 /* Fallback on prtctl on Linux */
 #include <sys/prctl.h>
 
-static inline
-int lttng_pthread_getname_np(char *name, size_t len)
+static inline int lttng_pthread_getname_np(char *name, size_t len)
 {
        return prctl(PR_GET_NAME, name, 0, 0, 0);
 }
@@ -110,8 +101,7 @@ int lttng_pthread_getname_np(char *name, size_t len)
 /*
  * For platforms without thread name support, do nothing.
  */
-static inline
-int lttng_pthread_getname_np(char *name, size_t len)
+static inline int lttng_pthread_getname_np(char *name, size_t len)
 {
        return -ENOSYS;
 }
index c1aa9d38d357cfb688ecf76c6daf00dded320c93..dadd1fe8d6a6b6594a6d09eda2dc81197e5bfd54 100644 (file)
@@ -8,31 +8,30 @@
 #ifndef _COMPAT_SOCKET_H
 #define _COMPAT_SOCKET_H
 
+#include <common/macros.hpp>
+
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
 
-#include <common/macros.hpp>
-
 #ifndef MSG_NOSIGNAL
-# ifdef SO_NOSIGPIPE
-#   define MSG_NOSIGNAL SO_NOSIGPIPE
-# endif
+#ifdef SO_NOSIGPIPE
+#define MSG_NOSIGNAL SO_NOSIGPIPE
+#endif
 #endif
 
 #if defined(MSG_NOSIGNAL)
-static inline
-ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg)
+static inline ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg)
 {
        return recvmsg(sockfd, msg, MSG_NOSIGNAL);
 }
 #else
 
-#include <signal.h>
 #include <common/compat/errno.hpp>
 
-static inline
-ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg)
+#include <signal.h>
+
+static inline ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg)
 {
        ssize_t received;
        int saved_err;
@@ -82,8 +81,7 @@ ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg)
                int ret;
 
                do {
-                       ret = sigtimedwait(&sigpipe_set, NULL,
-                               &timeout);
+                       ret = sigtimedwait(&sigpipe_set, NULL, &timeout);
                } while (ret == -1 && errno == EINTR);
        }
        if (!sigpipe_was_pending) {
@@ -100,25 +98,24 @@ ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg)
 
 #ifdef __sun__
 
-# ifndef CMSG_ALIGN
-#  ifdef _CMSG_DATA_ALIGN
-#   define CMSG_ALIGN(len) _CMSG_DATA_ALIGN(len)
-#  else
-    /* aligning to sizeof (long) is assumed to be portable (fd.o#40235) */
-#   define CMSG_ALIGN(len) (((len) + sizeof (long) - 1) & ~(sizeof (long) - 1))
-#  endif
-#  ifndef CMSG_SPACE
-#    define CMSG_SPACE(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + CMSG_ALIGN (len))
-#  endif
-#  ifndef CMSG_LEN
-#    define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
-#  endif
-# endif
+#ifndef CMSG_ALIGN
+#ifdef _CMSG_DATA_ALIGN
+#define CMSG_ALIGN(len) _CMSG_DATA_ALIGN(len)
+#else
+/* aligning to sizeof (long) is assumed to be portable (fd.o#40235) */
+#define CMSG_ALIGN(len) (((len) + sizeof(long) - 1) & ~(sizeof(long) - 1))
+#endif
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+#endif
+#ifndef CMSG_LEN
+#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
+#endif
 
 #include <ucred.h>
 
-static inline
-int getpeereid(int s, uid_t *euid, gid_t *gid)
+static inline int getpeereid(int s, uid_t *euid, gid_t *gid)
 {
        int ret = 0;
        ucred_t *ucred = NULL;
@@ -148,7 +145,6 @@ end:
 }
 #endif /* __sun__ */
 
-
 #if defined(__linux__) || defined(__CYGWIN__)
 
 #define LTTNG_SOCK_CREDS SCM_CREDENTIALS
@@ -183,8 +179,7 @@ typedef struct lttng_sock_cred lttng_sock_cred;
 
 #ifdef __APPLE__
 
-static inline
-int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
+static inline int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
 {
        socklen_t pid_len = (socklen_t) sizeof(*pid);
 
@@ -195,8 +190,7 @@ int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
 #elif defined(__sun__)
 
 /* Use the getpeerucreds interface on Solaris. */
-static inline
-int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
+static inline int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
 {
        int ret = 0;
        ucred_t *ucred = NULL;
@@ -223,16 +217,14 @@ end:
 
 #include <sys/ucred.h>
 
-static inline
-int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
+static inline int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
 {
        int ret;
        struct xucred sock_creds = {};
        socklen_t sock_creds_len = (socklen_t) sizeof(sock_creds);
 
        /* Only available in FreeBSD 13.0 and up. */
-       ret = getsockopt(socket_fd, SOL_LOCAL, LOCAL_PEERCRED, &sock_creds,
-                       &sock_creds_len);
+       ret = getsockopt(socket_fd, SOL_LOCAL, LOCAL_PEERCRED, &sock_creds, &sock_creds_len);
        if (ret) {
                goto end;
        }
@@ -244,9 +236,7 @@ end:
 
 #endif /* __APPLE__ */
 
-
-static inline
-int lttng_get_unix_socket_peer_creds(int socket_fd, struct lttng_sock_cred *creds)
+static inline int lttng_get_unix_socket_peer_creds(int socket_fd, struct lttng_sock_cred *creds)
 {
        int ret;
 
index 526f2b2ced3b200ecfa696083baa9fadc72408eb..c34c7aa49b04feed30e23b01f0130dd2f7437db5 100644 (file)
@@ -9,18 +9,16 @@
 #ifndef _COMPAT_STRING_H
 #define _COMPAT_STRING_H
 
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 
 #ifdef HAVE_STRNLEN
-static inline
-size_t lttng_strnlen(const char *str, size_t max)
+static inline size_t lttng_strnlen(const char *str, size_t max)
 {
        return strnlen(str, max);
 }
 #else
-static inline
-size_t lttng_strnlen(const char *str, size_t max)
+static inline size_t lttng_strnlen(const char *str, size_t max)
 {
        size_t ret;
        const char *end;
@@ -38,14 +36,12 @@ size_t lttng_strnlen(const char *str, size_t max)
 #endif /* HAVE_STRNLEN */
 
 #ifdef HAVE_STRNDUP
-static inline
-char *lttng_strndup(const char *s, size_t n)
+static inline char *lttng_strndup(const char *s, size_t n)
 {
        return strndup(s, n);
 }
 #else
-static inline
-char *lttng_strndup(const char *s, size_t n)
+static inline char *lttng_strndup(const char *s, size_t n)
 {
        char *ret;
        size_t navail;
@@ -110,20 +106,18 @@ static inline int lttng_fls(int val)
 #endif /* HAVE_FLS */
 
 #ifdef HAVE_MEMRCHR
-static inline
-void *lttng_memrchr(const void *s, int c, size_t n)
+static inline void *lttng_memrchr(const void *s, int c, size_t n)
 {
        return (void *) memrchr(s, c, n);
 }
 #else
-static inline
-void *lttng_memrchr(const void *s, int c, size_t n)
+static inline void *lttng_memrchr(const void *s, int c, size_t n)
 {
        int i;
        const char *str = (const char *) s;
-       for (i = n-1; i >= 0; i--) {
-               if (str[i] == (char)c) {
-                       return (void *)(str+i);
+       for (i = n - 1; i >= 0; i--) {
+               if (str[i] == (char) c) {
+                       return (void *) (str + i);
                }
        }
        return NULL;
index 6cb5018c5400f885625a6b8acf4be3e89bac5f63..aed37ceedbfcd74f36ae4e60c12c000ab69287f2 100644 (file)
 
 typedef uint64_t timer_t;
 
-#include <mach/mach.h>
-#include <mach/clock.h>
 #include <common/compat/errno.hpp>
 
+#include <mach/clock.h>
+#include <mach/mach.h>
+
 #undef NSEC_PER_SEC
 #undef NSEC_PER_MSEC
 #undef NSEC_PER_USEC
@@ -31,11 +32,10 @@ typedef uint64_t timer_t;
 #if defined(__APPLE__) && !defined(LTTNG_HAVE_CLOCK_GETTIME)
 
 typedef int clockid_t;
-#define CLOCK_REALTIME CALENDAR_CLOCK
+#define CLOCK_REALTIME CALENDAR_CLOCK
 #define CLOCK_MONOTONIC SYSTEM_CLOCK
 
-static inline
-int lttng_clock_gettime(clockid_t clk_id, struct timespec *tp)
+static inline int lttng_clock_gettime(clockid_t clk_id, struct timespec *tp)
 {
        int ret = 0;
        clock_serv_t clock;
@@ -66,8 +66,7 @@ end:
 
 #else /* __APPLE__ && !LTTNG_HAVE_CLOCK_GETTIME */
 
-static inline
-int lttng_clock_gettime(clockid_t clk_id, struct timespec *tp)
+static inline int lttng_clock_gettime(clockid_t clk_id, struct timespec *tp)
 {
        return clock_gettime(clk_id, tp);
 }
index f921a7363953a172db1f0d688aba09b9c665f00d..f56b4bd0d3cfd1902c8e89d4b70e473c308a207b 100644 (file)
 
 #include <lttng/lttng-export.h>
 
-extern const char * const config_element_all;
-LTTNG_EXPORT extern const char * const config_element_channel;
-LTTNG_EXPORT extern const char * const config_element_channels;
-LTTNG_EXPORT extern const char * const config_element_domain;
-LTTNG_EXPORT extern const char * const config_element_domains;
-LTTNG_EXPORT extern const char * const config_element_event;
-LTTNG_EXPORT extern const char * const config_element_events;
-LTTNG_EXPORT extern const char * const config_element_context;
-LTTNG_EXPORT extern const char * const config_element_contexts;
-LTTNG_EXPORT extern const char * const config_element_attributes;
-LTTNG_EXPORT extern const char * const config_element_exclusion;
-LTTNG_EXPORT extern const char * const config_element_exclusions;
-LTTNG_EXPORT extern const char * const config_element_function_attributes;
-LTTNG_EXPORT extern const char * const config_element_probe_attributes;
-LTTNG_EXPORT extern const char * const config_element_symbol_name;
-LTTNG_EXPORT extern const char * const config_element_address;
-LTTNG_EXPORT extern const char * const config_element_offset;
-extern const char * const config_element_userspace_probe_lookup;
-extern const char * const config_element_userspace_probe_lookup_function_default;
-extern const char * const config_element_userspace_probe_lookup_function_elf;
-extern const char * const config_element_userspace_probe_lookup_tracepoint_sdt;
-extern const char * const config_element_userspace_probe_location_binary_path;
-extern const char * const config_element_userspace_probe_function_attributes;
-extern const char * const config_element_userspace_probe_function_location_function_name;
-extern const char * const config_element_userspace_probe_tracepoint_attributes;
-extern const char * const config_element_userspace_probe_tracepoint_location_provider_name;
-extern const char * const config_element_userspace_probe_tracepoint_location_probe_name;
-extern const char * const config_element_name;
-LTTNG_EXPORT extern const char * const config_element_enabled;
-LTTNG_EXPORT extern const char * const config_element_overwrite_mode;
-LTTNG_EXPORT extern const char * const config_element_subbuf_size;
-LTTNG_EXPORT extern const char * const config_element_num_subbuf;
-LTTNG_EXPORT extern const char * const config_element_switch_timer_interval;
-LTTNG_EXPORT extern const char * const config_element_read_timer_interval;
-extern const char * const config_element_monitor_timer_interval;
-extern const char * const config_element_blocking_timeout;
-LTTNG_EXPORT extern const char * const config_element_output;
-LTTNG_EXPORT extern const char * const config_element_output_type;
-LTTNG_EXPORT extern const char * const config_element_tracefile_size;
-LTTNG_EXPORT extern const char * const config_element_tracefile_count;
-LTTNG_EXPORT extern const char * const config_element_live_timer_interval;
-extern const char * const config_element_discarded_events;
-extern const char * const config_element_lost_packets;
-LTTNG_EXPORT extern const char * const config_element_type;
-LTTNG_EXPORT extern const char * const config_element_buffer_type;
-LTTNG_EXPORT extern const char * const config_element_session;
-LTTNG_EXPORT extern const char * const config_element_sessions;
-extern const char * const config_element_context_perf;
-extern const char * const config_element_context_app;
-extern const char * const config_element_context_app_provider_name;
-extern const char * const config_element_context_app_ctx_name;
-LTTNG_EXPORT extern const char * const config_element_config;
-LTTNG_EXPORT extern const char * const config_element_started;
-LTTNG_EXPORT extern const char * const config_element_snapshot_mode;
-LTTNG_EXPORT extern const char * const config_element_loglevel;
-LTTNG_EXPORT extern const char * const config_element_loglevel_type;
-LTTNG_EXPORT extern const char * const config_element_filter;
-extern const char * const config_element_filter_expression;
-LTTNG_EXPORT extern const char * const config_element_snapshot_outputs;
-LTTNG_EXPORT extern const char * const config_element_consumer_output;
-LTTNG_EXPORT extern const char * const config_element_destination;
-LTTNG_EXPORT extern const char * const config_element_path;
-LTTNG_EXPORT extern const char * const config_element_net_output;
-LTTNG_EXPORT extern const char * const config_element_control_uri;
-LTTNG_EXPORT extern const char * const config_element_data_uri;
-LTTNG_EXPORT extern const char * const config_element_max_size;
-LTTNG_EXPORT extern const char * const config_element_pid;
-extern const char * const config_element_process_attr_id;
-LTTNG_EXPORT extern const char * const config_element_pids;
-LTTNG_EXPORT extern const char * const config_element_name;
-LTTNG_EXPORT extern const char * const config_element_shared_memory_path;
-extern const char * const config_element_process_attr_tracker_pid;
-extern const char * const config_element_process_attr_tracker_vpid;
-extern const char * const config_element_process_attr_tracker_uid;
-extern const char * const config_element_process_attr_tracker_vuid;
-extern const char * const config_element_process_attr_tracker_gid;
-extern const char * const config_element_process_attr_tracker_vgid;
-extern const char * const config_element_process_attr_trackers;
-extern const char * const config_element_process_attr_values;
-extern const char * const config_element_process_attr_value_type;
-extern const char * const config_element_process_attr_pid_value;
-extern const char * const config_element_process_attr_vpid_value;
-extern const char * const config_element_process_attr_uid_value;
-extern const char * const config_element_process_attr_vuid_value;
-extern const char * const config_element_process_attr_gid_value;
-extern const char * const config_element_process_attr_vgid_value;
-extern const char * const config_element_process_attr_tracker_type;
-extern const char * const config_element_rotation_timer_interval;
-extern const char * const config_element_rotation_size;
-extern const char * const config_element_rotation_schedule;
+extern const char *const config_element_all;
+LTTNG_EXPORT extern const char *const config_element_channel;
+LTTNG_EXPORT extern const char *const config_element_channels;
+LTTNG_EXPORT extern const char *const config_element_domain;
+LTTNG_EXPORT extern const char *const config_element_domains;
+LTTNG_EXPORT extern const char *const config_element_event;
+LTTNG_EXPORT extern const char *const config_element_events;
+LTTNG_EXPORT extern const char *const config_element_context;
+LTTNG_EXPORT extern const char *const config_element_contexts;
+LTTNG_EXPORT extern const char *const config_element_attributes;
+LTTNG_EXPORT extern const char *const config_element_exclusion;
+LTTNG_EXPORT extern const char *const config_element_exclusions;
+LTTNG_EXPORT extern const char *const config_element_function_attributes;
+LTTNG_EXPORT extern const char *const config_element_probe_attributes;
+LTTNG_EXPORT extern const char *const config_element_symbol_name;
+LTTNG_EXPORT extern const char *const config_element_address;
+LTTNG_EXPORT extern const char *const config_element_offset;
+extern const char *const config_element_userspace_probe_lookup;
+extern const char *const config_element_userspace_probe_lookup_function_default;
+extern const char *const config_element_userspace_probe_lookup_function_elf;
+extern const char *const config_element_userspace_probe_lookup_tracepoint_sdt;
+extern const char *const config_element_userspace_probe_location_binary_path;
+extern const char *const config_element_userspace_probe_function_attributes;
+extern const char *const config_element_userspace_probe_function_location_function_name;
+extern const char *const config_element_userspace_probe_tracepoint_attributes;
+extern const char *const config_element_userspace_probe_tracepoint_location_provider_name;
+extern const char *const config_element_userspace_probe_tracepoint_location_probe_name;
+extern const char *const config_element_name;
+LTTNG_EXPORT extern const char *const config_element_enabled;
+LTTNG_EXPORT extern const char *const config_element_overwrite_mode;
+LTTNG_EXPORT extern const char *const config_element_subbuf_size;
+LTTNG_EXPORT extern const char *const config_element_num_subbuf;
+LTTNG_EXPORT extern const char *const config_element_switch_timer_interval;
+LTTNG_EXPORT extern const char *const config_element_read_timer_interval;
+extern const char *const config_element_monitor_timer_interval;
+extern const char *const config_element_blocking_timeout;
+LTTNG_EXPORT extern const char *const config_element_output;
+LTTNG_EXPORT extern const char *const config_element_output_type;
+LTTNG_EXPORT extern const char *const config_element_tracefile_size;
+LTTNG_EXPORT extern const char *const config_element_tracefile_count;
+LTTNG_EXPORT extern const char *const config_element_live_timer_interval;
+extern const char *const config_element_discarded_events;
+extern const char *const config_element_lost_packets;
+LTTNG_EXPORT extern const char *const config_element_type;
+LTTNG_EXPORT extern const char *const config_element_buffer_type;
+LTTNG_EXPORT extern const char *const config_element_session;
+LTTNG_EXPORT extern const char *const config_element_sessions;
+extern const char *const config_element_context_perf;
+extern const char *const config_element_context_app;
+extern const char *const config_element_context_app_provider_name;
+extern const char *const config_element_context_app_ctx_name;
+LTTNG_EXPORT extern const char *const config_element_config;
+LTTNG_EXPORT extern const char *const config_element_started;
+LTTNG_EXPORT extern const char *const config_element_snapshot_mode;
+LTTNG_EXPORT extern const char *const config_element_loglevel;
+LTTNG_EXPORT extern const char *const config_element_loglevel_type;
+LTTNG_EXPORT extern const char *const config_element_filter;
+extern const char *const config_element_filter_expression;
+LTTNG_EXPORT extern const char *const config_element_snapshot_outputs;
+LTTNG_EXPORT extern const char *const config_element_consumer_output;
+LTTNG_EXPORT extern const char *const config_element_destination;
+LTTNG_EXPORT extern const char *const config_element_path;
+LTTNG_EXPORT extern const char *const config_element_net_output;
+LTTNG_EXPORT extern const char *const config_element_control_uri;
+LTTNG_EXPORT extern const char *const config_element_data_uri;
+LTTNG_EXPORT extern const char *const config_element_max_size;
+LTTNG_EXPORT extern const char *const config_element_pid;
+extern const char *const config_element_process_attr_id;
+LTTNG_EXPORT extern const char *const config_element_pids;
+LTTNG_EXPORT extern const char *const config_element_name;
+LTTNG_EXPORT extern const char *const config_element_shared_memory_path;
+extern const char *const config_element_process_attr_tracker_pid;
+extern const char *const config_element_process_attr_tracker_vpid;
+extern const char *const config_element_process_attr_tracker_uid;
+extern const char *const config_element_process_attr_tracker_vuid;
+extern const char *const config_element_process_attr_tracker_gid;
+extern const char *const config_element_process_attr_tracker_vgid;
+extern const char *const config_element_process_attr_trackers;
+extern const char *const config_element_process_attr_values;
+extern const char *const config_element_process_attr_value_type;
+extern const char *const config_element_process_attr_pid_value;
+extern const char *const config_element_process_attr_vpid_value;
+extern const char *const config_element_process_attr_uid_value;
+extern const char *const config_element_process_attr_vuid_value;
+extern const char *const config_element_process_attr_gid_value;
+extern const char *const config_element_process_attr_vgid_value;
+extern const char *const config_element_process_attr_tracker_type;
+extern const char *const config_element_rotation_timer_interval;
+extern const char *const config_element_rotation_size;
+extern const char *const config_element_rotation_schedule;
 
-LTTNG_EXPORT extern const char * const config_domain_type_kernel;
-LTTNG_EXPORT extern const char * const config_domain_type_ust;
-LTTNG_EXPORT extern const char * const config_domain_type_jul;
-LTTNG_EXPORT extern const char * const config_domain_type_log4j;
-LTTNG_EXPORT extern const char * const config_domain_type_python;
+LTTNG_EXPORT extern const char *const config_domain_type_kernel;
+LTTNG_EXPORT extern const char *const config_domain_type_ust;
+LTTNG_EXPORT extern const char *const config_domain_type_jul;
+LTTNG_EXPORT extern const char *const config_domain_type_log4j;
+LTTNG_EXPORT extern const char *const config_domain_type_python;
 
-LTTNG_EXPORT extern const char * const config_buffer_type_per_pid;
-LTTNG_EXPORT extern const char * const config_buffer_type_per_uid;
-LTTNG_EXPORT extern const char * const config_buffer_type_global;
+LTTNG_EXPORT extern const char *const config_buffer_type_per_pid;
+LTTNG_EXPORT extern const char *const config_buffer_type_per_uid;
+LTTNG_EXPORT extern const char *const config_buffer_type_global;
 
-LTTNG_EXPORT extern const char * const config_overwrite_mode_discard;
-LTTNG_EXPORT extern const char * const config_overwrite_mode_overwrite;
+LTTNG_EXPORT extern const char *const config_overwrite_mode_discard;
+LTTNG_EXPORT extern const char *const config_overwrite_mode_overwrite;
 
-LTTNG_EXPORT extern const char * const config_output_type_splice;
-LTTNG_EXPORT extern const char * const config_output_type_mmap;
+LTTNG_EXPORT extern const char *const config_output_type_splice;
+LTTNG_EXPORT extern const char *const config_output_type_mmap;
 
-LTTNG_EXPORT extern const char * const config_loglevel_type_all;
-LTTNG_EXPORT extern const char * const config_loglevel_type_range;
-LTTNG_EXPORT extern const char * const config_loglevel_type_single;
+LTTNG_EXPORT extern const char *const config_loglevel_type_all;
+LTTNG_EXPORT extern const char *const config_loglevel_type_range;
+LTTNG_EXPORT extern const char *const config_loglevel_type_single;
 
-LTTNG_EXPORT extern const char * const config_event_type_all;
-LTTNG_EXPORT extern const char * const config_event_type_tracepoint;
-LTTNG_EXPORT extern const char * const config_event_type_probe;
-extern const char * const config_event_type_userspace_probe;
-LTTNG_EXPORT extern const char * const config_event_type_function;
-LTTNG_EXPORT extern const char * const config_event_type_function_entry;
-LTTNG_EXPORT extern const char * const config_event_type_noop;
-LTTNG_EXPORT extern const char * const config_event_type_syscall;
-LTTNG_EXPORT extern const char * const config_event_type_kprobe;
-LTTNG_EXPORT extern const char * const config_event_type_kretprobe;
+LTTNG_EXPORT extern const char *const config_event_type_all;
+LTTNG_EXPORT extern const char *const config_event_type_tracepoint;
+LTTNG_EXPORT extern const char *const config_event_type_probe;
+extern const char *const config_event_type_userspace_probe;
+LTTNG_EXPORT extern const char *const config_event_type_function;
+LTTNG_EXPORT extern const char *const config_event_type_function_entry;
+LTTNG_EXPORT extern const char *const config_event_type_noop;
+LTTNG_EXPORT extern const char *const config_event_type_syscall;
+LTTNG_EXPORT extern const char *const config_event_type_kprobe;
+LTTNG_EXPORT extern const char *const config_event_type_kretprobe;
 
-LTTNG_EXPORT extern const char * const config_event_context_pid;
-LTTNG_EXPORT extern const char * const config_event_context_procname;
-LTTNG_EXPORT extern const char * const config_event_context_prio;
-LTTNG_EXPORT extern const char * const config_event_context_nice;
-LTTNG_EXPORT extern const char * const config_event_context_vpid;
-LTTNG_EXPORT extern const char * const config_event_context_tid;
-LTTNG_EXPORT extern const char * const config_event_context_vtid;
-LTTNG_EXPORT extern const char * const config_event_context_ppid;
-LTTNG_EXPORT extern const char * const config_event_context_vppid;
-LTTNG_EXPORT extern const char * const config_event_context_pthread_id;
-LTTNG_EXPORT extern const char * const config_event_context_hostname;
-LTTNG_EXPORT extern const char * const config_event_context_ip;
-LTTNG_EXPORT extern const char * const config_event_context_perf_thread_counter;
-extern const char * const config_event_context_app;
-extern const char * const config_event_context_interruptible;
-extern const char * const config_event_context_preemptible;
-extern const char * const config_event_context_need_reschedule;
-extern const char * const config_event_context_migratable;
-extern const char * const config_event_context_callstack_user;
-extern const char * const config_event_context_callstack_kernel;
+LTTNG_EXPORT extern const char *const config_event_context_pid;
+LTTNG_EXPORT extern const char *const config_event_context_procname;
+LTTNG_EXPORT extern const char *const config_event_context_prio;
+LTTNG_EXPORT extern const char *const config_event_context_nice;
+LTTNG_EXPORT extern const char *const config_event_context_vpid;
+LTTNG_EXPORT extern const char *const config_event_context_tid;
+LTTNG_EXPORT extern const char *const config_event_context_vtid;
+LTTNG_EXPORT extern const char *const config_event_context_ppid;
+LTTNG_EXPORT extern const char *const config_event_context_vppid;
+LTTNG_EXPORT extern const char *const config_event_context_pthread_id;
+LTTNG_EXPORT extern const char *const config_event_context_hostname;
+LTTNG_EXPORT extern const char *const config_event_context_ip;
+LTTNG_EXPORT extern const char *const config_event_context_perf_thread_counter;
+extern const char *const config_event_context_app;
+extern const char *const config_event_context_interruptible;
+extern const char *const config_event_context_preemptible;
+extern const char *const config_event_context_need_reschedule;
+extern const char *const config_event_context_migratable;
+extern const char *const config_event_context_callstack_user;
+extern const char *const config_event_context_callstack_kernel;
 
-extern const char * const config_element_rotation_schedules;
-extern const char * const config_element_rotation_schedule_periodic;
-extern const char * const config_element_rotation_schedule_periodic_time_us;
-extern const char * const config_element_rotation_schedule_size_threshold;
-extern const char * const config_element_rotation_schedule_size_threshold_bytes;
-extern const char * const config_event_context_cgroup_ns;
-extern const char * const config_event_context_ipc_ns;
-extern const char * const config_event_context_mnt_ns;
-extern const char * const config_event_context_net_ns;
-extern const char * const config_event_context_pid_ns;
-extern const char * const config_event_context_time_ns;
-extern const char * const config_event_context_user_ns;
-extern const char * const config_event_context_uts_ns;
-extern const char * const config_event_context_uid;
-extern const char * const config_event_context_euid;
-extern const char * const config_event_context_suid;
-extern const char * const config_event_context_gid;
-extern const char * const config_event_context_egid;
-extern const char * const config_event_context_sgid;
-extern const char * const config_event_context_vuid;
-extern const char * const config_event_context_veuid;
-extern const char * const config_event_context_vsuid;
-extern const char * const config_event_context_vgid;
-extern const char * const config_event_context_vegid;
-extern const char * const config_event_context_vsgid;
+extern const char *const config_element_rotation_schedules;
+extern const char *const config_element_rotation_schedule_periodic;
+extern const char *const config_element_rotation_schedule_periodic_time_us;
+extern const char *const config_element_rotation_schedule_size_threshold;
+extern const char *const config_element_rotation_schedule_size_threshold_bytes;
+extern const char *const config_event_context_cgroup_ns;
+extern const char *const config_event_context_ipc_ns;
+extern const char *const config_event_context_mnt_ns;
+extern const char *const config_event_context_net_ns;
+extern const char *const config_event_context_pid_ns;
+extern const char *const config_event_context_time_ns;
+extern const char *const config_event_context_user_ns;
+extern const char *const config_event_context_uts_ns;
+extern const char *const config_event_context_uid;
+extern const char *const config_event_context_euid;
+extern const char *const config_event_context_suid;
+extern const char *const config_event_context_gid;
+extern const char *const config_event_context_egid;
+extern const char *const config_event_context_sgid;
+extern const char *const config_event_context_vuid;
+extern const char *const config_event_context_veuid;
+extern const char *const config_event_context_vsuid;
+extern const char *const config_event_context_vgid;
+extern const char *const config_event_context_vegid;
+extern const char *const config_event_context_vsgid;
 
 #endif /* CONFIG_SESSION_INTERNAL_H */
index 71270a4efdd9f2dc4ad59b147cbc2ef9fd4ec67d..472ec8140d538b282fbc36a72464f77245ed9752 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common/config/config-session-abi.hpp>
 #include <common/macros.hpp>
+
 #include <stdint.h>
 
 struct config_load_session_override_attr {
@@ -56,8 +57,7 @@ int config_writer_destroy(struct config_writer *writer);
  * Returns zero if the XML element could be opened.
  * Negative values indicate an error.
  */
-int config_writer_open_element(struct config_writer *writer,
-               const char *element_name);
+int config_writer_open_element(struct config_writer *writer, const char *element_name);
 
 /*
  * Write an element tag attribute.
@@ -70,7 +70,8 @@ int config_writer_open_element(struct config_writer *writer,
  * Negative values indicate an error.
  */
 int config_writer_write_attribute(struct config_writer *writer,
-               const char *name, const char *value);
+                                 const char *name,
+                                 const char *value);
 
 /*
  * Close the current element tag.
@@ -95,7 +96,8 @@ int config_writer_close_element(struct config_writer *writer);
  * Negative values indicate an error.
  */
 int config_writer_write_element_unsigned_int(struct config_writer *writer,
-               const char *element_name, uint64_t value);
+                                            const char *element_name,
+                                            uint64_t value);
 
 /*
  * Write an element of type signed int.
@@ -110,7 +112,8 @@ int config_writer_write_element_unsigned_int(struct config_writer *writer,
  * Negative values indicate an error.
  */
 int config_writer_write_element_signed_int(struct config_writer *writer,
-               const char *element_name, int64_t value);
+                                          const char *element_name,
+                                          int64_t value);
 
 /*
  * Write an element of type boolean.
@@ -125,7 +128,8 @@ int config_writer_write_element_signed_int(struct config_writer *writer,
  * Negative values indicate an error.
  */
 int config_writer_write_element_bool(struct config_writer *writer,
-               const char *element_name, int value);
+                                    const char *element_name,
+                                    int value);
 
 /*
  * Write an element of type string.
@@ -140,7 +144,8 @@ int config_writer_write_element_bool(struct config_writer *writer,
  * Negative values indicate an error.
  */
 int config_writer_write_element_string(struct config_writer *writer,
-               const char *element_name, const char *value);
+                                      const char *element_name,
+                                      const char *value);
 
 /*
  * Write an element of type double.
@@ -155,8 +160,8 @@ int config_writer_write_element_string(struct config_writer *writer,
  * Negative values indicate an error.
  */
 int config_writer_write_element_double(struct config_writer *writer,
-               const char *element_name,
-               double value);
+                                      const char *element_name,
+                                      double value);
 
 /*
  * Load session configurations from a file.
@@ -177,8 +182,10 @@ int config_writer_write_element_double(struct config_writer *writer,
  * Returns zero if the session could be loaded successfully. Returns
  * a negative LTTNG_ERR code on error.
  */
-int config_load_session(const char *path, const char *session_name,
-               int overwrite, unsigned int autoload,
-               const struct config_load_session_override_attr *overrides);
+int config_load_session(const char *path,
+                       const char *session_name,
+                       int overwrite,
+                       unsigned int autoload,
+                       const struct config_load_session_override_attr *overrides);
 
 #endif /* _CONFIG_H */
index 6e60e5c15c2eab9852d7b941c9c75b650c494601..9f958ac58704b2b81724fbc4efd0a9e6fc5a9ef2 100644 (file)
@@ -52,11 +52,14 @@ struct consumer_metadata_cache {
 
 enum consumer_metadata_cache_write_status
 consumer_metadata_cache_write(struct consumer_metadata_cache *cache,
-               unsigned int offset, unsigned int len, uint64_t version,
-               const char *data);
+                             unsigned int offset,
+                             unsigned int len,
+                             uint64_t version,
+                             const char *data);
 int consumer_metadata_cache_allocate(struct lttng_consumer_channel *channel);
 void consumer_metadata_cache_destroy(struct lttng_consumer_channel *channel);
 int consumer_metadata_cache_flushed(struct lttng_consumer_channel *channel,
-               uint64_t offset, int timer);
+                                   uint64_t offset,
+                                   int timer);
 
 #endif /* CONSUMER_METADATA_CACHE_H */
index ae43f732259a92aea78146b8621cf709eb90f23c..97fbd145b1a95d0ac749b2a9157ec7f2dbaf09e8 100644 (file)
@@ -21,18 +21,17 @@ enum consumer_stream_open_packet_status {
  *
  * The channel lock MUST be acquired.
  */
-struct lttng_consumer_stream *consumer_stream_create(
-               struct lttng_consumer_channel *channel,
-               uint64_t channel_key,
-               uint64_t stream_key,
-               const char *channel_name,
-               uint64_t relayd_id,
-               uint64_t session_id,
-               struct lttng_trace_chunk *trace_chunk,
-               int cpu,
-               int *alloc_ret,
-               enum consumer_channel_type type,
-               unsigned int monitor);
+struct lttng_consumer_stream *consumer_stream_create(struct lttng_consumer_channel *channel,
+                                                    uint64_t channel_key,
+                                                    uint64_t stream_key,
+                                                    const char *channel_name,
+                                                    uint64_t relayd_id,
+                                                    uint64_t session_id,
+                                                    struct lttng_trace_chunk *trace_chunk,
+                                                    int cpu,
+                                                    int *alloc_ret,
+                                                    enum consumer_channel_type type,
+                                                    unsigned int monitor);
 
 /*
  * Close stream's file descriptors and, if needed, close stream also on the
@@ -51,15 +50,14 @@ void consumer_stream_close_output(struct lttng_consumer_stream *stream);
  * a hash table before calling this.
  */
 void consumer_stream_relayd_close(struct lttng_consumer_stream *stream,
-               struct consumer_relayd_sock_pair *relayd);
+                                 struct consumer_relayd_sock_pair *relayd);
 
 /*
  * Delete the stream from all possible hash tables.
  *
  * The consumer data lock MUST be acquired.
  */
-void consumer_stream_delete(struct lttng_consumer_stream *stream,
-               struct lttng_ht *ht);
+void consumer_stream_delete(struct lttng_consumer_stream *stream, struct lttng_ht *ht);
 
 /*
  * Free the given stream within a RCU call.
@@ -73,8 +71,7 @@ void consumer_stream_free(struct lttng_consumer_stream *stream);
  *
  * This MUST be called WITHOUT the consumer data and stream lock acquired.
  */
-void consumer_stream_destroy(struct lttng_consumer_stream *stream,
-               struct lttng_ht *ht);
+void consumer_stream_destroy(struct lttng_consumer_stream *stream, struct lttng_ht *ht);
 
 /*
  * Destroy the stream's buffers on the tracer side. This is also called in a
@@ -86,18 +83,16 @@ void consumer_stream_destroy_buffers(struct lttng_consumer_stream *stream);
  * Write index of a specific stream either on the relayd or local disk.
  */
 int consumer_stream_write_index(struct lttng_consumer_stream *stream,
-               struct ctf_packet_index *index);
+                               struct ctf_packet_index *index);
 
-int consumer_stream_sync_metadata(struct lttng_consumer_local_data *ctx,
-               uint64_t session_id);
+int consumer_stream_sync_metadata(struct lttng_consumer_local_data *ctx, uint64_t session_id);
 
 /*
  * Create the output files of a local stream.
  *
  * This must be called with the channel's and the stream's lock held.
  */
-int consumer_stream_create_output_files(struct lttng_consumer_stream *stream,
-               bool create_index);
+int consumer_stream_create_output_files(struct lttng_consumer_stream *stream, bool create_index);
 
 /*
  * Rotate the output files of a local stream. This will change the
@@ -123,8 +118,7 @@ bool consumer_stream_is_deleted(struct lttng_consumer_stream *stream);
  *
  * This must be called on initialization before any subbuffer is consumed.
  */
-int consumer_stream_enable_metadata_bucketization(
-               struct lttng_consumer_stream *stream);
+int consumer_stream_enable_metadata_bucketization(struct lttng_consumer_stream *stream);
 
 /*
  * Set the version of a metadata stream (i.e. following a metadata
@@ -133,16 +127,16 @@ int consumer_stream_enable_metadata_bucketization(
  * Changing the version of a metadata stream will cause any bucketized metadata
  * to be discarded and will mark the metadata stream for future `reset`.
  */
-void consumer_stream_metadata_set_version(
-               struct lttng_consumer_stream *stream, uint64_t new_version);
+void consumer_stream_metadata_set_version(struct lttng_consumer_stream *stream,
+                                         uint64_t new_version);
 
 /*
  * Attempt to open a packet in a stream.
  *
  * This function must be called with the stream and channel locks held.
  */
-enum consumer_stream_open_packet_status consumer_stream_open_packet(
-               struct lttng_consumer_stream *stream);
+enum consumer_stream_open_packet_status
+consumer_stream_open_packet(struct lttng_consumer_stream *stream);
 
 /*
  * Flush a stream's buffer.
@@ -153,7 +147,6 @@ enum consumer_stream_open_packet_status consumer_stream_open_packet(
  *
  * This function must be called with the stream and channel locks held.
  */
-int consumer_stream_flush_buffer(struct lttng_consumer_stream *stream,
-               bool producer_active);
+int consumer_stream_flush_buffer(struct lttng_consumer_stream *stream, bool producer_active);
 
 #endif /* LTTNG_CONSUMER_STREAM_H */
index 656ebe036268ee868b82564ef30afa53629b95e0..50025d727cf98db138f394c6aef78835417561f4 100644 (file)
 #ifndef CONSUMER_TIMER_H
 #define CONSUMER_TIMER_H
 
-#include <pthread.h>
-
 #include "consumer.hpp"
 
-#define LTTNG_CONSUMER_SIG_SWITCH      ((SIGRTMIN + 10))
-#define LTTNG_CONSUMER_SIG_TEARDOWN    ((SIGRTMIN + 11))
-#define LTTNG_CONSUMER_SIG_LIVE                ((SIGRTMIN + 12))
-#define LTTNG_CONSUMER_SIG_MONITOR     ((SIGRTMIN + 13))
-#define LTTNG_CONSUMER_SIG_EXIT                ((SIGRTMIN + 14))
+#include <pthread.h>
+
+#define LTTNG_CONSUMER_SIG_SWITCH   ((SIGRTMIN + 10))
+#define LTTNG_CONSUMER_SIG_TEARDOWN ((SIGRTMIN + 11))
+#define LTTNG_CONSUMER_SIG_LIVE            ((SIGRTMIN + 12))
+#define LTTNG_CONSUMER_SIG_MONITOR  ((SIGRTMIN + 13))
+#define LTTNG_CONSUMER_SIG_EXIT            ((SIGRTMIN + 14))
 
 #define CLOCKID CLOCK_MONOTONIC
 
  * exclusion.
  */
 struct timer_signal_data {
-       pthread_t tid;  /* thread id managing signals */
+       pthread_t tid; /* thread id managing signals */
        int setup_done;
        int qs_done;
        pthread_mutex_t lock;
 };
 
 void consumer_timer_switch_start(struct lttng_consumer_channel *channel,
-               unsigned int switch_timer_interval_us);
+                                unsigned int switch_timer_interval_us);
 void consumer_timer_switch_stop(struct lttng_consumer_channel *channel);
 void consumer_timer_live_start(struct lttng_consumer_channel *channel,
-               unsigned int live_timer_interval_us);
+                              unsigned int live_timer_interval_us);
 void consumer_timer_live_stop(struct lttng_consumer_channel *channel);
 int consumer_timer_monitor_start(struct lttng_consumer_channel *channel,
-               unsigned int monitor_timer_interval_us);
+                                unsigned int monitor_timer_interval_us);
 int consumer_timer_monitor_stop(struct lttng_consumer_channel *channel);
 void *consumer_timer_thread(void *data);
 int consumer_signal_init();
index a28bc160959277431e8555256e1a0d71c559689a..1efbc4eeeec33e6a57ebeb9748cf3d51f2e28907 100644 (file)
 #ifndef LIB_CONSUMER_H
 #define LIB_CONSUMER_H
 
+#include <common/buffer-view.hpp>
+#include <common/compat/fcntl.hpp>
+#include <common/credentials.hpp>
+#include <common/dynamic-array.hpp>
+#include <common/hashtable/hashtable.hpp>
+#include <common/index/ctf-index.hpp>
+#include <common/pipe.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/trace-chunk-registry.hpp>
+#include <common/uuid.hpp>
+
+#include <lttng/lttng.h>
+
 #include <limits.h>
 #include <poll.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <urcu/list.h>
 
-#include <lttng/lttng.h>
-
-#include <common/hashtable/hashtable.hpp>
-#include <common/compat/fcntl.hpp>
-#include <common/uuid.hpp>
-#include <common/sessiond-comm/sessiond-comm.hpp>
-#include <common/pipe.hpp>
-#include <common/index/ctf-index.hpp>
-#include <common/trace-chunk-registry.hpp>
-#include <common/credentials.hpp>
-#include <common/buffer-view.hpp>
-#include <common/dynamic-array.hpp>
-
 struct lttng_consumer_local_data;
 
 /* Commands for consumer */
@@ -39,7 +39,7 @@ enum lttng_consumer_command {
        /* pause, delete, active depending on fd state */
        LTTNG_CONSUMER_UPDATE_STREAM,
        /* inform the consumer to quit when all fd has hang up */
-       LTTNG_CONSUMER_STOP,    /* deprecated */
+       LTTNG_CONSUMER_STOP, /* deprecated */
        LTTNG_CONSUMER_ADD_RELAYD_SOCKET,
        /* Inform the consumer to kill a specific relayd connection */
        LTTNG_CONSUMER_DESTROY_RELAYD,
@@ -82,13 +82,13 @@ enum consumer_endpoint_status {
 };
 
 enum consumer_channel_output {
-       CONSUMER_CHANNEL_MMAP   = 0,
-       CONSUMER_CHANNEL_SPLICE = 1,
+       CONSUMER_CHANNEL_MMAP = 0,
+       CONSUMER_CHANNEL_SPLICE = 1,
 };
 
 enum consumer_channel_type {
-       CONSUMER_CHANNEL_TYPE_METADATA  = 0,
-       CONSUMER_CHANNEL_TYPE_DATA      = 1,
+       CONSUMER_CHANNEL_TYPE_METADATA = 0,
+       CONSUMER_CHANNEL_TYPE_DATA = 1,
 };
 
 enum sync_metadata_status {
@@ -160,7 +160,7 @@ struct lttng_consumer_channel {
        enum consumer_channel_type type;
 
        /* For UST */
-       uid_t ust_app_uid;      /* Application UID. */
+       uid_t ust_app_uid; /* Application UID. */
        struct lttng_ust_ctl_consumer_channel *uchan;
        unsigned char uuid[LTTNG_UUID_STR_LEN];
        /*
@@ -721,8 +721,8 @@ struct lttng_consumer_local_data {
         * Returns the number of bytes read, or negative error value.
         */
        ssize_t (*on_buffer_ready)(struct lttng_consumer_stream *stream,
-                       struct lttng_consumer_local_data *ctx,
-                       bool locked_by_caller);
+                                  struct lttng_consumer_local_data *ctx,
+                                  bool locked_by_caller);
        /*
         * function to call when we receive a new channel, it receives a
         * newly allocated channel, depending on the return code of this
@@ -814,7 +814,7 @@ struct lttng_consumer_global_data {
         * This is nested OUTSIDE the stream lock.
         * This is nested OUTSIDE the consumer_relayd_sock_pair lock.
         */
-       pthread_mutex_t lock {};
+       pthread_mutex_t lock{};
 
        /*
         * Number of streams in the data stream hash table declared outside.
@@ -879,8 +879,7 @@ extern int consumer_quit;
 LTTNG_EXPORT extern int data_consumption_paused;
 
 /* Return a human-readable consumer type string that is suitable for logging. */
-static inline
-const char *lttng_consumer_type_str(enum lttng_consumer_type type)
+static inline const char *lttng_consumer_type_str(enum lttng_consumer_type type)
 {
        switch (type) {
        case LTTNG_CONSUMER_UNKNOWN:
@@ -904,14 +903,12 @@ int lttng_consumer_init();
 /*
  * Set the error socket for communication with a session daemon.
  */
-void lttng_consumer_set_error_sock(struct lttng_consumer_local_data *ctx,
-               int sock);
+void lttng_consumer_set_error_sock(struct lttng_consumer_local_data *ctx, int sock);
 
 /*
  * Set the command socket path for communication with a session daemon.
  */
-void lttng_consumer_set_command_sock_path(
-               struct lttng_consumer_local_data *ctx, char *sock);
+void lttng_consumer_set_command_sock_path(struct lttng_consumer_local_data *ctx, char *sock);
 
 /*
  * Send return code to session daemon.
@@ -941,43 +938,39 @@ int lttng_consumer_poll_socket(struct pollfd *kconsumer_sockpoll);
  * Copy the fields from the channel that need to be accessed (read-only)
  * directly from the stream.
  */
-void consumer_stream_update_channel_attributes(
-               struct lttng_consumer_stream *stream,
-               struct lttng_consumer_channel *channel);
-
-struct lttng_consumer_stream *consumer_allocate_stream(
-               struct lttng_consumer_channel *channel,
-               uint64_t channel_key,
-               uint64_t stream_key,
-               const char *channel_name,
-               uint64_t relayd_id,
-               uint64_t session_id,
-               struct lttng_trace_chunk *trace_chunk,
-               int cpu,
-               int *alloc_ret,
-               enum consumer_channel_type type,
-               unsigned int monitor);
+void consumer_stream_update_channel_attributes(struct lttng_consumer_stream *stream,
+                                              struct lttng_consumer_channel *channel);
+
+struct lttng_consumer_stream *consumer_allocate_stream(struct lttng_consumer_channel *channel,
+                                                      uint64_t channel_key,
+                                                      uint64_t stream_key,
+                                                      const char *channel_name,
+                                                      uint64_t relayd_id,
+                                                      uint64_t session_id,
+                                                      struct lttng_trace_chunk *trace_chunk,
+                                                      int cpu,
+                                                      int *alloc_ret,
+                                                      enum consumer_channel_type type,
+                                                      unsigned int monitor);
 struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key,
-               uint64_t session_id,
-               const uint64_t *chunk_id,
-               const char *pathname,
-               const char *name,
-               uint64_t relayd_id,
-               enum lttng_event_output output,
-               uint64_t tracefile_size,
-               uint64_t tracefile_count,
-               uint64_t session_id_per_pid,
-               unsigned int monitor,
-               unsigned int live_timer_interval,
-               bool is_in_live_session,
-               const char *root_shm_path,
-               const char *shm_path);
-void consumer_del_stream(struct lttng_consumer_stream *stream,
-               struct lttng_ht *ht);
-void consumer_del_metadata_stream(struct lttng_consumer_stream *stream,
-               struct lttng_ht *ht);
+                                                        uint64_t session_id,
+                                                        const uint64_t *chunk_id,
+                                                        const char *pathname,
+                                                        const char *name,
+                                                        uint64_t relayd_id,
+                                                        enum lttng_event_output output,
+                                                        uint64_t tracefile_size,
+                                                        uint64_t tracefile_count,
+                                                        uint64_t session_id_per_pid,
+                                                        unsigned int monitor,
+                                                        unsigned int live_timer_interval,
+                                                        bool is_in_live_session,
+                                                        const char *root_shm_path,
+                                                        const char *shm_path);
+void consumer_del_stream(struct lttng_consumer_stream *stream, struct lttng_ht *ht);
+void consumer_del_metadata_stream(struct lttng_consumer_stream *stream, struct lttng_ht *ht);
 int consumer_add_channel(struct lttng_consumer_channel *channel,
-               struct lttng_consumer_local_data *ctx);
+                        struct lttng_consumer_local_data *ctx);
 void consumer_del_channel(struct lttng_consumer_channel *channel);
 
 /* lttng-relayd consumer command */
@@ -986,33 +979,29 @@ int consumer_send_relayd_stream(struct lttng_consumer_stream *stream, char *path
 int consumer_send_relayd_streams_sent(uint64_t net_seq_idx);
 void close_relayd_stream(struct lttng_consumer_stream *stream);
 struct lttng_consumer_channel *consumer_find_channel(uint64_t key);
-int consumer_handle_stream_before_relayd(struct lttng_consumer_stream *stream,
-               size_t data_size);
+int consumer_handle_stream_before_relayd(struct lttng_consumer_stream *stream, size_t data_size);
 void consumer_steal_stream_key(int key, struct lttng_ht *ht);
 
-struct lttng_consumer_local_data *lttng_consumer_create(
-               enum lttng_consumer_type type,
-               ssize_t (*buffer_ready)(struct lttng_consumer_stream *stream,
-                       struct lttng_consumer_local_data *ctx,
-                       bool locked_by_caller),
-               int (*recv_channel)(struct lttng_consumer_channel *channel),
-               int (*recv_stream)(struct lttng_consumer_stream *stream),
-               int (*update_stream)(uint64_t sessiond_key, uint32_t state));
+struct lttng_consumer_local_data *
+lttng_consumer_create(enum lttng_consumer_type type,
+                     ssize_t (*buffer_ready)(struct lttng_consumer_stream *stream,
+                                             struct lttng_consumer_local_data *ctx,
+                                             bool locked_by_caller),
+                     int (*recv_channel)(struct lttng_consumer_channel *channel),
+                     int (*recv_stream)(struct lttng_consumer_stream *stream),
+                     int (*update_stream)(uint64_t sessiond_key, uint32_t state));
 void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx);
-ssize_t lttng_consumer_on_read_subbuffer_mmap(
-               struct lttng_consumer_stream *stream,
-               const struct lttng_buffer_view *buffer,
-               unsigned long padding);
-ssize_t lttng_consumer_on_read_subbuffer_splice(
-               struct lttng_consumer_local_data *ctx,
-               struct lttng_consumer_stream *stream, unsigned long len,
-               unsigned long padding);
+ssize_t lttng_consumer_on_read_subbuffer_mmap(struct lttng_consumer_stream *stream,
+                                             const struct lttng_buffer_view *buffer,
+                                             unsigned long padding);
+ssize_t lttng_consumer_on_read_subbuffer_splice(struct lttng_consumer_local_data *ctx,
+                                               struct lttng_consumer_stream *stream,
+                                               unsigned long len,
+                                               unsigned long padding);
 int lttng_consumer_sample_snapshot_positions(struct lttng_consumer_stream *stream);
 int lttng_consumer_take_snapshot(struct lttng_consumer_stream *stream);
-int lttng_consumer_get_produced_snapshot(struct lttng_consumer_stream *stream,
-               unsigned long *pos);
-int lttng_consumer_get_consumed_snapshot(struct lttng_consumer_stream *stream,
-               unsigned long *pos);
+int lttng_consumer_get_produced_snapshot(struct lttng_consumer_stream *stream, unsigned long *pos);
+int lttng_consumer_get_consumed_snapshot(struct lttng_consumer_stream *stream, unsigned long *pos);
 int lttng_ustconsumer_get_wakeup_fd(struct lttng_consumer_stream *stream);
 int lttng_ustconsumer_close_wakeup_fd(struct lttng_consumer_stream *stream);
 void *consumer_thread_metadata_poll(void *data);
@@ -1020,68 +1009,69 @@ void *consumer_thread_data_poll(void *data);
 void *consumer_thread_sessiond_poll(void *data);
 void *consumer_thread_channel_poll(void *data);
 int lttng_consumer_recv_cmd(struct lttng_consumer_local_data *ctx,
-               int sock, struct pollfd *consumer_sockpoll);
+                           int sock,
+                           struct pollfd *consumer_sockpoll);
 
 ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
-               struct lttng_consumer_local_data *ctx,
-               bool locked_by_caller);
+                                     struct lttng_consumer_local_data *ctx,
+                                     bool locked_by_caller);
 int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream);
 void consumer_add_relayd_socket(uint64_t net_seq_idx,
-               int sock_type,
-               struct lttng_consumer_local_data *ctx,
-               int sock,
-               struct pollfd *consumer_sockpoll,
-               uint64_t sessiond_id,
-               uint64_t relayd_session_id,
-               uint32_t relayd_version_major,
-               uint32_t relayd_version_minor,
-               enum lttcomm_sock_proto relayd_socket_protocol);
-void consumer_flag_relayd_for_destroy(
-               struct consumer_relayd_sock_pair *relayd);
+                               int sock_type,
+                               struct lttng_consumer_local_data *ctx,
+                               int sock,
+                               struct pollfd *consumer_sockpoll,
+                               uint64_t sessiond_id,
+                               uint64_t relayd_session_id,
+                               uint32_t relayd_version_major,
+                               uint32_t relayd_version_minor,
+                               enum lttcomm_sock_proto relayd_socket_protocol);
+void consumer_flag_relayd_for_destroy(struct consumer_relayd_sock_pair *relayd);
 int consumer_data_pending(uint64_t id);
 int consumer_send_status_msg(int sock, int ret_code);
-int consumer_send_status_channel(int sock,
-               struct lttng_consumer_channel *channel);
-void notify_thread_del_channel(struct lttng_consumer_local_data *ctx,
-               uint64_t key);
+int consumer_send_status_channel(int sock, struct lttng_consumer_channel *channel);
+void notify_thread_del_channel(struct lttng_consumer_local_data *ctx, uint64_t key);
 void consumer_destroy_relayd(struct consumer_relayd_sock_pair *relayd);
 unsigned long consumer_get_consume_start_pos(unsigned long consumed_pos,
-               unsigned long produced_pos, uint64_t nb_packets_per_stream,
-               uint64_t max_sb_size);
+                                            unsigned long produced_pos,
+                                            uint64_t nb_packets_per_stream,
+                                            uint64_t max_sb_size);
 void consumer_add_data_stream(struct lttng_consumer_stream *stream);
 void consumer_del_stream_for_data(struct lttng_consumer_stream *stream);
 void consumer_add_metadata_stream(struct lttng_consumer_stream *stream);
 void consumer_del_stream_for_metadata(struct lttng_consumer_stream *stream);
 int consumer_create_index_file(struct lttng_consumer_stream *stream);
 int lttng_consumer_rotate_channel(struct lttng_consumer_channel *channel,
-               uint64_t key, uint64_t relayd_id);
+                                 uint64_t key,
+                                 uint64_t relayd_id);
 int lttng_consumer_stream_is_rotate_ready(struct lttng_consumer_stream *stream);
 int lttng_consumer_rotate_stream(struct lttng_consumer_stream *stream);
-int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel,
-               uint64_t key);
+int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel, uint64_t key);
 void lttng_consumer_reset_stream_rotate_state(struct lttng_consumer_stream *stream);
-enum lttcomm_return_code lttng_consumer_create_trace_chunk(
-               const uint64_t *relayd_id, uint64_t session_id,
-               uint64_t chunk_id,
-               time_t chunk_creation_timestamp,
-               const char *chunk_override_name,
-               const struct lttng_credentials *credentials,
-               struct lttng_directory_handle *chunk_directory_handle);
-enum lttcomm_return_code lttng_consumer_close_trace_chunk(
-               const uint64_t *relayd_id, uint64_t session_id,
-               uint64_t chunk_id, time_t chunk_close_timestamp,
-               const enum lttng_trace_chunk_command_type *close_command,
-               char *path);
-enum lttcomm_return_code lttng_consumer_trace_chunk_exists(
-               const uint64_t *relayd_id, uint64_t session_id,
-               uint64_t chunk_id);
+enum lttcomm_return_code
+lttng_consumer_create_trace_chunk(const uint64_t *relayd_id,
+                                 uint64_t session_id,
+                                 uint64_t chunk_id,
+                                 time_t chunk_creation_timestamp,
+                                 const char *chunk_override_name,
+                                 const struct lttng_credentials *credentials,
+                                 struct lttng_directory_handle *chunk_directory_handle);
+enum lttcomm_return_code
+lttng_consumer_close_trace_chunk(const uint64_t *relayd_id,
+                                uint64_t session_id,
+                                uint64_t chunk_id,
+                                time_t chunk_close_timestamp,
+                                const enum lttng_trace_chunk_command_type *close_command,
+                                char *path);
+enum lttcomm_return_code lttng_consumer_trace_chunk_exists(const uint64_t *relayd_id,
+                                                          uint64_t session_id,
+                                                          uint64_t chunk_id);
 void lttng_consumer_cleanup_relayd(struct consumer_relayd_sock_pair *relayd);
-enum lttcomm_return_code lttng_consumer_init_command(
-               struct lttng_consumer_local_data *ctx,
-               const lttng_uuid& sessiond_uuid);
+enum lttcomm_return_code lttng_consumer_init_command(struct lttng_consumer_local_data *ctx,
+                                                    const lttng_uuid& sessiond_uuid);
 int lttng_consumer_clear_channel(struct lttng_consumer_channel *channel);
-enum lttcomm_return_code lttng_consumer_open_channel_packets(
-               struct lttng_consumer_channel *channel);
+enum lttcomm_return_code
+lttng_consumer_open_channel_packets(struct lttng_consumer_channel *channel);
 int consumer_metadata_wakeup_pipe(const struct lttng_consumer_channel *channel);
 void lttng_consumer_sigbus_handle(void *addr);
 void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel);
index dfa73faea1e9001e56b8653865fb19592745bca6..ca9ee28c5adaa8ac7beb359259ccbcfb0aea936a 100644 (file)
@@ -19,13 +19,12 @@ enum metadata_bucket_status {
        METADATA_BUCKET_STATUS_ERROR,
 };
 
-struct metadata_bucket *metadata_bucket_create(
-               metadata_bucket_flush_cb flush, void *data);
+struct metadata_bucket *metadata_bucket_create(metadata_bucket_flush_cb flush, void *data);
 
 void metadata_bucket_destroy(struct metadata_bucket *bucket);
 
 enum metadata_bucket_status metadata_bucket_fill(struct metadata_bucket *bucket,
-               const struct stream_subbuffer *buffer);
+                                                const struct stream_subbuffer *buffer);
 
 void metadata_bucket_reset(struct metadata_bucket *bucket);
 
index 324ef535e52b5e5658c144be778ae7d095ecc0dc..bcf34cd2daa5543ff533867bebaf7a75e28208df 100644 (file)
@@ -21,7 +21,6 @@
  * Returns 0 if the string is a valid application context, else a negative
  * value on error.
  */
-int parse_application_context(const char *str, char **provider_name,
-               char **ctx_name);
+int parse_application_context(const char *str, char **provider_name, char **ctx_name);
 
 #endif /* LTTNG_COMMON_CONTEXT_H */
index 340e64ee96fb92a72f0aa45cc84abf5d81115804..70eaa77b422a022da4c903d40f4da1912de84531 100644 (file)
@@ -8,12 +8,12 @@
 #ifndef LTTNG_CREDENTIALS_H
 #define LTTNG_CREDENTIALS_H
 
-#include <sys/types.h>
-#include <stdbool.h>
 #include "macros.hpp"
-
 #include "optional.hpp"
 
+#include <stdbool.h>
+#include <sys/types.h>
+
 struct lttng_credentials {
        LTTNG_OPTIONAL(uid_t) uid;
        LTTNG_OPTIONAL(gid_t) gid;
@@ -24,12 +24,12 @@ uid_t lttng_credentials_get_uid(const struct lttng_credentials *creds);
 gid_t lttng_credentials_get_gid(const struct lttng_credentials *creds);
 
 bool lttng_credentials_is_equal_uid(const struct lttng_credentials *a,
-               const struct lttng_credentials *b);
+                                   const struct lttng_credentials *b);
 
 bool lttng_credentials_is_equal_gid(const struct lttng_credentials *a,
-               const struct lttng_credentials *b);
+                                   const struct lttng_credentials *b);
 
 bool lttng_credentials_is_equal(const struct lttng_credentials *a,
-               const struct lttng_credentials *b);
+                               const struct lttng_credentials *b);
 
 #endif /* LTTNG_CREDENTIALS_H */
index d1ec1cb424400382fde60e02928f5c40ee91b460..9e39e2b19dbd81cfe65ee0db41de347aecde97e8 100644 (file)
@@ -9,9 +9,10 @@
  *
  */
 
-#include <unistd.h>
 #include <common/macros.hpp>
 
+#include <unistd.h>
+
 /*
  * Daemonize this process by forking and making the parent wait for the child
  * to signal it indicating readiness. Once received, the parent successfully
@@ -22,7 +23,6 @@
  *
  * Return 0 on success else -1 on error.
  */
-int lttng_daemonize(pid_t *child_ppid, int *completion_flag,
-               int close_fds);
+int lttng_daemonize(pid_t *child_ppid, int *completion_flag, int close_fds);
 
 #endif /* LTTNG_DAEMONIZE_H */
index cae1ec5fcf1dcbc9755f450e2d65a4945484d89c..4b4d902dd715e34bb56815ef1000fc73767f2b4a 100644 (file)
 #ifndef _DEFAULTS_H
 #define _DEFAULTS_H
 
-#include <pthread.h>
 #include <common/macros.hpp>
 
+#include <pthread.h>
+
 /* Default unix group name for tracing. */
-#define DEFAULT_TRACING_GROUP                   "tracing"
+#define DEFAULT_TRACING_GROUP "tracing"
 
 /*
  * This value is defined in the CTF specification (see
  * git://git.efficios.com/ctf.git in the file
  * common-trace-format-specification.txt.
  */
-#define DEFAULT_METADATA_NAME                   "metadata"
+#define DEFAULT_METADATA_NAME "metadata"
 
 /* Environment variable to set session daemon binary path. */
-#define DEFAULT_SESSIOND_PATH_ENV               "LTTNG_SESSIOND_PATH"
+#define DEFAULT_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH"
 
 /* Environment variable to set man pager binary path. */
-#define DEFAULT_MAN_BIN_PATH_ENV                "LTTNG_MAN_BIN_PATH"
+#define DEFAULT_MAN_BIN_PATH_ENV "LTTNG_MAN_BIN_PATH"
 
 /* Default man pager binary path. */
-#define DEFAULT_MAN_BIN_PATH                    "/usr/bin/man"
+#define DEFAULT_MAN_BIN_PATH "/usr/bin/man"
 
 /* Default trace output directory name */
-#define DEFAULT_TRACE_DIR_NAME                  "lttng-traces"
+#define DEFAULT_TRACE_DIR_NAME "lttng-traces"
 
 /* Default size of a hash table */
-#define DEFAULT_HT_SIZE                         4
+#define DEFAULT_HT_SIZE 4
 
 /* Default session daemon paths */
-#define DEFAULT_HOME_DIR                                               "/tmp"
-#define DEFAULT_UST_SOCK_DIR                    DEFAULT_HOME_DIR "/ust-app-socks"
-#define DEFAULT_GLOBAL_APPS_PIPE                DEFAULT_UST_SOCK_DIR "/global"
-#define DEFAULT_TRACE_OUTPUT                    DEFAULT_HOME_DIR "/lttng"
+#define DEFAULT_HOME_DIR        "/tmp"
+#define DEFAULT_UST_SOCK_DIR    DEFAULT_HOME_DIR "/ust-app-socks"
+#define DEFAULT_GLOBAL_APPS_PIPE DEFAULT_UST_SOCK_DIR "/global"
+#define DEFAULT_TRACE_OUTPUT    DEFAULT_HOME_DIR "/lttng"
 
 /* Default directory where the trace are written in per domain */
-#define DEFAULT_KERNEL_TRACE_DIR                "kernel"
-#define DEFAULT_UST_TRACE_DIR                   "ust"
+#define DEFAULT_KERNEL_TRACE_DIR "kernel"
+#define DEFAULT_UST_TRACE_DIR   "ust"
 
 /* Subpath for per PID or UID sessions. */
-#define DEFAULT_UST_TRACE_PID_PATH               "pid"
-#define DEFAULT_UST_TRACE_UID_PATH               "uid/%d/%u-bit"
+#define DEFAULT_UST_TRACE_PID_PATH "pid"
+#define DEFAULT_UST_TRACE_UID_PATH "uid/%d/%u-bit"
 
 /*
  * Default session name for the lttng command line. This default value will
  * get the date and time appended (%Y%m%d-%H%M%S) to it.
  */
-#define DEFAULT_SESSION_NAME                    "auto"
+#define DEFAULT_SESSION_NAME "auto"
 
 /* Default consumer paths */
-#define DEFAULT_CONSUMERD_FILE                  "lttng-consumerd"
+#define DEFAULT_CONSUMERD_FILE "lttng-consumerd"
 
 /* Default consumer paths */
-#define DEFAULT_CONSUMERD_RUNDIR                "%s"
+#define DEFAULT_CONSUMERD_RUNDIR "%s"
 
 /* Kernel consumer path */
-#define DEFAULT_KCONSUMERD_PATH                 DEFAULT_CONSUMERD_RUNDIR "/kconsumerd"
-#define DEFAULT_KCONSUMERD_CMD_SOCK_PATH        DEFAULT_KCONSUMERD_PATH "/command"
-#define DEFAULT_KCONSUMERD_ERR_SOCK_PATH        DEFAULT_KCONSUMERD_PATH "/error"
+#define DEFAULT_KCONSUMERD_PATH                 DEFAULT_CONSUMERD_RUNDIR "/kconsumerd"
+#define DEFAULT_KCONSUMERD_CMD_SOCK_PATH DEFAULT_KCONSUMERD_PATH "/command"
+#define DEFAULT_KCONSUMERD_ERR_SOCK_PATH DEFAULT_KCONSUMERD_PATH "/error"
 
 /* UST 64-bit consumer path */
-#define DEFAULT_USTCONSUMERD64_PATH             DEFAULT_CONSUMERD_RUNDIR "/ustconsumerd64"
-#define DEFAULT_USTCONSUMERD64_CMD_SOCK_PATH    DEFAULT_USTCONSUMERD64_PATH "/command"
-#define DEFAULT_USTCONSUMERD64_ERR_SOCK_PATH    DEFAULT_USTCONSUMERD64_PATH "/error"
+#define DEFAULT_USTCONSUMERD64_PATH         DEFAULT_CONSUMERD_RUNDIR "/ustconsumerd64"
+#define DEFAULT_USTCONSUMERD64_CMD_SOCK_PATH DEFAULT_USTCONSUMERD64_PATH "/command"
+#define DEFAULT_USTCONSUMERD64_ERR_SOCK_PATH DEFAULT_USTCONSUMERD64_PATH "/error"
 
 /* UST 32-bit consumer path */
-#define DEFAULT_USTCONSUMERD32_PATH             DEFAULT_CONSUMERD_RUNDIR "/ustconsumerd32"
-#define DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH    DEFAULT_USTCONSUMERD32_PATH "/command"
-#define DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH    DEFAULT_USTCONSUMERD32_PATH "/error"
+#define DEFAULT_USTCONSUMERD32_PATH         DEFAULT_CONSUMERD_RUNDIR "/ustconsumerd32"
+#define DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH DEFAULT_USTCONSUMERD32_PATH "/command"
+#define DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH DEFAULT_USTCONSUMERD32_PATH "/error"
 
 /* Relayd path */
-#define DEFAULT_RELAYD_RUNDIR                  "%s"
-#define DEFAULT_RELAYD_PATH                    DEFAULT_RELAYD_RUNDIR "/relayd"
+#define DEFAULT_RELAYD_RUNDIR "%s"
+#define DEFAULT_RELAYD_PATH   DEFAULT_RELAYD_RUNDIR "/relayd"
 
-#define DEFAULT_RELAYD_MIN_FD_POOL_SIZE                100
+#define DEFAULT_RELAYD_MIN_FD_POOL_SIZE 100
 /*
  * The file descriptor pool size needs a reserve buffer to accommodates the
  * indirect use of short-lived file descriptors. For instance, glibc will
  *
  * This value must be less than DEFAULT_RELAYD_MIN_FD_POOL_SIZE.
  */
-#define DEFAULT_RELAYD_FD_POOL_SIZE_RESERVE    10
+#define DEFAULT_RELAYD_FD_POOL_SIZE_RESERVE 10
 
 /* Default lttng run directory */
-#define DEFAULT_LTTNG_HOME_ENV_VAR              "LTTNG_HOME"
-#define DEFAULT_LTTNG_FALLBACK_HOME_ENV_VAR    "HOME"
-#define DEFAULT_LTTNG_RUNDIR                    CONFIG_LTTNG_SYSTEM_RUNDIR
-#define DEFAULT_LTTNG_HOME_RUNDIR               "%s/.lttng"
-#define DEFAULT_LTTNG_SESSIOND_PIDFILE          "lttng-sessiond.pid"
-#define DEFAULT_LTTNG_SESSIOND_AGENTPORT_FILE   "agent.port"
-#define DEFAULT_LTTNG_SESSIOND_LOCKFILE         "lttng-sessiond.lck"
+#define DEFAULT_LTTNG_HOME_ENV_VAR           "LTTNG_HOME"
+#define DEFAULT_LTTNG_FALLBACK_HOME_ENV_VAR   "HOME"
+#define DEFAULT_LTTNG_RUNDIR                 CONFIG_LTTNG_SYSTEM_RUNDIR
+#define DEFAULT_LTTNG_HOME_RUNDIR            "%s/.lttng"
+#define DEFAULT_LTTNG_SESSIOND_PIDFILE       "lttng-sessiond.pid"
+#define DEFAULT_LTTNG_SESSIOND_AGENTPORT_FILE "agent.port"
+#define DEFAULT_LTTNG_SESSIOND_LOCKFILE              "lttng-sessiond.lck"
 
 /* Default probes list */
-#define DEFAULT_LTTNG_KMOD_PROBES              "LTTNG_KMOD_PROBES"
+#define DEFAULT_LTTNG_KMOD_PROBES "LTTNG_KMOD_PROBES"
 
 /* Default extra probes list */
-#define DEFAULT_LTTNG_EXTRA_KMOD_PROBES                "LTTNG_EXTRA_KMOD_PROBES"
+#define DEFAULT_LTTNG_EXTRA_KMOD_PROBES "LTTNG_EXTRA_KMOD_PROBES"
 
 /* Default unix socket path */
-#define DEFAULT_GLOBAL_CLIENT_UNIX_SOCK                DEFAULT_LTTNG_RUNDIR "/client-lttng-sessiond"
-#define DEFAULT_HOME_CLIENT_UNIX_SOCK                  DEFAULT_LTTNG_HOME_RUNDIR "/client-lttng-sessiond"
-#define DEFAULT_GLOBAL_HEALTH_UNIX_SOCK                DEFAULT_LTTNG_RUNDIR "/sessiond-health"
-#define DEFAULT_HOME_HEALTH_UNIX_SOCK                  DEFAULT_LTTNG_HOME_RUNDIR "/sessiond-health"
-#define DEFAULT_GLOBAL_NOTIFICATION_CHANNEL_UNIX_SOCK   DEFAULT_LTTNG_RUNDIR "/sessiond-notification"
-#define DEFAULT_HOME_NOTIFICATION_CHANNEL_UNIX_SOCK    DEFAULT_LTTNG_HOME_RUNDIR "/sessiond-notification"
+#define DEFAULT_GLOBAL_CLIENT_UNIX_SOCK                      DEFAULT_LTTNG_RUNDIR "/client-lttng-sessiond"
+#define DEFAULT_HOME_CLIENT_UNIX_SOCK                DEFAULT_LTTNG_HOME_RUNDIR "/client-lttng-sessiond"
+#define DEFAULT_GLOBAL_HEALTH_UNIX_SOCK                      DEFAULT_LTTNG_RUNDIR "/sessiond-health"
+#define DEFAULT_HOME_HEALTH_UNIX_SOCK                DEFAULT_LTTNG_HOME_RUNDIR "/sessiond-health"
+#define DEFAULT_GLOBAL_NOTIFICATION_CHANNEL_UNIX_SOCK DEFAULT_LTTNG_RUNDIR "/sessiond-notification"
+#define DEFAULT_HOME_NOTIFICATION_CHANNEL_UNIX_SOCK \
+       DEFAULT_LTTNG_HOME_RUNDIR "/sessiond-notification"
 
 /* Default consumer health unix socket path */
-#define DEFAULT_GLOBAL_USTCONSUMER32_HEALTH_UNIX_SOCK  DEFAULT_LTTNG_RUNDIR "/ustconsumerd32/health"
-#define DEFAULT_HOME_USTCONSUMER32_HEALTH_UNIX_SOCK    DEFAULT_LTTNG_HOME_RUNDIR "/ustconsumerd32/health"
-#define DEFAULT_GLOBAL_USTCONSUMER64_HEALTH_UNIX_SOCK  DEFAULT_LTTNG_RUNDIR "/ustconsumerd64/health"
-#define DEFAULT_HOME_USTCONSUMER64_HEALTH_UNIX_SOCK    DEFAULT_LTTNG_HOME_RUNDIR "/ustconsumerd64/health"
-#define DEFAULT_GLOBAL_KCONSUMER_HEALTH_UNIX_SOCK      DEFAULT_LTTNG_RUNDIR "/kconsumerd/health"
-#define DEFAULT_HOME_KCONSUMER_HEALTH_UNIX_SOCK                DEFAULT_LTTNG_HOME_RUNDIR "/kconsumerd/health"
+#define DEFAULT_GLOBAL_USTCONSUMER32_HEALTH_UNIX_SOCK DEFAULT_LTTNG_RUNDIR "/ustconsumerd32/health"
+#define DEFAULT_HOME_USTCONSUMER32_HEALTH_UNIX_SOCK \
+       DEFAULT_LTTNG_HOME_RUNDIR "/ustconsumerd32/health"
+#define DEFAULT_GLOBAL_USTCONSUMER64_HEALTH_UNIX_SOCK DEFAULT_LTTNG_RUNDIR "/ustconsumerd64/health"
+#define DEFAULT_HOME_USTCONSUMER64_HEALTH_UNIX_SOCK \
+       DEFAULT_LTTNG_HOME_RUNDIR "/ustconsumerd64/health"
+#define DEFAULT_GLOBAL_KCONSUMER_HEALTH_UNIX_SOCK DEFAULT_LTTNG_RUNDIR "/kconsumerd/health"
+#define DEFAULT_HOME_KCONSUMER_HEALTH_UNIX_SOCK          DEFAULT_LTTNG_HOME_RUNDIR "/kconsumerd/health"
 
 /* Default relay health unix socket path */
-#define DEFAULT_GLOBAL_RELAY_HEALTH_UNIX_SOCK          DEFAULT_LTTNG_RUNDIR "/relayd/health-%d"
-#define DEFAULT_HOME_RELAY_HEALTH_UNIX_SOCK            DEFAULT_LTTNG_HOME_RUNDIR "/relayd/health-%d"
+#define DEFAULT_GLOBAL_RELAY_HEALTH_UNIX_SOCK DEFAULT_LTTNG_RUNDIR "/relayd/health-%d"
+#define DEFAULT_HOME_RELAY_HEALTH_UNIX_SOCK   DEFAULT_LTTNG_HOME_RUNDIR "/relayd/health-%d"
 
 /* Default daemon configuration file path */
-#define DEFAULT_SYSTEM_CONFIGPATH               CONFIG_LTTNG_SYSTEM_CONFIGDIR \
+#define DEFAULT_SYSTEM_CONFIGPATH     \
+       CONFIG_LTTNG_SYSTEM_CONFIGDIR \
        "/lttng"
 
-#define DEFAULT_DAEMON_CONFIG_FILE              "lttng.conf"
-#define DEFAULT_DAEMON_HOME_CONFIGPATH          DEFAULT_LTTNG_HOME_RUNDIR "/" \
-       DEFAULT_DAEMON_CONFIG_FILE
-#define DEFAULT_DAEMON_SYSTEM_CONFIGPATH        DEFAULT_SYSTEM_CONFIGPATH "/" \
-       DEFAULT_DAEMON_CONFIG_FILE
+#define DEFAULT_DAEMON_CONFIG_FILE      "lttng.conf"
+#define DEFAULT_DAEMON_HOME_CONFIGPATH  DEFAULT_LTTNG_HOME_RUNDIR "/" DEFAULT_DAEMON_CONFIG_FILE
+#define DEFAULT_DAEMON_SYSTEM_CONFIGPATH DEFAULT_SYSTEM_CONFIGPATH "/" DEFAULT_DAEMON_CONFIG_FILE
 
 /* Default session configuration file path */
-#define DEFAULT_SESSION_PATH                    "sessions"
+#define DEFAULT_SESSION_PATH "sessions"
 /* Auto load session in that directory. */
-#define DEFAULT_SESSION_CONFIG_AUTOLOAD         "auto"
-#define DEFAULT_SESSION_HOME_CONFIGPATH         DEFAULT_LTTNG_HOME_RUNDIR "/" \
-       DEFAULT_SESSION_PATH
-#define DEFAULT_SESSION_SYSTEM_CONFIGPATH       DEFAULT_SYSTEM_CONFIGPATH "/" \
-       DEFAULT_SESSION_PATH
-#define DEFAULT_SESSION_CONFIG_FILE_EXTENSION   ".lttng"
-#define DEFAULT_SESSION_CONFIG_XSD_FILENAME     "session.xsd"
-#define DEFAULT_SESSION_CONFIG_XSD_PATH         CONFIG_LTTNG_SYSTEM_DATADIR "/xml/lttng/"
-#define DEFAULT_SESSION_CONFIG_XSD_PATH_ENV     "LTTNG_SESSION_CONFIG_XSD_PATH"
-
-#define DEFAULT_GLOBAL_APPS_UNIX_SOCK \
-       DEFAULT_LTTNG_RUNDIR "/" LTTNG_UST_SOCK_FILENAME
-#define DEFAULT_HOME_APPS_UNIX_SOCK \
-       DEFAULT_LTTNG_HOME_RUNDIR "/" LTTNG_UST_SOCK_FILENAME
-#define DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH \
-       "/" LTTNG_UST_WAIT_FILENAME
-#define DEFAULT_HOME_APPS_WAIT_SHM_PATH \
-       DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH "-%d"
+#define DEFAULT_SESSION_CONFIG_AUTOLOAD              "auto"
+#define DEFAULT_SESSION_HOME_CONFIGPATH              DEFAULT_LTTNG_HOME_RUNDIR "/" DEFAULT_SESSION_PATH
+#define DEFAULT_SESSION_SYSTEM_CONFIGPATH     DEFAULT_SYSTEM_CONFIGPATH "/" DEFAULT_SESSION_PATH
+#define DEFAULT_SESSION_CONFIG_FILE_EXTENSION ".lttng"
+#define DEFAULT_SESSION_CONFIG_XSD_FILENAME   "session.xsd"
+#define DEFAULT_SESSION_CONFIG_XSD_PATH              CONFIG_LTTNG_SYSTEM_DATADIR "/xml/lttng/"
+#define DEFAULT_SESSION_CONFIG_XSD_PATH_ENV   "LTTNG_SESSION_CONFIG_XSD_PATH"
+
+#define DEFAULT_GLOBAL_APPS_UNIX_SOCK    DEFAULT_LTTNG_RUNDIR "/" LTTNG_UST_SOCK_FILENAME
+#define DEFAULT_HOME_APPS_UNIX_SOCK      DEFAULT_LTTNG_HOME_RUNDIR "/" LTTNG_UST_SOCK_FILENAME
+#define DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH "/" LTTNG_UST_WAIT_FILENAME
+#define DEFAULT_HOME_APPS_WAIT_SHM_PATH          DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH "-%d"
 
 /*
  * Value taken from the hard limit allowed by the kernel when using setrlimit
 #define DEFAULT_STREAM_NAME_LEN (LTTNG_SYMBOL_NAME_LEN + 8)
 
 /* Default channel attributes */
-#define DEFAULT_CHANNEL_NAME            "channel0"
+#define DEFAULT_CHANNEL_NAME "channel0"
 /* Default JUL domain channel name. */
-#define DEFAULT_JUL_CHANNEL_NAME        "lttng_jul_channel"
+#define DEFAULT_JUL_CHANNEL_NAME "lttng_jul_channel"
 /* Default JUL tracepoint name. This is a wildcard for the JUL domain. */
-#define DEFAULT_JUL_EVENT_COMPONENT     "lttng_jul"
-#define DEFAULT_JUL_EVENT_NAME          DEFAULT_JUL_EVENT_COMPONENT ":*"
+#define DEFAULT_JUL_EVENT_COMPONENT "lttng_jul"
+#define DEFAULT_JUL_EVENT_NAME     DEFAULT_JUL_EVENT_COMPONENT ":*"
 
 /* Default log4j domain channel name. */
-#define DEFAULT_LOG4J_CHANNEL_NAME        "lttng_log4j_channel"
+#define DEFAULT_LOG4J_CHANNEL_NAME "lttng_log4j_channel"
 /* Default log4j tracepoint name. This is a wildcard for the log4j domain. */
-#define DEFAULT_LOG4J_EVENT_COMPONENT     "lttng_log4j"
-#define DEFAULT_LOG4J_EVENT_NAME          DEFAULT_LOG4J_EVENT_COMPONENT ":*"
+#define DEFAULT_LOG4J_EVENT_COMPONENT "lttng_log4j"
+#define DEFAULT_LOG4J_EVENT_NAME      DEFAULT_LOG4J_EVENT_COMPONENT ":*"
 
 /* Default Python domain channel name. */
-#define DEFAULT_PYTHON_CHANNEL_NAME       "lttng_python_channel"
+#define DEFAULT_PYTHON_CHANNEL_NAME "lttng_python_channel"
 /* Default Python tracepoint name. This is a wildcard for the python domain. */
-#define DEFAULT_PYTHON_EVENT_COMPONENT    "lttng_python"
-#define DEFAULT_PYTHON_EVENT_NAME         DEFAULT_PYTHON_EVENT_COMPONENT ":*"
+#define DEFAULT_PYTHON_EVENT_COMPONENT "lttng_python"
+#define DEFAULT_PYTHON_EVENT_NAME      DEFAULT_PYTHON_EVENT_COMPONENT ":*"
 
 #define DEFAULT_CHANNEL_OVERWRITE      (-1)
-#define DEFAULT_CHANNEL_TRACEFILE_SIZE  CONFIG_DEFAULT_CHANNEL_TRACEFILE_SIZE
+#define DEFAULT_CHANNEL_TRACEFILE_SIZE CONFIG_DEFAULT_CHANNEL_TRACEFILE_SIZE
 #define DEFAULT_CHANNEL_TRACEFILE_COUNT CONFIG_DEFAULT_CHANNEL_TRACEFILE_COUNT
 
-#define _DEFAULT_CHANNEL_SUBBUF_SIZE   CONFIG_DEFAULT_CHANNEL_SUBBUF_SIZE
-#define _DEFAULT_CHANNEL_OUTPUT                        LTTNG_EVENT_MMAP
+#define _DEFAULT_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_CHANNEL_SUBBUF_SIZE
+#define _DEFAULT_CHANNEL_OUTPUT             LTTNG_EVENT_MMAP
 
 /* Metadata channel defaults. */
-#define DEFAULT_METADATA_SUBBUF_SIZE    CONFIG_DEFAULT_METADATA_SUBBUF_SIZE
-#define DEFAULT_METADATA_SUBBUF_NUM     CONFIG_DEFAULT_METADATA_SUBBUF_NUM
-#define DEFAULT_METADATA_CACHE_SIZE     CONFIG_DEFAULT_METADATA_CACHE_SIZE
-#define DEFAULT_METADATA_SWITCH_TIMER  0
-#define DEFAULT_METADATA_READ_TIMER    0
-#define DEFAULT_METADATA_OVERWRITE     0
-#define DEFAULT_METADATA_OUTPUT                LTTNG_EVENT_MMAP
+#define DEFAULT_METADATA_SUBBUF_SIZE  CONFIG_DEFAULT_METADATA_SUBBUF_SIZE
+#define DEFAULT_METADATA_SUBBUF_NUM   CONFIG_DEFAULT_METADATA_SUBBUF_NUM
+#define DEFAULT_METADATA_CACHE_SIZE   CONFIG_DEFAULT_METADATA_CACHE_SIZE
+#define DEFAULT_METADATA_SWITCH_TIMER 0
+#define DEFAULT_METADATA_READ_TIMER   0
+#define DEFAULT_METADATA_OVERWRITE    0
+#define DEFAULT_METADATA_OUTPUT              LTTNG_EVENT_MMAP
 
 /* Kernel has different defaults */
 
 /* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */
-#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE     CONFIG_DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE
+#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE
 /*
  * DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2.
  * Update help manually if override.
  */
-#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM      CONFIG_DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM
+#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM CONFIG_DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM
 /* See lttng-kernel.h enum lttng_kernel_output for channel output */
-#define DEFAULT_KERNEL_CHANNEL_OUTPUT                  LTTNG_EVENT_SPLICE
+#define DEFAULT_KERNEL_CHANNEL_OUTPUT          LTTNG_EVENT_SPLICE
 #define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER    CONFIG_DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER
 #define DEFAULT_KERNEL_CHANNEL_MONITOR_TIMER   CONFIG_DEFAULT_KERNEL_CHANNEL_MONITOR_TIMER
 #define DEFAULT_KERNEL_CHANNEL_READ_TIMER      CONFIG_DEFAULT_KERNEL_CHANNEL_READ_TIMER
 #define DEFAULT_KERNEL_CHANNEL_LIVE_TIMER      CONFIG_DEFAULT_KERNEL_CHANNEL_LIVE_TIMER
-#define DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT        CONFIG_DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT
+#define DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT CONFIG_DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT
 
 /* User space defaults */
 
 /* Must be a power of 2 */
-#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE    CONFIG_DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE
-#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE    CONFIG_DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE CONFIG_DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE
 /* Must be a power of 2. Update help manuall if override. */
-#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM     CONFIG_DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM
-#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM     CONFIG_DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM CONFIG_DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM CONFIG_DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM
 /* See lttng-ust.h enum lttng_ust_output */
-#define DEFAULT_UST_PID_CHANNEL_OUTPUT                 _DEFAULT_CHANNEL_OUTPUT
-#define DEFAULT_UST_UID_CHANNEL_OUTPUT                 _DEFAULT_CHANNEL_OUTPUT
+#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT
+#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT
 /* Timers in usec. */
-#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER   CONFIG_DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER
-#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER   CONFIG_DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER
-#define DEFAULT_UST_PID_CHANNEL_LIVE_TIMER     CONFIG_DEFAULT_UST_PID_CHANNEL_LIVE_TIMER
-#define DEFAULT_UST_UID_CHANNEL_LIVE_TIMER     CONFIG_DEFAULT_UST_UID_CHANNEL_LIVE_TIMER
-#define DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER  CONFIG_DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER
-#define DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER  CONFIG_DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER
+#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER  CONFIG_DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER
+#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER  CONFIG_DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER
+#define DEFAULT_UST_PID_CHANNEL_LIVE_TIMER    CONFIG_DEFAULT_UST_PID_CHANNEL_LIVE_TIMER
+#define DEFAULT_UST_UID_CHANNEL_LIVE_TIMER    CONFIG_DEFAULT_UST_UID_CHANNEL_LIVE_TIMER
+#define DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER CONFIG_DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER
+#define DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER CONFIG_DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER
 
-#define DEFAULT_UST_PID_CHANNEL_READ_TIMER      CONFIG_DEFAULT_UST_PID_CHANNEL_READ_TIMER
-#define DEFAULT_UST_UID_CHANNEL_READ_TIMER      CONFIG_DEFAULT_UST_UID_CHANNEL_READ_TIMER
+#define DEFAULT_UST_PID_CHANNEL_READ_TIMER CONFIG_DEFAULT_UST_PID_CHANNEL_READ_TIMER
+#define DEFAULT_UST_UID_CHANNEL_READ_TIMER CONFIG_DEFAULT_UST_UID_CHANNEL_READ_TIMER
 
-#define DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT       CONFIG_DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT
-#define DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT       CONFIG_DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT
+#define DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT CONFIG_DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT
+#define DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT CONFIG_DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT
 
 /*
  * Default timeout value for the sem_timedwait() call. Blocking forever is not
  * wanted so a timeout is used to control the data flow and not freeze the
  * session daemon.
  */
-#define DEFAULT_SEM_WAIT_TIMEOUT            30    /* in seconds */
+#define DEFAULT_SEM_WAIT_TIMEOUT 30 /* in seconds */
 
 /* Default bind addresses for network services. */
-#define DEFAULT_NETWORK_CONTROL_BIND_ADDRESS    CONFIG_DEFAULT_NETWORK_CONTROL_BIND_ADDRESS
-#define DEFAULT_NETWORK_DATA_BIND_ADDRESS              CONFIG_DEFAULT_NETWORK_DATA_BIND_ADDRESS
-#define DEFAULT_NETWORK_VIEWER_BIND_ADDRESS     CONFIG_DEFAULT_NETWORK_VIEWER_BIND_ADDRESS
-#define DEFAULT_AGENT_BIND_ADDRESS              CONFIG_DEFAULT_AGENT_BIND_ADDRESS
+#define DEFAULT_NETWORK_CONTROL_BIND_ADDRESS CONFIG_DEFAULT_NETWORK_CONTROL_BIND_ADDRESS
+#define DEFAULT_NETWORK_DATA_BIND_ADDRESS    CONFIG_DEFAULT_NETWORK_DATA_BIND_ADDRESS
+#define DEFAULT_NETWORK_VIEWER_BIND_ADDRESS  CONFIG_DEFAULT_NETWORK_VIEWER_BIND_ADDRESS
+#define DEFAULT_AGENT_BIND_ADDRESS          CONFIG_DEFAULT_AGENT_BIND_ADDRESS
 
 /* Default network ports for trace streaming support. */
-#define DEFAULT_NETWORK_CONTROL_PORT        CONFIG_DEFAULT_NETWORK_CONTROL_PORT
-#define DEFAULT_NETWORK_DATA_PORT           CONFIG_DEFAULT_NETWORK_DATA_PORT
-#define DEFAULT_NETWORK_VIEWER_PORT         CONFIG_DEFAULT_NETWORK_VIEWER_PORT
+#define DEFAULT_NETWORK_CONTROL_PORT CONFIG_DEFAULT_NETWORK_CONTROL_PORT
+#define DEFAULT_NETWORK_DATA_PORT    CONFIG_DEFAULT_NETWORK_DATA_PORT
+#define DEFAULT_NETWORK_VIEWER_PORT  CONFIG_DEFAULT_NETWORK_VIEWER_PORT
 
 /* Agent registration TCP port range. */
-#define DEFAULT_AGENT_TCP_PORT_RANGE_BEGIN  CONFIG_DEFAULT_AGENT_TCP_PORT_RANGE_BEGIN
-#define DEFAULT_AGENT_TCP_PORT_RANGE_END    CONFIG_DEFAULT_AGENT_TCP_PORT_RANGE_END
+#define DEFAULT_AGENT_TCP_PORT_RANGE_BEGIN CONFIG_DEFAULT_AGENT_TCP_PORT_RANGE_BEGIN
+#define DEFAULT_AGENT_TCP_PORT_RANGE_END   CONFIG_DEFAULT_AGENT_TCP_PORT_RANGE_END
 
 /* Number of buckets in the event notifier error count map. */
-#define DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE CONFIG_DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE
+#define DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE \
+       CONFIG_DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE
 
 /*
  * If a thread stalls for this amount of time, it will be considered bogus (bad
  * health).
  */
-#define DEFAULT_HEALTH_CHECK_DELTA_S        20
-#define DEFAULT_HEALTH_CHECK_DELTA_NS       0
+#define DEFAULT_HEALTH_CHECK_DELTA_S  20
+#define DEFAULT_HEALTH_CHECK_DELTA_NS 0
 
 /*
  * Wait period before retrying the lttng_data_pending command in the lttng
  * stop command of liblttng-ctl.
  */
-#define DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US 200000  /* usec */
+#define DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US 200000 /* usec */
 
 /*
  * Wait period before retrying the lttng_consumer_flushed_cache when
  * the consumer receives metadata.
  */
-#define DEFAULT_METADATA_AVAILABILITY_WAIT_TIME 200000  /* usec */
+#define DEFAULT_METADATA_AVAILABILITY_WAIT_TIME 200000 /* usec */
 
 /*
  * The usual value for the maximum TCP SYN retries time and TCP FIN timeout is
  * 180 and 60 seconds on most Linux system and the default value since kernel
  * 2.2 thus using the highest value. See tcp(7) for more details.
  */
-#define DEFAULT_INET_TCP_TIMEOUT                       180     /* sec */
+#define DEFAULT_INET_TCP_TIMEOUT 180 /* sec */
 
 /* Maximum payload size for a control connection */
 
-#define DEFAULT_NETWORK_RELAYD_CTRL_MAX_PAYLOAD_SIZE CONFIG_DEFAULT_NETWORK_RELAYD_CTRL_MAX_PAYLOAD_SIZE
+#define DEFAULT_NETWORK_RELAYD_CTRL_MAX_PAYLOAD_SIZE \
+       CONFIG_DEFAULT_NETWORK_RELAYD_CTRL_MAX_PAYLOAD_SIZE
 
 /*
  * Default receiving and sending timeout for an application socket.
  */
-#define DEFAULT_APP_SOCKET_RW_TIMEOUT       CONFIG_DEFAULT_APP_SOCKET_RW_TIMEOUT
-#define DEFAULT_APP_SOCKET_TIMEOUT_ENV      "LTTNG_APP_SOCKET_TIMEOUT"
+#define DEFAULT_APP_SOCKET_RW_TIMEOUT  CONFIG_DEFAULT_APP_SOCKET_RW_TIMEOUT
+#define DEFAULT_APP_SOCKET_TIMEOUT_ENV "LTTNG_APP_SOCKET_TIMEOUT"
 
-#define DEFAULT_UST_STREAM_FD_NUM                      2 /* Number of fd per UST stream. */
+#define DEFAULT_UST_STREAM_FD_NUM 2 /* Number of fd per UST stream. */
 
-#define DEFAULT_SNAPSHOT_NAME                          "snapshot"
-#define DEFAULT_SNAPSHOT_MAX_SIZE                      0 /* Unlimited. */
+#define DEFAULT_SNAPSHOT_NAME    "snapshot"
+#define DEFAULT_SNAPSHOT_MAX_SIZE 0 /* Unlimited. */
 
 /* Suffix of an index file. */
-#define DEFAULT_INDEX_FILE_SUFFIX                      ".idx"
-#define DEFAULT_INDEX_DIR                                      "index"
+#define DEFAULT_INDEX_FILE_SUFFIX ".idx"
+#define DEFAULT_INDEX_DIR        "index"
 
 /* Default lttng command live timer value in usec. */
-#define DEFAULT_LTTNG_LIVE_TIMER                       CONFIG_DEFAULT_LTTNG_LIVE_TIMER
+#define DEFAULT_LTTNG_LIVE_TIMER CONFIG_DEFAULT_LTTNG_LIVE_TIMER
 
 /* Default runas worker name */
-#define DEFAULT_RUN_AS_WORKER_NAME                     "lttng-runas"
+#define DEFAULT_RUN_AS_WORKER_NAME "lttng-runas"
 
 /* Default LTTng MI XML namespace. */
-#define DEFAULT_LTTNG_MI_NAMESPACE             "https://lttng.org/xml/ns/lttng-mi"
+#define DEFAULT_LTTNG_MI_NAMESPACE "https://lttng.org/xml/ns/lttng-mi"
 
 /* Default thread stack size; the default mandated by pthread_create(3) */
-#define DEFAULT_LTTNG_THREAD_STACK_SIZE                2097152
+#define DEFAULT_LTTNG_THREAD_STACK_SIZE 2097152
 
 /* Default maximal size of message notification channel message payloads. */
-#define DEFAULT_MAX_NOTIFICATION_CLIENT_MESSAGE_PAYLOAD_SIZE   65536
+#define DEFAULT_MAX_NOTIFICATION_CLIENT_MESSAGE_PAYLOAD_SIZE 65536
 
 /* Default maximal size of trace archive location. */
-#define DEFAULT_MAX_TRACE_ARCHIVE_LOCATION_PAYLOAD_SIZE                65536
+#define DEFAULT_MAX_TRACE_ARCHIVE_LOCATION_PAYLOAD_SIZE 65536
 
 /* Default maximal size of message notification channel message payloads. */
-#define DEFAULT_CLIENT_MAX_QUEUED_NOTIFICATIONS_COUNT          100
-
+#define DEFAULT_CLIENT_MAX_QUEUED_NOTIFICATIONS_COUNT 100
 
-#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_ENV "LTTNG_RELAYD_TCP_KEEP_ALIVE"
+#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_ENV                  "LTTNG_RELAYD_TCP_KEEP_ALIVE"
 #define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_IDLE_TIME_ENV "LTTNG_RELAYD_TCP_KEEP_ALIVE_IDLE_TIME"
-#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_MAX_PROBE_COUNT_ENV "LTTNG_RELAYD_TCP_KEEP_ALIVE_MAX_PROBE_COUNT"
-#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_PROBE_INTERVAL_ENV "LTTNG_RELAYD_TCP_KEEP_ALIVE_PROBE_INTERVAL"
-#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_ABORT_THRESHOLD_ENV "LTTNG_RELAYD_TCP_KEEP_ALIVE_ABORT_THRESHOLD"
+#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_MAX_PROBE_COUNT_ENV \
+       "LTTNG_RELAYD_TCP_KEEP_ALIVE_MAX_PROBE_COUNT"
+#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_PROBE_INTERVAL_ENV \
+       "LTTNG_RELAYD_TCP_KEEP_ALIVE_PROBE_INTERVAL"
+#define DEFAULT_LTTNG_RELAYD_TCP_KEEP_ALIVE_ABORT_THRESHOLD_ENV \
+       "LTTNG_RELAYD_TCP_KEEP_ALIVE_ABORT_THRESHOLD"
 #define DEFAULT_LTTNG_RELAYD_DISALLOW_CLEAR_ENV "LTTNG_RELAYD_DISALLOW_CLEAR"
 
 #define DEFAULT_LTTNG_RELAYD_WORKING_DIRECTORY_ENV "LTTNG_RELAYD_WORKING_DIRECTORY"
  * Name of the intermediate directory used to rename the trace chunk of a
  * session's first rotation.
  */
-#define DEFAULT_CHUNK_TMP_OLD_DIRECTORY                        ".tmp_old_chunk"
-#define DEFAULT_CHUNK_TMP_NEW_DIRECTORY                        ".tmp_new_chunk"
-#define DEFAULT_ARCHIVED_TRACE_CHUNKS_DIRECTORY                "archives"
-#define DEFAULT_UNLINKED_FILES_DIRECTORY               ".unlinked"
+#define DEFAULT_CHUNK_TMP_OLD_DIRECTORY                ".tmp_old_chunk"
+#define DEFAULT_CHUNK_TMP_NEW_DIRECTORY                ".tmp_new_chunk"
+#define DEFAULT_ARCHIVED_TRACE_CHUNKS_DIRECTORY "archives"
+#define DEFAULT_UNLINKED_FILES_DIRECTORY       ".unlinked"
 
 /*
  * Default timer value in usec for the rotate pending polling check on the
  * relay when a rotation has completed on the consumer.
  */
-#define DEFAULT_ROTATE_PENDING_TIMER   CONFIG_DEFAULT_ROTATE_PENDING_TIMER
+#define DEFAULT_ROTATE_PENDING_TIMER CONFIG_DEFAULT_ROTATE_PENDING_TIMER
 
 /*
  * Returns the default subbuf size.
index 2a1f22943d6a4393b858aa61066d73c1b831035a..a50fac10bf9ba4e655f3480c4198c903a56c3b59 100644 (file)
@@ -29,15 +29,13 @@ struct lttng_dynamic_pointer_array {
  * allocation and can't fail.
  */
 void lttng_dynamic_array_init(struct lttng_dynamic_array *array,
-               size_t element_size,
-               lttng_dynamic_array_element_destructor destructor);
+                             size_t element_size,
+                             lttng_dynamic_array_element_destructor destructor);
 
 /*
  * Returns the number of elements in the dynamic array.
  */
-static inline
-size_t lttng_dynamic_array_get_count(
-               const struct lttng_dynamic_array *array)
+static inline size_t lttng_dynamic_array_get_count(const struct lttng_dynamic_array *array)
 {
        return array->size;
 }
@@ -46,9 +44,8 @@ size_t lttng_dynamic_array_get_count(
  * Returns a pointer to the element. Mutating operations on the array invalidate
  * the returned pointer.
  */
-static inline
-void *lttng_dynamic_array_get_element(const struct lttng_dynamic_array *array,
-               size_t element_index)
+static inline void *lttng_dynamic_array_get_element(const struct lttng_dynamic_array *array,
+                                                   size_t element_index)
 {
        LTTNG_ASSERT(element_index < array->size);
        return array->buffer.data + (element_index * array->element_size);
@@ -69,8 +66,7 @@ void *lttng_dynamic_array_get_element(const struct lttng_dynamic_array *array,
  * NOTE: It is striclty _invalid_ to access memory after _size_, regardless
  *       of prior calls to set_capacity().
  */
-int lttng_dynamic_array_set_count(struct lttng_dynamic_array *array,
-               size_t new_element_count);
+int lttng_dynamic_array_set_count(struct lttng_dynamic_array *array, size_t new_element_count);
 
 /*
  * Add an element to the end of a dynamic array. The array's element count is
@@ -78,16 +74,14 @@ int lttng_dynamic_array_set_count(struct lttng_dynamic_array *array,
  *
  * element is a pointer to the element to add (copy) to the array.
  */
-int lttng_dynamic_array_add_element(struct lttng_dynamic_array *array,
-               const void *element);
+int lttng_dynamic_array_add_element(struct lttng_dynamic_array *array, const void *element);
 
 /*
  * Remove an element from the dynamic array. The array's element count is
  * decreased by one and the following elements are shifted to take its place
  * (when applicable).
  */
-int lttng_dynamic_array_remove_element(struct lttng_dynamic_array *array,
-               size_t element_index);
+int lttng_dynamic_array_remove_element(struct lttng_dynamic_array *array, size_t element_index);
 
 /* Release any memory used by the dynamic array. */
 void lttng_dynamic_array_reset(struct lttng_dynamic_array *array);
@@ -106,16 +100,14 @@ void lttng_dynamic_array_clear(struct lttng_dynamic_array *array);
  * Initialize a resizable array of fixed-size elements. This performs no
  * allocation and can't fail.
  */
-void lttng_dynamic_pointer_array_init(
-               struct lttng_dynamic_pointer_array *array,
-               lttng_dynamic_pointer_array_destructor destructor);
+void lttng_dynamic_pointer_array_init(struct lttng_dynamic_pointer_array *array,
+                                     lttng_dynamic_pointer_array_destructor destructor);
 
 /*
  * Returns the number of pointers in the dynamic pointer array.
  */
-static inline
-size_t lttng_dynamic_pointer_array_get_count(
-               const struct lttng_dynamic_pointer_array *array)
+static inline size_t
+lttng_dynamic_pointer_array_get_count(const struct lttng_dynamic_pointer_array *array)
 {
        return lttng_dynamic_array_get_count(&array->array);
 }
@@ -123,9 +115,9 @@ size_t lttng_dynamic_pointer_array_get_count(
 /*
  * Returns the pointer at index `index`.
  */
-static inline
-void *lttng_dynamic_pointer_array_get_pointer(
-               const struct lttng_dynamic_pointer_array *array, size_t index)
+static inline void *
+lttng_dynamic_pointer_array_get_pointer(const struct lttng_dynamic_pointer_array *array,
+                                       size_t index)
 {
        void **element = (void **) lttng_dynamic_array_get_element(&array->array, index);
 
@@ -137,9 +129,8 @@ void *lttng_dynamic_pointer_array_get_pointer(
  * run the destructor.
  */
 
-static inline
-void *lttng_dynamic_pointer_array_steal_pointer(
-               struct lttng_dynamic_pointer_array *array, size_t index)
+static inline void *
+lttng_dynamic_pointer_array_steal_pointer(struct lttng_dynamic_pointer_array *array, size_t index)
 {
        void **p_element = (void **) lttng_dynamic_array_get_element(&array->array, index);
        void *element = *p_element;
@@ -154,9 +145,8 @@ void *lttng_dynamic_pointer_array_steal_pointer(
  * count is increased by one and its underlying capacity is adjusted
  * automatically.
  */
-static inline
-int lttng_dynamic_pointer_array_add_pointer(
-               struct lttng_dynamic_pointer_array *array, void *pointer)
+static inline int lttng_dynamic_pointer_array_add_pointer(struct lttng_dynamic_pointer_array *array,
+                                                         void *pointer)
 {
        return lttng_dynamic_array_add_element(&array->array, &pointer);
 }
@@ -166,15 +156,13 @@ int lttng_dynamic_pointer_array_add_pointer(
  * count is decreased by one and the following pointers are shifted to
  * take the place of the removed pointer (if applicable).
  */
-int lttng_dynamic_pointer_array_remove_pointer(
-               struct lttng_dynamic_pointer_array *array, size_t index);
+int lttng_dynamic_pointer_array_remove_pointer(struct lttng_dynamic_pointer_array *array,
+                                              size_t index);
 
 /* Release any memory used by the dynamic array. */
-void lttng_dynamic_pointer_array_reset(
-               struct lttng_dynamic_pointer_array *array);
+void lttng_dynamic_pointer_array_reset(struct lttng_dynamic_pointer_array *array);
 
 /* Remove all elements from the dynamic pointer array. */
-void lttng_dynamic_pointer_array_clear(
-               struct lttng_dynamic_pointer_array *array);
+void lttng_dynamic_pointer_array_clear(struct lttng_dynamic_pointer_array *array);
 
 #endif /* LTTNG_DYNAMIC_ARRAY_H */
index 65b15752d5404fec9037e58a0f74f1e329434c5e..228b0c5ea1d29e9852d0b3eaec66865d73bb572a 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef LTTNG_DYNAMIC_BUFFER_H
 #define LTTNG_DYNAMIC_BUFFER_H
 
+#include <common/macros.hpp>
+
 #include <stddef.h>
 #include <stdint.h>
-#include <common/macros.hpp>
 
 struct lttng_buffer_view;
 
@@ -36,8 +37,7 @@ void lttng_dynamic_buffer_init(struct lttng_dynamic_buffer *buffer);
  * (after its current "size"). The dynamic buffer's size is increased by
  * "len", and its capacity is adjusted automatically.
  */
-int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer,
-               const void *buf, size_t len);
+int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer, const void *buf, size_t len);
 
 /*
  * Performs the same action as lttng_dynamic_buffer_append(), but using another
@@ -45,7 +45,7 @@ int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer,
  * of "len".
  */
 int lttng_dynamic_buffer_append_buffer(struct lttng_dynamic_buffer *dst_buffer,
-               const struct lttng_dynamic_buffer *src_buffer);
+                                      const struct lttng_dynamic_buffer *src_buffer);
 
 /*
  * Performs the same action as lttng_dynamic_buffer_append(), but using a
@@ -53,7 +53,7 @@ int lttng_dynamic_buffer_append_buffer(struct lttng_dynamic_buffer *dst_buffer,
  * of "len".
  */
 int lttng_dynamic_buffer_append_view(struct lttng_dynamic_buffer *buffer,
-               const struct lttng_buffer_view *view);
+                                    const struct lttng_buffer_view *view);
 
 /*
  * Set the buffer's size to new_size. The capacity of the buffer will
@@ -71,8 +71,7 @@ int lttng_dynamic_buffer_append_view(struct lttng_dynamic_buffer *buffer,
  * NOTE: It is striclty _invalid_ to access memory after _size_, regardless
  *       of prior calls to set_capacity().
  */
-int lttng_dynamic_buffer_set_size(struct lttng_dynamic_buffer *buffer,
-               size_t new_size);
+int lttng_dynamic_buffer_set_size(struct lttng_dynamic_buffer *buffer, size_t new_size);
 
 /*
  * Set the buffer's capacity to accommodates the new_capacity, allocating memory
@@ -82,14 +81,12 @@ int lttng_dynamic_buffer_set_size(struct lttng_dynamic_buffer *buffer,
  *
  * If the current size > new_capacity, the operation will fail.
  */
-int lttng_dynamic_buffer_set_capacity(struct lttng_dynamic_buffer *buffer,
-               size_t new_capacity);
+int lttng_dynamic_buffer_set_capacity(struct lttng_dynamic_buffer *buffer, size_t new_capacity);
 
 /* Release any memory used by the dynamic buffer. */
 void lttng_dynamic_buffer_reset(struct lttng_dynamic_buffer *buffer);
 
 /* Get the space left in the buffer before a new resize is needed. */
-size_t lttng_dynamic_buffer_get_capacity_left(
-               struct lttng_dynamic_buffer *buffer);
+size_t lttng_dynamic_buffer_get_capacity_left(struct lttng_dynamic_buffer *buffer);
 
 #endif /* LTTNG_DYNAMIC_BUFFER_H */
index 390c4dccc1ada97dbbe8e6b886791366eac0ddc1..885902bb9d19f7be22779f5c58f76f6302f7f2c7 100644 (file)
 #error "lttng-tools error.h needs _GNU_SOURCE"
 #endif
 
-#include <lttng/lttng-error.h>
 #include <common/compat/tid.hpp>
 
+#include <lttng/lttng-error.h>
+
 /* Avoid conflict with Solaris <sys/regset.h> */
 #if defined(ERR) && defined(__sun__)
 #undef ERR
@@ -34,7 +35,7 @@
 
 /* Stringify the expansion of a define */
 #define XSTR(d) STR(d)
-#define STR(s) #s
+#define STR(s) #s
 
 /*
  * Contains the string of the log entry time. This is used as a thread local
@@ -45,7 +46,7 @@ struct log_time {
        /* Format: 00:00:00.000000000 plus NULL byte. */
        char str[19];
 };
-extern LTTNG_EXPORT  DECLARE_URCU_TLS(struct log_time, error_log_time);
+extern LTTNG_EXPORT DECLARE_URCU_TLS(struct log_time, error_log_time);
 extern DECLARE_URCU_TLS(const char *, logger_thread_name);
 
 extern int lttng_opt_quiet;
@@ -54,13 +55,13 @@ extern int lttng_opt_mi;
 
 /* Error type. */
 enum lttng_error_level {
-       PRINT_ERR =     0,
-       PRINT_BUG =     1,
-       PRINT_WARN =    2,
-       PRINT_MSG =     3,
-       PRINT_DBG =     4,
-       PRINT_DBG2 =    5,
-       PRINT_DBG3 =    6,
+       PRINT_ERR = 0,
+       PRINT_BUG = 1,
+       PRINT_WARN = 2,
+       PRINT_MSG = 3,
+       PRINT_DBG = 4,
+       PRINT_DBG2 = 5,
+       PRINT_DBG3 = 6,
 };
 
 static inline bool __lttng_print_check_opt(enum lttng_error_level type)
@@ -135,101 +136,99 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type)
  * want any nested msg to show up when printing mi to stdout(if it's the case).
  * All warnings and errors should be printed to stderr as normal.
  */
-#define __lttng_print(type, fmt, args...)                                              \
-       do {                                                                            \
-               if (__lttng_print_check_opt(type)) {                                    \
-                       fprintf((type) == PRINT_MSG ? stdout : stderr, fmt, ## args);   \
-               }                                                                       \
-               __lttng_print_check_abort(type);                                        \
+#define __lttng_print(type, fmt, args...)                                            \
+       do {                                                                         \
+               if (__lttng_print_check_opt(type)) {                                 \
+                       fprintf((type) == PRINT_MSG ? stdout : stderr, fmt, ##args); \
+               }                                                                    \
+               __lttng_print_check_abort(type);                                     \
        } while (0)
 
 /* Three level of debug. Use -v, -vv or -vvv for the levels */
-#define _ERRMSG(msg, type, fmt, args...)                                \
-       do {                                                            \
-               if (caa_unlikely(__lttng_print_check_opt(type))) {      \
-                       char generic_name[MAX_INT_DEC_LEN(long) +       \
-                                         MAX_INT_DEC_LEN(long)];       \
-                                                                        \
-                       snprintf(generic_name, sizeof(generic_name),    \
-                                       "%ld/%ld", (long) getpid(),     \
-                                       (long) lttng_gettid());         \
-                                                                        \
-                       __lttng_print(type,                             \
-                                       msg " - %s [%s]: " fmt          \
-                                           " (in %s() at " __FILE__    \
-                                           ":" XSTR(__LINE__) ")\n",   \
-                                       log_add_time(),                 \
-                                       URCU_TLS(logger_thread_name) ?: \
-                                                       generic_name,   \
-                                       ##args, __func__);              \
-               }                                                       \
+#define _ERRMSG(msg, type, fmt, args...)                                                  \
+       do {                                                                              \
+               if (caa_unlikely(__lttng_print_check_opt(type))) {                        \
+                       char generic_name[MAX_INT_DEC_LEN(long) + MAX_INT_DEC_LEN(long)]; \
+                                                                                          \
+                       snprintf(generic_name,                                            \
+                                sizeof(generic_name),                                    \
+                                "%ld/%ld",                                               \
+                                (long) getpid(),                                         \
+                                (long) lttng_gettid());                                  \
+                                                                                          \
+                       __lttng_print(type,                                               \
+                                     msg " - %s [%s]: " fmt " (in %s() at " __FILE__     \
+                                         ":" XSTR(__LINE__) ")\n",                       \
+                                     log_add_time(),                                     \
+                                     URCU_TLS(logger_thread_name) ?: generic_name,       \
+                                     ##args,                                             \
+                                     __func__);                                          \
+               }                                                                         \
        } while (0)
 
-#define _ERRMSG_NO_LOC(msg, type, fmt, args...)                          \
-       do {                                                             \
-               if (caa_unlikely(__lttng_print_check_opt(type))) {       \
-                       char generic_name[MAX_INT_DEC_LEN(long) +        \
-                                         MAX_INT_DEC_LEN(long)];        \
-                                                                         \
-                       snprintf(generic_name, sizeof(generic_name),     \
-                                       "%ld/%ld", (long) getpid(),      \
-                                       (long) lttng_gettid());          \
-                                                                         \
-                       __lttng_print(type, msg " - %s [%s]: " fmt "\n", \
-                                       log_add_time(),                  \
-                                       URCU_TLS(logger_thread_name) ?:  \
-                                                       generic_name,    \
-                                       ##args);                         \
-               }                                                        \
+#define _ERRMSG_NO_LOC(msg, type, fmt, args...)                                           \
+       do {                                                                              \
+               if (caa_unlikely(__lttng_print_check_opt(type))) {                        \
+                       char generic_name[MAX_INT_DEC_LEN(long) + MAX_INT_DEC_LEN(long)]; \
+                                                                                          \
+                       snprintf(generic_name,                                            \
+                                sizeof(generic_name),                                    \
+                                "%ld/%ld",                                               \
+                                (long) getpid(),                                         \
+                                (long) lttng_gettid());                                  \
+                                                                                          \
+                       __lttng_print(type,                                               \
+                                     msg " - %s [%s]: " fmt "\n",                        \
+                                     log_add_time(),                                     \
+                                     URCU_TLS(logger_thread_name) ?: generic_name,       \
+                                     ##args);                                            \
+               }                                                                         \
        } while (0)
 
-#define MSG(fmt, args...) \
-       __lttng_print(PRINT_MSG, fmt "\n", ## args)
-#define _MSG(fmt, args...) \
-       __lttng_print(PRINT_MSG, fmt, ## args)
-#define ERR(fmt, args...) \
-       __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args)
-#define WARN(fmt, args...) \
-       __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args)
+#define MSG(fmt, args...)  __lttng_print(PRINT_MSG, fmt "\n", ##args)
+#define _MSG(fmt, args...) __lttng_print(PRINT_MSG, fmt, ##args)
+#define ERR(fmt, args...)  __lttng_print(PRINT_ERR, "Error: " fmt "\n", ##args)
+#define WARN(fmt, args...) __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ##args)
 
-#define BUG(fmt, args...) _ERRMSG("BUG", PRINT_BUG, fmt, ## args)
+#define BUG(fmt, args...) _ERRMSG("BUG", PRINT_BUG, fmt, ##args)
 
-#define DBG(fmt, args...) _ERRMSG("DBG1", PRINT_DBG, fmt, ## args)
-#define DBG_NO_LOC(fmt, args...) _ERRMSG_NO_LOC("DBG1", PRINT_DBG, fmt, ## args)
-#define DBG2(fmt, args...) _ERRMSG("DBG2", PRINT_DBG2, fmt, ## args)
-#define DBG3(fmt, args...) _ERRMSG("DBG3", PRINT_DBG3, fmt, ## args)
-#define LOG(type, fmt, args...)                        \
-       do {                                    \
-               switch (type) {                 \
-               case PRINT_ERR:                 \
-                       ERR(fmt, ## args);      \
-                       break;                  \
-               case PRINT_WARN:                \
-                       WARN(fmt, ## args);     \
-                       break;                  \
-               case PRINT_BUG:                 \
-                       BUG(fmt, ## args);      \
-                       break;                  \
-               case PRINT_MSG:                 \
-                       MSG(fmt, ## args);      \
-                       break;                  \
-               case PRINT_DBG:                 \
-                       DBG(fmt, ## args);      \
-                       break;                  \
-               case PRINT_DBG2:                \
-                       DBG2(fmt, ## args);     \
-                       break;                  \
-               case PRINT_DBG3:                \
-                       DBG3(fmt, ## args);     \
-                       break;                  \
-               default:                        \
-                       abort();                \
-               }                               \
-       } while(0);
+#define DBG(fmt, args...)       _ERRMSG("DBG1", PRINT_DBG, fmt, ##args)
+#define DBG_NO_LOC(fmt, args...) _ERRMSG_NO_LOC("DBG1", PRINT_DBG, fmt, ##args)
+#define DBG2(fmt, args...)      _ERRMSG("DBG2", PRINT_DBG2, fmt, ##args)
+#define DBG3(fmt, args...)      _ERRMSG("DBG3", PRINT_DBG3, fmt, ##args)
+#define LOG(type, fmt, args...)            \
+       do {                               \
+               switch (type) {            \
+               case PRINT_ERR:            \
+                       ERR(fmt, ##args);  \
+                       break;             \
+               case PRINT_WARN:           \
+                       WARN(fmt, ##args); \
+                       break;             \
+               case PRINT_BUG:            \
+                       BUG(fmt, ##args);  \
+                       break;             \
+               case PRINT_MSG:            \
+                       MSG(fmt, ##args);  \
+                       break;             \
+               case PRINT_DBG:            \
+                       DBG(fmt, ##args);  \
+                       break;             \
+               case PRINT_DBG2:           \
+                       DBG2(fmt, ##args); \
+                       break;             \
+               case PRINT_DBG3:           \
+                       DBG3(fmt, ##args); \
+                       break;             \
+               default:                   \
+                       abort();           \
+               }                          \
+       } while (0);
 
-#define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ## args)
+#define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ##args)
 
-#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
+#if !defined(__GLIBC__) || \
+       ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
 
 /*
  * Version using XSI strerror_r.
@@ -244,13 +243,12 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type)
 /*
  * Version using GNU strerror_r, for linux with appropriate defines.
  */
-#define PERROR(call, args...)                                             \
-       do {                                                              \
-               char *_perror_buf;                                        \
-               char _perror_tmp[200];                                    \
-               _perror_buf = strerror_r(                                 \
-                               errno, _perror_tmp, sizeof(_perror_tmp)); \
-               _PERROR(call ": %s", ##args, _perror_buf);                \
+#define PERROR(call, args...)                                                      \
+       do {                                                                       \
+               char *_perror_buf;                                                 \
+               char _perror_tmp[200];                                             \
+               _perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
+               _PERROR(call ": %s", ##args, _perror_buf);                         \
        } while (0);
 #endif
 
index 83c7c885c784e99868ef3e8c9c9f07aaf7554339..e892b0ce89cf4d2c3274f2785226d76bd77e5431 100644 (file)
@@ -160,7 +160,8 @@ static int lttng_event_rule_user_tracepoint_serialize(const struct lttng_event_r
 
                serialized_len = len;
                /* Append exclusion length, includes the null terminator. */
-               ret = lttng_dynamic_buffer_append(&payload->buffer, &serialized_len, sizeof(serialized_len));
+               ret = lttng_dynamic_buffer_append(
+                       &payload->buffer, &serialized_len, sizeof(serialized_len));
                if (ret) {
                        goto end;
                }
index a3b0a83e210a5246b35e949112eef5a315c79f73..e43094bb6e3a0baae83466295b4f41abba1d3047 100644 (file)
@@ -8,12 +8,12 @@
 #ifndef LTTNG_EXCEPTION_H_
 #define LTTNG_EXCEPTION_H_
 
-#include <string>
+#include <lttng/lttng-error.h>
+
 #include <stdexcept>
+#include <string>
 #include <system_error>
 
-#include <lttng/lttng-error.h>
-
 #define LTTNG_THROW_CTL(msg, error_code) \
        throw lttng::ctl::error(msg, error_code, __FILE__, __func__, __LINE__)
 #define LTTNG_THROW_POSIX(msg, errno_code) \
@@ -32,17 +32,17 @@ namespace lttng {
 class runtime_error : public std::runtime_error {
 public:
        explicit runtime_error(const std::string& msg,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                              const char *file_name,
+                              const char *function_name,
+                              unsigned int line_number);
 };
 
 class unsupported_error : public std::runtime_error {
 public:
        explicit unsupported_error(const std::string& msg,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                                  const char *file_name,
+                                  const char *function_name,
+                                  unsigned int line_number);
 };
 
 namespace ctl {
@@ -68,34 +68,34 @@ private:
 class posix_error : public std::system_error {
 public:
        explicit posix_error(const std::string& msg,
-                       int errno_code,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                            int errno_code,
+                            const char *file_name,
+                            const char *function_name,
+                            unsigned int line_number);
 };
 
 class communication_error : public runtime_error {
 public:
        explicit communication_error(const std::string& msg,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                                    const char *file_name,
+                                    const char *function_name,
+                                    unsigned int line_number);
 };
 
 class protocol_error : public communication_error {
 public:
        explicit protocol_error(const std::string& msg,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                               const char *file_name,
+                               const char *function_name,
+                               unsigned int line_number);
 };
 
 class invalid_argument_error : public runtime_error {
 public:
        explicit invalid_argument_error(const std::string& msg,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                                       const char *file_name,
+                                       const char *function_name,
+                                       unsigned int line_number);
 };
 
 }; /* namespace lttng */
index b75fc91c4f83a384fb46fc655836c6f3dd56db0c..06e9b1d1499b306b3bf32c451d7ecdd31651f9a3 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common/compat/directory-handle.hpp>
 #include <common/macros.hpp>
+
 #include <stdint.h>
 #include <sys/types.h>
 
@@ -49,8 +50,7 @@ using fd_close_cb = int (*)(void *, int *);
  * under which unlinked files will be stored for as long as a reference to them
  * is held.
  */
-struct fd_tracker *fd_tracker_create(const char *unlinked_file_path,
-               unsigned int capacity);
+struct fd_tracker *fd_tracker_create(const char *unlinked_file_path, unsigned int capacity);
 
 /* Returns an error if file descriptors are leaked. */
 int fd_tracker_destroy(struct fd_tracker *tracker);
@@ -78,10 +78,10 @@ int fd_tracker_destroy(struct fd_tracker *tracker);
  * open.
  */
 struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker,
-               struct lttng_directory_handle *directory,
-               const char *path,
-               int flags,
-               mode_t *mode);
+                                           struct lttng_directory_handle *directory,
+                                           const char *path,
+                                           int flags,
+                                           mode_t *mode);
 
 /*
  * Open a tracked unsuspendable file descriptor.
@@ -106,11 +106,11 @@ struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker,
  *             accommodates the request for a new unsuspendable entry.
  */
 int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker,
-               int *out_fds,
-               const char **names,
-               unsigned int fd_count,
-               fd_open_cb open,
-               void *data);
+                                    int *out_fds,
+                                    const char **names,
+                                    unsigned int fd_count,
+                                    fd_open_cb open,
+                                    void *data);
 
 /*
  * Close a tracked unsuspendable file descriptor.
@@ -127,11 +127,8 @@ int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker,
  * Closed fds are set to -1 in the fds array which, in the event of an error,
  * allows the user to know which file descriptors are no longer being tracked.
  */
-int fd_tracker_close_unsuspendable_fd(struct fd_tracker *tracker,
-               int *fds,
-               unsigned int fd_count,
-               fd_close_cb close,
-               void *data);
+int fd_tracker_close_unsuspendable_fd(
+       struct fd_tracker *tracker, int *fds, unsigned int fd_count, fd_close_cb close, void *data);
 
 /*
  * Log the contents of the fd_tracker.
index d4cb28239cfc45641d0d6a431e4eab2319254bef..7f4f6fb5974406aadb401706d76faff601ee4bfe 100644 (file)
@@ -9,6 +9,7 @@
 #define FD_TRACKER_INODE_H
 
 #include <common/compat/directory-handle.hpp>
+
 #include <stdbool.h>
 
 struct lttng_inode;
@@ -24,38 +25,34 @@ struct lttng_directory_handle;
  * by the fd-tracker. Users of the fd-tracker should account for this extra
  * file descriptor.
  */
-struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create(
-               const char *path);
+struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create(const char *path);
 
-void lttng_unlinked_file_pool_destroy(
-               struct lttng_unlinked_file_pool *pool);
+void lttng_unlinked_file_pool_destroy(struct lttng_unlinked_file_pool *pool);
 
 /* The inode registry is protected by the fd-tracker's lock. */
 struct lttng_inode_registry *lttng_inode_registry_create(void);
 
-struct lttng_inode *lttng_inode_registry_get_inode(
-               struct lttng_inode_registry *registry,
-               struct lttng_directory_handle *handle,
-               const char *path,
-               int fd,
-               struct lttng_unlinked_file_pool *pool);
+struct lttng_inode *lttng_inode_registry_get_inode(struct lttng_inode_registry *registry,
+                                                  struct lttng_directory_handle *handle,
+                                                  const char *path,
+                                                  int fd,
+                                                  struct lttng_unlinked_file_pool *pool);
 
 void lttng_inode_registry_destroy(struct lttng_inode_registry *registry);
 
 void lttng_inode_borrow_location(struct lttng_inode *inode,
-               const struct lttng_directory_handle **out_directory_handle,
-               const char **out_path);
+                                const struct lttng_directory_handle **out_directory_handle,
+                                const char **out_path);
 
 /* Returns a new reference to the inode's location directory handle. */
-struct lttng_directory_handle *lttng_inode_get_location_directory_handle(
-               struct lttng_inode *inode);
+struct lttng_directory_handle *lttng_inode_get_location_directory_handle(struct lttng_inode *inode);
 
 int lttng_inode_rename(struct lttng_inode *inode,
-               struct lttng_directory_handle *old_directory_handle,
-               const char *old_path,
-               struct lttng_directory_handle *new_directory_handle,
-               const char *new_path,
-               bool overwrite);
+                      struct lttng_directory_handle *old_directory_handle,
+                      const char *old_path,
+                      struct lttng_directory_handle *new_directory_handle,
+                      const char *new_path,
+                      bool overwrite);
 
 int lttng_inode_unlink(struct lttng_inode *inode);
 
index f752564962f6657258e15508adf530735991adfc..0dfdb29f951830591610e2e3518009361971ba80 100644 (file)
@@ -22,27 +22,23 @@ int fd_tracker_util_close_fd(void *, int *fd);
 /*
  * Create a pipe and track its underlying fds.
  */
-int fd_tracker_util_pipe_open_cloexec(
-               struct fd_tracker *tracker, const char *name, int *pipe);
+int fd_tracker_util_pipe_open_cloexec(struct fd_tracker *tracker, const char *name, int *pipe);
 int fd_tracker_util_pipe_close(struct fd_tracker *tracker, int *pipe);
 
 /*
  * Create a poll event and track its underlying fd, if applicable.
  */
 int fd_tracker_util_poll_create(struct fd_tracker *tracker,
-               const char *name,
-               struct lttng_poll_event *events,
-               int size,
-               int flags);
-int fd_tracker_util_poll_clean(
-               struct fd_tracker *tracker, struct lttng_poll_event *events);
+                               const char *name,
+                               struct lttng_poll_event *events,
+                               int size,
+                               int flags);
+int fd_tracker_util_poll_clean(struct fd_tracker *tracker, struct lttng_poll_event *events);
 
-struct lttng_directory_handle *fd_tracker_create_directory_handle(
-               struct fd_tracker *tracker, const char *path);
+struct lttng_directory_handle *fd_tracker_create_directory_handle(struct fd_tracker *tracker,
+                                                                 const char *path);
 
 struct lttng_directory_handle *fd_tracker_create_directory_handle_from_handle(
-               struct fd_tracker *tracker,
-               struct lttng_directory_handle *handle,
-               const char *path);
+       struct fd_tracker *tracker, struct lttng_directory_handle *handle, const char *path);
 
 #endif /* FD_TRACKER_UTILS_H */
index 68686a4adccc89efb7613a3b805e66052cce6c81..c0076eb9cb5e04af5d66c0bffce63b6985ab144a 100644 (file)
@@ -43,6 +43,7 @@ public:
        void write(const void *buffer, std::size_t size);
 
        int fd() const noexcept;
+
 protected:
        void _cleanup() noexcept;
 
index 085d6d03442ea36e42e425f5dcf1c7b0e493551a..ae061fd9390ec7f59001c79a3c4ca07bb1e2430b 100644 (file)
@@ -16,8 +16,7 @@ struct bytecode_symbol_iterator;
  * Create an iterator on a bytecode's symbols. The iterator points to the
  * first element after creation.
  */
-struct bytecode_symbol_iterator *bytecode_symbol_iterator_create(
-               struct lttng_bytecode *bytecode);
+struct bytecode_symbol_iterator *bytecode_symbol_iterator_create(struct lttng_bytecode *bytecode);
 
 /*
  * Advance iterator of one element.
@@ -28,8 +27,7 @@ int bytecode_symbol_iterator_next(struct bytecode_symbol_iterator *it);
 
 int bytecode_symbol_iterator_get_type(struct bytecode_symbol_iterator *it);
 
-const char *bytecode_symbol_iterator_get_name(
-               struct bytecode_symbol_iterator *it);
+const char *bytecode_symbol_iterator_get_name(struct bytecode_symbol_iterator *it);
 
 void bytecode_symbol_iterator_destroy(struct bytecode_symbol_iterator *it);
 
index ecafee229447cd8451c9bc82be2f5d967129c505..51a36326bdbabd88ebd48b91ea435f6913797136 100644 (file)
  * Note: filter-ast.h should be included before filter-parser.h.
  */
 
-#include <urcu/list.h>
-#include <stdio.h>
 #include <stdint.h>
+#include <stdio.h>
+#include <urcu/list.h>
 
-#define printf_debug(fmt, args...)                                     \
-       do {                                                            \
-               if (filter_parser_debug)                                \
-                       fprintf(stdout, "[debug] " fmt, ## args);       \
+#define printf_debug(fmt, args...)                               \
+       do {                                                     \
+               if (filter_parser_debug)                         \
+                       fprintf(stdout, "[debug] " fmt, ##args); \
        } while (0)
 
 // the parameter name (of the reentrant 'yyparse' function)
@@ -117,8 +117,8 @@ struct filter_node {
                } root;
                struct {
                        enum ast_expt_type type;
-                       enum ast_link_type post_op;     /* reverse */
-                       enum ast_link_type pre_op;      /* forward */
+                       enum ast_link_type post_op; /* reverse */
+                       enum ast_link_type pre_op; /* forward */
                        union {
                                const char *string;
                                uint64_t constant;
@@ -169,17 +169,15 @@ struct filter_parser_ctx {
 struct filter_parser_ctx *filter_parser_ctx_alloc(FILE *input);
 void filter_parser_ctx_free(struct filter_parser_ctx *parser_ctx);
 int filter_parser_ctx_append_ast(struct filter_parser_ctx *parser_ctx);
-int filter_parser_ctx_create_from_filter_expression(
-               const char *filter_expression, struct filter_parser_ctx **ctxp);
+int filter_parser_ctx_create_from_filter_expression(const char *filter_expression,
+                                                   struct filter_parser_ctx **ctxp);
 
-static inline
-struct filter_ast *filter_parser_get_ast(struct filter_parser_ctx *parser_ctx)
+static inline struct filter_ast *filter_parser_get_ast(struct filter_parser_ctx *parser_ctx)
 {
        return parser_ctx->ast;
 }
 
-int filter_visitor_print_xml(struct filter_parser_ctx *ctx, FILE *stream,
-                       int indent);
+int filter_visitor_print_xml(struct filter_parser_ctx *ctx, FILE *stream, int indent);
 int filter_visitor_ir_generate(struct filter_parser_ctx *ctx);
 void filter_ir_free(struct filter_parser_ctx *ctx);
 int filter_visitor_bytecode_generate(struct filter_parser_ctx *ctx);
index 958f4e90234aa1ad4100e40b4a4fa9c09863172e..715f78eaa8b8ab8be975687da506cd8999a2262a 100644 (file)
@@ -20,21 +20,20 @@ enum ir_op_signedness {
        IR_SIGN_UNKNOWN = 0,
        IR_SIGNED,
        IR_UNSIGNED,
-       IR_SIGN_DYN,            /* signedness determined dynamically */
+       IR_SIGN_DYN, /* signedness determined dynamically */
 };
 
 enum ir_data_type {
        IR_DATA_UNKNOWN = 0,
        IR_DATA_STRING,
-       IR_DATA_NUMERIC,        /* numeric and boolean */
+       IR_DATA_NUMERIC, /* numeric and boolean */
        IR_DATA_FLOAT,
        IR_DATA_FIELD_REF,
        IR_DATA_GET_CONTEXT_REF,
        IR_DATA_EXPRESSION,
 };
 
-static inline
-const char *ir_data_type_str(enum ir_data_type type)
+static inline const char *ir_data_type_str(enum ir_data_type type)
 {
        switch (type) {
        case IR_DATA_UNKNOWN:
@@ -65,8 +64,7 @@ enum ir_op_type {
        IR_OP_LOGICAL,
 };
 
-static inline
-const char *ir_op_type_str(enum ir_op_type type)
+static inline const char *ir_op_type_str(enum ir_op_type type)
 {
        switch (type) {
        case IR_OP_UNKNOWN:
@@ -117,8 +115,7 @@ enum ir_load_expression_type {
        IR_LOAD_EXPRESSION_LOAD_FIELD,
 };
 
-static inline
-const char *ir_load_expression_type_str(enum ir_load_expression_type type)
+static inline const char *ir_load_expression_type_str(enum ir_load_expression_type type)
 {
        switch (type) {
        case IR_LOAD_EXPRESSION_GET_CONTEXT_ROOT:
index 27aaada54cba315f49aedd12226e220fecc3d21e..acae7aafb66c1c28d56cd85d0a1d58002b504ff9 100644 (file)
  *
  */
 
-#define yy_create_buffer lttng_filter_yy_create_buffer
-#define yy_delete_buffer lttng_filter_yy_delete_buffer
-#define yy_flush_buffer lttng_filter_yy_flush_buffer
-#define yy_scan_buffer lttng_filter_yy_scan_buffer
-#define yy_scan_bytes lttng_filter_yy_scan_bytes
-#define yy_scan_string lttng_filter_yy_scan_string
+#define yy_create_buffer    lttng_filter_yy_create_buffer
+#define yy_delete_buffer    lttng_filter_yy_delete_buffer
+#define yy_flush_buffer            lttng_filter_yy_flush_buffer
+#define yy_scan_buffer     lttng_filter_yy_scan_buffer
+#define yy_scan_bytes      lttng_filter_yy_scan_bytes
+#define yy_scan_string     lttng_filter_yy_scan_string
 #define yy_switch_to_buffer lttng_filter_yy_switch_to_buffer
-#define yyalloc lttng_filter_yyalloc
-#define yyfree lttng_filter_yyfree
-#define yyget_column lttng_filter_yyget_column
-#define yyget_debug lttng_filter_yyget_debug
-#define yyget_extra lttng_filter_yyget_extra
-#define yyget_in lttng_filter_yyget_in
-#define yyget_leng lttng_filter_yyget_leng
-#define yyget_lineno lttng_filter_yyget_lineno
-#define yyget_lval lttng_filter_yyget_lval
-#define yyget_out lttng_filter_yyget_out
-#define yyget_text lttng_filter_yyget_text
-#define yylex_init lttng_filter_yylex_init
-#define yypop_buffer_state lttng_filter_yypop_buffer_state
+#define yyalloc                    lttng_filter_yyalloc
+#define yyfree             lttng_filter_yyfree
+#define yyget_column       lttng_filter_yyget_column
+#define yyget_debug        lttng_filter_yyget_debug
+#define yyget_extra        lttng_filter_yyget_extra
+#define yyget_in           lttng_filter_yyget_in
+#define yyget_leng         lttng_filter_yyget_leng
+#define yyget_lineno       lttng_filter_yyget_lineno
+#define yyget_lval         lttng_filter_yyget_lval
+#define yyget_out          lttng_filter_yyget_out
+#define yyget_text         lttng_filter_yyget_text
+#define yylex_init         lttng_filter_yylex_init
+#define yypop_buffer_state  lttng_filter_yypop_buffer_state
 #define yypush_buffer_state lttng_filter_yypush_buffer_state
-#define yyrealloc lttng_filter_yyrealloc
-#define yyset_column lttng_filter_yyset_column
-#define yyset_debug lttng_filter_yyset_debug
-#define yyset_extra lttng_filter_yyset_extra
-#define yyset_in lttng_filter_yyset_in
-#define yyset_lineno lttng_filter_yyset_lineno
-#define yyset_lval lttng_filter_yyset_lval
-#define yyset_out lttng_filter_yyset_out
+#define yyrealloc          lttng_filter_yyrealloc
+#define yyset_column       lttng_filter_yyset_column
+#define yyset_debug        lttng_filter_yyset_debug
+#define yyset_extra        lttng_filter_yyset_extra
+#define yyset_in           lttng_filter_yyset_in
+#define yyset_lineno       lttng_filter_yyset_lineno
+#define yyset_lval         lttng_filter_yyset_lval
+#define yyset_out          lttng_filter_yyset_out
 
 #endif /* _FILTER_SYMBOLS_H */
index 26b124a9521086b7030b9c6bae13f2a58373a241..4fbdc02fe2bd241eaeb9fae25d92d37a3fc85946 100644 (file)
 #ifdef LTTNG_HAVE_FMEMOPEN
 #include <stdio.h>
 
-static inline
-FILE *lttng_fmemopen(void *buf, size_t size, const char *mode)
+static inline FILE *lttng_fmemopen(void *buf, size_t size, const char *mode)
 {
        return fmemopen(buf, size, mode);
 }
 
 #else /* LTTNG_HAVE_FMEMOPEN */
 
-#include <stdlib.h>
-#include <stdio.h>
 #include <common/error.hpp>
 
+#include <stdio.h>
+#include <stdlib.h>
+
 /*
  * Fallback for systems which don't have fmemopen. Copy buffer to a
  * temporary file, and use that file as FILE * input.
  */
-static inline
-FILE *lttng_fmemopen(void *buf, size_t size, const char *mode)
+static inline FILE *lttng_fmemopen(void *buf, size_t size, const char *mode)
 {
        char tmpname[PATH_MAX];
        size_t len;
index 67509c275bad365ee23c2bd86ec7ab6fe44df5aa..389bc596ad85787c7f00aa7506532f56898551cf 100644 (file)
@@ -9,8 +9,8 @@
 
 #include <common/macros.hpp>
 
-#include <string>
 #include <cxxabi.h>
+#include <string>
 
 DIAGNOSTIC_PUSH
 DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT
index 8b3a882a952c3cb4ea88fe7737978f7d33b1d5de..491db0a1397626b2c058da729375cf7766006d16 100644 (file)
@@ -9,6 +9,7 @@
 #define FS_HANDLE_H
 
 #include <common/macros.hpp>
+
 #include <stdio.h>
 
 struct fs_handle;
index 5f22c0e820b26a46ef97eb7ec0460e80d2f8a46f..5fd1cbe2b97e3a39ea0e761ba459ca74e03eaf3b 100644 (file)
  *
  */
 
-#define _cds_lfht_new lttng__cds_lfht_new
-#define cds_lfht_add lttng_cds_lfht_add
-#define cds_lfht_add_replace lttng_cds_lfht_add_replace
-#define cds_lfht_add_unique lttng_cds_lfht_add_unique
-#define cds_lfht_count_nodes lttng_cds_lfht_count_nodes
-#define cds_lfht_del lttng_cds_lfht_del
-#define cds_lfht_destroy lttng_cds_lfht_destroy
-#define cds_lfht_first lttng_cds_lfht_first
-#define cds_lfht_fls_ulong lttng_cds_lfht_fls_ulong
-#define cds_lfht_get_count_order_u32 lttng_cds_lfht_get_count_order_u32
+#define _cds_lfht_new                 lttng__cds_lfht_new
+#define cds_lfht_add                  lttng_cds_lfht_add
+#define cds_lfht_add_replace          lttng_cds_lfht_add_replace
+#define cds_lfht_add_unique           lttng_cds_lfht_add_unique
+#define cds_lfht_count_nodes          lttng_cds_lfht_count_nodes
+#define cds_lfht_del                  lttng_cds_lfht_del
+#define cds_lfht_destroy              lttng_cds_lfht_destroy
+#define cds_lfht_first                lttng_cds_lfht_first
+#define cds_lfht_fls_ulong            lttng_cds_lfht_fls_ulong
+#define cds_lfht_get_count_order_u32   lttng_cds_lfht_get_count_order_u32
 #define cds_lfht_get_count_order_ulong lttng_cds_lfht_get_count_order_ulong
-#define cds_lfht_is_node_deleted lttng_cds_lfht_is_node_deleted
-#define cds_lfht_lookup lttng_cds_lfht_lookup
-#define cds_lfht_next lttng_cds_lfht_next
-#define cds_lfht_next_duplicate lttng_cds_lfht_next_duplicate
-#define cds_lfht_replace lttng_cds_lfht_replace
-#define cds_lfht_resize lttng_cds_lfht_resize
+#define cds_lfht_is_node_deleted       lttng_cds_lfht_is_node_deleted
+#define cds_lfht_lookup                       lttng_cds_lfht_lookup
+#define cds_lfht_next                 lttng_cds_lfht_next
+#define cds_lfht_next_duplicate               lttng_cds_lfht_next_duplicate
+#define cds_lfht_replace              lttng_cds_lfht_replace
+#define cds_lfht_resize                       lttng_cds_lfht_resize
 
 #endif /* _HASHTABLE_SYMBOLS_H */
index 1feab4d39d1328d8e3de0021c4b920d35b0bade9..ac1af7eed6669824dd981b7f84e91d8984ae2918 100644 (file)
@@ -8,12 +8,13 @@
 #ifndef _LTT_HT_H
 #define _LTT_HT_H
 
-#include <urcu.h>
-#include <stdint.h>
-#include <memory>
-
 #include <common/macros.hpp>
+
 #include <lttng/lttng-export.h>
+
+#include <memory>
+#include <stdint.h>
+#include <urcu.h>
 #include <urcu/rculfhash.h>
 
 LTTNG_EXPORT extern unsigned long lttng_ht_seed;
@@ -74,60 +75,47 @@ struct lttng_ht_node_two_u64 {
 struct lttng_ht *lttng_ht_new(unsigned long size, enum lttng_ht_type type);
 void lttng_ht_destroy(struct lttng_ht *ht);
 struct lttng_ht_deleter {
-       void operator()(lttng_ht *ht) { lttng_ht_destroy(ht); };
+       void operator()(lttng_ht *ht)
+       {
+               lttng_ht_destroy(ht);
+       };
 };
 
 /* Specialized node init and free functions */
 void lttng_ht_node_init_str(struct lttng_ht_node_str *node, char *key);
-void lttng_ht_node_init_ulong(struct lttng_ht_node_ulong *node,
-               unsigned long key);
-void lttng_ht_node_init_u64(struct lttng_ht_node_u64 *node,
-               uint64_t key);
-void lttng_ht_node_init_two_u64(struct lttng_ht_node_two_u64 *node,
-               uint64_t key1, uint64_t key2);
+void lttng_ht_node_init_ulong(struct lttng_ht_node_ulong *node, unsigned long key);
+void lttng_ht_node_init_u64(struct lttng_ht_node_u64 *node, uint64_t key);
+void lttng_ht_node_init_two_u64(struct lttng_ht_node_two_u64 *node, uint64_t key1, uint64_t key2);
 void lttng_ht_node_free_str(struct lttng_ht_node_str *node);
 void lttng_ht_node_free_ulong(struct lttng_ht_node_ulong *node);
 void lttng_ht_node_free_u64(struct lttng_ht_node_u64 *node);
 void lttng_ht_node_free_two_u64(struct lttng_ht_node_two_u64 *node);
 
-void lttng_ht_lookup(struct lttng_ht *ht, const void *key,
-               struct lttng_ht_iter *iter);
+void lttng_ht_lookup(struct lttng_ht *ht, const void *key, struct lttng_ht_iter *iter);
 
 /* Specialized add unique functions */
-void lttng_ht_add_unique_str(struct lttng_ht *ht,
-               struct lttng_ht_node_str *node);
-void lttng_ht_add_unique_ulong(struct lttng_ht *ht,
-               struct lttng_ht_node_ulong *node);
-void lttng_ht_add_unique_u64(struct lttng_ht *ht,
-               struct lttng_ht_node_u64 *node);
-void lttng_ht_add_unique_two_u64(struct lttng_ht *ht,
-               struct lttng_ht_node_two_u64 *node);
-struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong(
-               struct lttng_ht *ht, struct lttng_ht_node_ulong *node);
-struct lttng_ht_node_u64 *lttng_ht_add_replace_u64(
-               struct lttng_ht *ht, struct lttng_ht_node_u64 *node);
-void lttng_ht_add_str(struct lttng_ht *ht,
-               struct lttng_ht_node_str *node);
-void lttng_ht_add_ulong(struct lttng_ht *ht,
-               struct lttng_ht_node_ulong *node);
-void lttng_ht_add_u64(struct lttng_ht *ht,
-               struct lttng_ht_node_u64 *node);
+void lttng_ht_add_unique_str(struct lttng_ht *ht, struct lttng_ht_node_str *node);
+void lttng_ht_add_unique_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *node);
+void lttng_ht_add_unique_u64(struct lttng_ht *ht, struct lttng_ht_node_u64 *node);
+void lttng_ht_add_unique_two_u64(struct lttng_ht *ht, struct lttng_ht_node_two_u64 *node);
+struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong(struct lttng_ht *ht,
+                                                      struct lttng_ht_node_ulong *node);
+struct lttng_ht_node_u64 *lttng_ht_add_replace_u64(struct lttng_ht *ht,
+                                                  struct lttng_ht_node_u64 *node);
+void lttng_ht_add_str(struct lttng_ht *ht, struct lttng_ht_node_str *node);
+void lttng_ht_add_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *node);
+void lttng_ht_add_u64(struct lttng_ht *ht, struct lttng_ht_node_u64 *node);
 
 int lttng_ht_del(struct lttng_ht *ht, struct lttng_ht_iter *iter);
 
-void lttng_ht_get_first(struct lttng_ht *ht,
-               struct lttng_ht_iter *iter);
+void lttng_ht_get_first(struct lttng_ht *ht, struct lttng_ht_iter *iter);
 void lttng_ht_get_next(struct lttng_ht *ht, struct lttng_ht_iter *iter);
 
 unsigned long lttng_ht_get_count(struct lttng_ht *ht);
 
-struct lttng_ht_node_str *lttng_ht_iter_get_node_str(
-               struct lttng_ht_iter *iter);
-struct lttng_ht_node_ulong *lttng_ht_iter_get_node_ulong(
-               struct lttng_ht_iter *iter);
-struct lttng_ht_node_u64 *lttng_ht_iter_get_node_u64(
-               struct lttng_ht_iter *iter);
-struct lttng_ht_node_two_u64 *lttng_ht_iter_get_node_two_u64(
-               struct lttng_ht_iter *iter);
+struct lttng_ht_node_str *lttng_ht_iter_get_node_str(struct lttng_ht_iter *iter);
+struct lttng_ht_node_ulong *lttng_ht_iter_get_node_ulong(struct lttng_ht_iter *iter);
+struct lttng_ht_node_u64 *lttng_ht_iter_get_node_u64(struct lttng_ht_iter *iter);
+struct lttng_ht_node_two_u64 *lttng_ht_iter_get_node_two_u64(struct lttng_ht_iter *iter);
 
 #endif /* _LTT_HT_H */
index ee7c2ec758dd5dd707780b9a42ae5d3c0d4fab6c..2fa34041263d50f8d971ff15c7bcc43e3020a185 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef _COMMON_INDEX_ALLOCATOR_H
 #define _COMMON_INDEX_ALLOCATOR_H
 
-#include <inttypes.h>
 #include <lttng/lttng-export.h>
 
+#include <inttypes.h>
+
 struct lttng_index_allocator;
 
 enum lttng_index_allocator_status {
@@ -22,37 +23,31 @@ enum lttng_index_allocator_status {
 /*
  * Create an index allocator of `index_count` slots.
  */
-extern "C" LTTNG_EXPORT
-struct lttng_index_allocator *lttng_index_allocator_create(
-               uint64_t index_count);
+extern "C" LTTNG_EXPORT struct lttng_index_allocator *
+lttng_index_allocator_create(uint64_t index_count);
 
 /*
  * Get the number of indexes currently in use.
  */
-extern "C" LTTNG_EXPORT
-uint64_t lttng_index_allocator_get_index_count(
-       struct lttng_index_allocator *allocator);
+extern "C" LTTNG_EXPORT uint64_t
+lttng_index_allocator_get_index_count(struct lttng_index_allocator *allocator);
 
 /*
  * Allocate (i.e. reserve) a slot.
  */
-extern "C" LTTNG_EXPORT
-enum lttng_index_allocator_status lttng_index_allocator_alloc(
-               struct lttng_index_allocator *allocator,
-               uint64_t *index);
+extern "C" LTTNG_EXPORT enum lttng_index_allocator_status
+lttng_index_allocator_alloc(struct lttng_index_allocator *allocator, uint64_t *index);
 
 /*
  * Release a slot by index. The slot will be re-used by the index allocator
  * in future 'alloc' calls.
  */
-extern "C" LTTNG_EXPORT
-enum lttng_index_allocator_status lttng_index_allocator_release(
-               struct lttng_index_allocator *allocator, uint64_t index);
+extern "C" LTTNG_EXPORT enum lttng_index_allocator_status
+lttng_index_allocator_release(struct lttng_index_allocator *allocator, uint64_t index);
 
 /*
  * Destroy an index allocator.
  */
-extern "C" LTTNG_EXPORT
-void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator);
+extern "C" LTTNG_EXPORT void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator);
 
 #endif /* _COMMON_INDEX_ALLOCATOR_H */
index 2b9bc54282f12a7127429a12c7fe46895d5627e6..1d7839122aae4d7941c5e96d70d9c04ebdbec4ff 100644 (file)
@@ -13,9 +13,9 @@
 #include <common/compat/endian.hpp>
 #include <common/macros.hpp>
 
-#include <stdint.h>
 #include <limits.h>
 #include <stddef.h>
+#include <stdint.h>
 
 #define CTF_INDEX_MAGIC 0xC1F1DCC1
 #define CTF_INDEX_MAJOR 1
@@ -38,16 +38,16 @@ struct ctf_packet_index_file_hdr {
  * All integer fields are stored in big endian.
  */
 struct ctf_packet_index {
-       uint64_t offset;                /* offset of the packet in the file, in bytes */
-       uint64_t packet_size;           /* packet size, in bits */
-       uint64_t content_size;          /* content size, in bits */
+       uint64_t offset; /* offset of the packet in the file, in bytes */
+       uint64_t packet_size; /* packet size, in bits */
+       uint64_t content_size; /* content size, in bits */
        uint64_t timestamp_begin;
        uint64_t timestamp_end;
        uint64_t events_discarded;
-       uint64_t stream_id;             /* ID of the channel */
+       uint64_t stream_id; /* ID of the channel */
        /* CTF_INDEX 1.0 limit */
-       uint64_t stream_instance_id;    /* ID of the channel instance */
-       uint64_t packet_seq_num;        /* packet sequence number */
+       uint64_t stream_instance_id; /* ID of the channel instance */
+       uint64_t packet_seq_num; /* packet sequence number */
 } __attribute__((__packed__));
 
 static inline size_t ctf_packet_index_len(uint32_t major, uint32_t minor)
@@ -55,13 +55,11 @@ static inline size_t ctf_packet_index_len(uint32_t major, uint32_t minor)
        if (major == 1) {
                switch (minor) {
                case 0:
-                       return offsetof(struct ctf_packet_index, stream_id)
-                               + member_sizeof(struct ctf_packet_index,
-                                               stream_id);
+                       return offsetof(struct ctf_packet_index, stream_id) +
+                               member_sizeof(struct ctf_packet_index, stream_id);
                case 1:
-                       return offsetof(struct ctf_packet_index, packet_seq_num)
-                               + member_sizeof(struct ctf_packet_index,
-                                               packet_seq_num);
+                       return offsetof(struct ctf_packet_index, packet_seq_num) +
+                               member_sizeof(struct ctf_packet_index, packet_seq_num);
                default:
                        abort();
                }
@@ -70,7 +68,7 @@ static inline size_t ctf_packet_index_len(uint32_t major, uint32_t minor)
 }
 
 static inline uint32_t lttng_to_index_major(uint32_t lttng_major,
-               uint32_t lttng_minor __attribute__((unused)))
+                                           uint32_t lttng_minor __attribute__((unused)))
 {
        if (lttng_major == 2) {
                return 1;
@@ -78,8 +76,7 @@ static inline uint32_t lttng_to_index_major(uint32_t lttng_major,
        abort();
 }
 
-static inline uint32_t lttng_to_index_minor(uint32_t lttng_major,
-               uint32_t lttng_minor)
+static inline uint32_t lttng_to_index_minor(uint32_t lttng_major, uint32_t lttng_minor)
 {
        if (lttng_major == 2) {
                if (lttng_minor < 8) {
@@ -91,16 +88,15 @@ static inline uint32_t lttng_to_index_minor(uint32_t lttng_major,
        abort();
 }
 
-static inline void ctf_packet_index_file_hdr_init(
-               struct ctf_packet_index_file_hdr *hdr,
-               uint32_t idx_major, uint32_t idx_minor)
+static inline void ctf_packet_index_file_hdr_init(struct ctf_packet_index_file_hdr *hdr,
+                                                 uint32_t idx_major,
+                                                 uint32_t idx_minor)
 {
        memset(hdr, 0, sizeof(*hdr));
        hdr->magic = htobe32(CTF_INDEX_MAGIC);
        hdr->index_major = htobe32(idx_major);
        hdr->index_minor = htobe32(idx_minor);
-       hdr->packet_index_len = htobe32(
-                       ctf_packet_index_len(idx_major, idx_minor));
+       hdr->packet_index_len = htobe32(ctf_packet_index_len(idx_major, idx_minor));
 }
 
 #endif /* LTTNG_INDEX_H */
index 00d8203d3db606e2b78b313fa5a9b677fe63bb68..8a6d4b3a0777021353634b0959b4df2970421eff 100644 (file)
 #ifndef _INDEX_H
 #define _INDEX_H
 
-#include <inttypes.h>
-#include <urcu/ref.h>
-
 #include "ctf-index.hpp"
+
 #include <common/fs-handle.hpp>
 #include <common/trace-chunk.hpp>
 
+#include <inttypes.h>
+#include <urcu/ref.h>
+
 struct lttng_index_file {
        struct fs_handle *file;
        uint32_t major;
@@ -30,24 +31,32 @@ struct lttng_index_file {
  * create and open have refcount of 1. Use put to decrement the
  * refcount. Destroys when reaching 0. Use "get" to increment refcount.
  */
-enum lttng_trace_chunk_status lttng_index_file_create_from_trace_chunk(
-               struct lttng_trace_chunk *chunk,
-               const char *channel_path, const char *stream_name,
-               uint64_t stream_file_size, uint64_t stream_count,
-               uint32_t index_major, uint32_t index_minor,
-               bool unlink_existing_file, struct lttng_index_file **file);
-
-enum lttng_trace_chunk_status lttng_index_file_create_from_trace_chunk_read_only(
-               struct lttng_trace_chunk *chunk,
-               const char *channel_path, const char *stream_name,
-               uint64_t stream_file_size, uint64_t stream_file_index,
-               uint32_t index_major, uint32_t index_minor,
-               bool expect_no_file, struct lttng_index_file **file);
+enum lttng_trace_chunk_status
+lttng_index_file_create_from_trace_chunk(struct lttng_trace_chunk *chunk,
+                                        const char *channel_path,
+                                        const char *stream_name,
+                                        uint64_t stream_file_size,
+                                        uint64_t stream_count,
+                                        uint32_t index_major,
+                                        uint32_t index_minor,
+                                        bool unlink_existing_file,
+                                        struct lttng_index_file **file);
+
+enum lttng_trace_chunk_status
+lttng_index_file_create_from_trace_chunk_read_only(struct lttng_trace_chunk *chunk,
+                                                  const char *channel_path,
+                                                  const char *stream_name,
+                                                  uint64_t stream_file_size,
+                                                  uint64_t stream_file_index,
+                                                  uint32_t index_major,
+                                                  uint32_t index_minor,
+                                                  bool expect_no_file,
+                                                  struct lttng_index_file **file);
 
 int lttng_index_file_write(const struct lttng_index_file *index_file,
-               const struct ctf_packet_index *element);
+                          const struct ctf_packet_index *element);
 int lttng_index_file_read(const struct lttng_index_file *index_file,
-               struct ctf_packet_index *element);
+                         struct ctf_packet_index *element);
 
 void lttng_index_file_get(struct lttng_index_file *index_file);
 void lttng_index_file_put(struct lttng_index_file *index_file);
index d1712489a33c9216de928db650c14667519a3ce4..3e6c85187551d3e6334366c781fadc0e2470e636 100644 (file)
@@ -41,8 +41,10 @@ using config_entry_handler_cb = int (*)(const struct config_entry *, void *);
  * Returns 0 on success. Negative values are error codes. If the return value
  * is positive, it represents the line number on which a parsing error occurred.
  */
-int config_get_section_entries(const char *path, const char *section,
-               config_entry_handler_cb handler, void *user_data);
+int config_get_section_entries(const char *path,
+                              const char *section,
+                              config_entry_handler_cb handler,
+                              void *user_data);
 
 /*
  * Parse a configuration value.
index 7070cfaee6eb4b07c1e46ed18637f5caac1393f9..14e0140b3d25ecef12dabe19022282984bd051b5 100644 (file)
 #ifndef _LTTNG_KCONSUMER_H
 #define _LTTNG_KCONSUMER_H
 
-#include <stdbool.h>
 #include <common/consumer/consumer.hpp>
 
+#include <stdbool.h>
+
 int lttng_kconsumer_take_snapshot(struct lttng_consumer_stream *stream);
-int lttng_kconsumer_sample_snapshot_positions(
-               struct lttng_consumer_stream *stream);
-int lttng_kconsumer_get_produced_snapshot(struct lttng_consumer_stream *stream,
-               unsigned long *pos);
-int lttng_kconsumer_get_consumed_snapshot(struct lttng_consumer_stream *stream,
-               unsigned long *pos);
+int lttng_kconsumer_sample_snapshot_positions(struct lttng_consumer_stream *stream);
+int lttng_kconsumer_get_produced_snapshot(struct lttng_consumer_stream *stream, unsigned long *pos);
+int lttng_kconsumer_get_consumed_snapshot(struct lttng_consumer_stream *stream, unsigned long *pos);
 int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
-               int sock, struct pollfd *consumer_sockpoll);
+                            int sock,
+                            struct pollfd *consumer_sockpoll);
 int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
 int lttng_kconsumer_data_pending(struct lttng_consumer_stream *stream);
-enum sync_metadata_status lttng_kconsumer_sync_metadata(
-               struct lttng_consumer_stream *metadata);
+enum sync_metadata_status lttng_kconsumer_sync_metadata(struct lttng_consumer_stream *metadata);
 
 #endif /* _LTTNG_KCONSUMER_H */
index 4f47488b56b0e131152cf4e2ccb7e03d09b400e9..f3cfe38ce886a49af924037fcc7321a4c9eeac46 100644 (file)
@@ -9,12 +9,13 @@
 #ifndef _LTTNG_KERNEL_CTL_H
 #define _LTTNG_KERNEL_CTL_H
 
-#include <stdbool.h>
+#include <common/lttng-kernel-old.hpp>
+#include <common/lttng-kernel.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp> /* for struct lttng_filter_bytecode */
 
 #include <lttng/lttng.h>
-#include <common/lttng-kernel.hpp>
-#include <common/lttng-kernel-old.hpp>
-#include <common/sessiond-comm/sessiond-comm.hpp>      /* for struct lttng_filter_bytecode */
+
+#include <stdbool.h>
 
 int kernctl_create_session(int fd);
 int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops);
@@ -32,15 +33,14 @@ int kernctl_create_event_notifier_group(int fd);
 
 /* Apply on event notifier_group file descriptor. */
 int kernctl_create_event_notifier_group_notification_fd(int fd);
-int kernctl_create_event_notifier_group_error_counter(int fd,
-               const struct lttng_kernel_abi_counter_conf *error_counter_conf);
+int kernctl_create_event_notifier_group_error_counter(
+       int fd, const struct lttng_kernel_abi_counter_conf *error_counter_conf);
 int kernctl_create_event_notifier(int fd,
-               const struct lttng_kernel_abi_event_notifier *event_notifier);
+                                 const struct lttng_kernel_abi_event_notifier *event_notifier);
 
 int kernctl_counter_get_aggregate_value(int counter_fd,
-               struct lttng_kernel_abi_counter_aggregate *value);
-int kernctl_counter_clear(int counter_fd,
-               struct lttng_kernel_abi_counter_clear *clear);
+                                       struct lttng_kernel_abi_counter_aggregate *value);
+int kernctl_counter_clear(int counter_fd, struct lttng_kernel_abi_counter_clear *clear);
 
 /* Apply on event file descriptor. */
 int kernctl_filter(int fd, const struct lttng_bytecode *filter);
@@ -65,8 +65,7 @@ int kernctl_wait_quiescent(int fd);
  * It returns 0 if OK, -1 on error. In all cases (error and OK),
  * @syscall_mask should be freed by the caller with free(3).
  */
-int kernctl_syscall_mask(int fd, char **syscall_mask,
-               uint32_t *nr_bits);
+int kernctl_syscall_mask(int fd, char **syscall_mask, uint32_t *nr_bits);
 
 /* Process ID tracking can be applied to session file descriptor. */
 int kernctl_track_pid(int fd, int pid);
index 68bcc472c009439adc1d76e2207e69ccba2fa5a3..45b01821a997c38989d4bf8990ee9f29f168705a 100644 (file)
 #ifndef _LTT_KERNEL_IOCTL_H
 #define _LTT_KERNEL_IOCTL_H
 
-#define LTTNG_KERNEL_ABI_MAJOR_VERSION         2
-#define LTTNG_KERNEL_ABI_MINOR_VERSION         6
+#define LTTNG_KERNEL_ABI_MAJOR_VERSION 2
+#define LTTNG_KERNEL_ABI_MINOR_VERSION 6
 
 /* Get a snapshot of the current ring buffer producer and consumer positions */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT                _IO(0xF6, 0x00)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00)
 /* Get the consumer position (iteration start) */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED   _IOR(0xF6, 0x01, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long)
 /* Get the producer position (iteration end) */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED   _IOR(0xF6, 0x02, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long)
 /* Get exclusive read access to the specified sub-buffer position */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF              _IOW(0xF6, 0x03, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long)
 /* Release exclusive sub-buffer access */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF              _IO(0xF6, 0x04)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04)
 
 /* Get exclusive read access to the next sub-buffer that can be read. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF         _IO(0xF6, 0x05)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05)
 /* Release exclusive sub-buffer access, move consumer forward. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF         _IO(0xF6, 0x06)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06)
 /* returns the size of the current sub-buffer, without padding (for mmap). */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE         _IOR(0xF6, 0x07, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long)
 /* returns the size of the current sub-buffer, with padding (for splice). */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PADDED_SUBBUF_SIZE  _IOR(0xF6, 0x08, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long)
 /* returns the maximum size for sub-buffers. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE     _IOR(0xF6, 0x09, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long)
 /* returns the length to mmap. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_LEN            _IOR(0xF6, 0x0A, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long)
 /* returns the offset of the subbuffer belonging to the mmap reader. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET    _IOR(0xF6, 0x0B, unsigned long)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long)
 /* Flush the current sub-buffer, if non-empty. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH                   _IO(0xF6, 0x0C)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH _IO(0xF6, 0x0C)
 /* Get the current version of the metadata cache (after a get_next). */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION    _IOR(0xF6, 0x0D, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION _IOR(0xF6, 0x0D, uint64_t)
 /*
  * Get a snapshot of the current ring buffer producer and consumer positions,
  * regardless of whether or not the two positions are contained within the same
  * sub-buffer.
  */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E)
 /* Flush the current sub-buffer, even if empty. */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY                       _IO(0xF6, 0x0F)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY _IO(0xF6, 0x0F)
 /*
  * Reset the position of what has been consumed from the metadata cache to 0
  * so it can be read again.
  */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP               _IO(0xF6, 0x10)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10)
 /* Clear ring buffer content */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_CLEAR                               _IO(0xF6, 0x11)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_CLEAR                         _IO(0xF6, 0x11)
 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK _IOR(0xF6, 0x12, uint32_t)
 
 /* returns the timestamp begin of the current sub-buffer */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN     _IOR(0xF6, 0x20, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
 /* returns the timestamp end of the current sub-buffer */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END       _IOR(0xF6, 0x21, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
 /* returns the number of events discarded */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED    _IOR(0xF6, 0x22, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
 /* returns the packet payload size */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE        _IOR(0xF6, 0x23, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
 /* returns the actual packet size */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE         _IOR(0xF6, 0x24, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
 /* returns the stream id */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID           _IOR(0xF6, 0x25, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
 /* returns the current timestamp */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP   _IOR(0xF6, 0x26, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
 /* returns the packet sequence number */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM             _IOR(0xF6, 0x27, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
 /* returns the stream instance id */
-#define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID             _IOR(0xF6, 0x28, uint64_t)
+#define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
 
 /* Old ABI (without support for 32/64 bits compat) */
 /* LTTng file descriptor ioctl */
-#define LTTNG_KERNEL_ABI_OLD_SESSION                _IO(0xF6, 0x40)
-#define LTTNG_KERNEL_ABI_OLD_TRACER_VERSION         \
-               _IOR(0xF6, 0x41, struct lttng_kernel_abi_old_tracer_version)
-#define LTTNG_KERNEL_ABI_OLD_TRACEPOINT_LIST        _IO(0xF6, 0x42)
-#define LTTNG_KERNEL_ABI_OLD_WAIT_QUIESCENT         _IO(0xF6, 0x43)
+#define LTTNG_KERNEL_ABI_OLD_SESSION _IO(0xF6, 0x40)
+#define LTTNG_KERNEL_ABI_OLD_TRACER_VERSION \
+       _IOR(0xF6, 0x41, struct lttng_kernel_abi_old_tracer_version)
+#define LTTNG_KERNEL_ABI_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42)
+#define LTTNG_KERNEL_ABI_OLD_WAIT_QUIESCENT  _IO(0xF6, 0x43)
 
 /* Session FD ioctl */
-#define LTTNG_KERNEL_ABI_OLD_METADATA               \
-               _IOW(0xF6, 0x50, struct lttng_kernel_abi_old_channel)
-#define LTTNG_KERNEL_ABI_OLD_CHANNEL                \
-               _IOW(0xF6, 0x51, struct lttng_kernel_abi_old_channel)
-#define LTTNG_KERNEL_ABI_OLD_SESSION_START          _IO(0xF6, 0x52)
-#define LTTNG_KERNEL_ABI_OLD_SESSION_STOP           _IO(0xF6, 0x53)
+#define LTTNG_KERNEL_ABI_OLD_METADATA     _IOW(0xF6, 0x50, struct lttng_kernel_abi_old_channel)
+#define LTTNG_KERNEL_ABI_OLD_CHANNEL      _IOW(0xF6, 0x51, struct lttng_kernel_abi_old_channel)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_START _IO(0xF6, 0x52)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_STOP  _IO(0xF6, 0x53)
 
 /* Channel FD ioctl */
-#define LTTNG_KERNEL_ABI_OLD_STREAM                 _IO(0xF6, 0x60)
-#define LTTNG_KERNEL_ABI_OLD_EVENT                  \
-               _IOW(0xF6, 0x61, struct lttng_kernel_abi_old_event)
+#define LTTNG_KERNEL_ABI_OLD_STREAM _IO(0xF6, 0x60)
+#define LTTNG_KERNEL_ABI_OLD_EVENT  _IOW(0xF6, 0x61, struct lttng_kernel_abi_old_event)
 
 /* Event and Channel FD ioctl */
-#define LTTNG_KERNEL_ABI_OLD_CONTEXT                \
-               _IOW(0xF6, 0x70, struct lttng_kernel_abi_old_context)
+#define LTTNG_KERNEL_ABI_OLD_CONTEXT _IOW(0xF6, 0x70, struct lttng_kernel_abi_old_context)
 
 /* Event, Channel and Session ioctl */
-#define LTTNG_KERNEL_ABI_OLD_ENABLE                 _IO(0xF6, 0x80)
-#define LTTNG_KERNEL_ABI_OLD_DISABLE                _IO(0xF6, 0x81)
-
+#define LTTNG_KERNEL_ABI_OLD_ENABLE  _IO(0xF6, 0x80)
+#define LTTNG_KERNEL_ABI_OLD_DISABLE _IO(0xF6, 0x81)
 
 /* Current ABI (with suport for 32/64 bits compat) */
 /* LTTng file descriptor ioctl */
-#define LTTNG_KERNEL_ABI_SESSION               _IO(0xF6, 0x45)
-#define LTTNG_KERNEL_ABI_TRACER_VERSION                \
-       _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version)
-#define LTTNG_KERNEL_ABI_TRACEPOINT_LIST       _IO(0xF6, 0x47)
-#define LTTNG_KERNEL_ABI_WAIT_QUIESCENT                _IO(0xF6, 0x48)
-#define LTTNG_KERNEL_ABI_SYSCALL_LIST          _IO(0xF6, 0x4A)
-#define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION            \
+#define LTTNG_KERNEL_ABI_SESSION        _IO(0xF6, 0x45)
+#define LTTNG_KERNEL_ABI_TRACER_VERSION         _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version)
+#define LTTNG_KERNEL_ABI_TRACEPOINT_LIST _IO(0xF6, 0x47)
+#define LTTNG_KERNEL_ABI_WAIT_QUIESCENT         _IO(0xF6, 0x48)
+#define LTTNG_KERNEL_ABI_SYSCALL_LIST   _IO(0xF6, 0x4A)
+#define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION \
        _IOR(0xF6, 0x4B, struct lttng_kernel_abi_tracer_abi_version)
-#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE \
-       _IO(0xF6, 0x4C)
+#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C)
 
 /* Session FD ioctl */
-#define LTTNG_KERNEL_ABI_METADATA                      \
-       _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel)
-#define LTTNG_KERNEL_ABI_CHANNEL                       \
-       _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel)
-#define LTTNG_KERNEL_ABI_SESSION_START         _IO(0xF6, 0x56)
-#define LTTNG_KERNEL_ABI_SESSION_STOP          _IO(0xF6, 0x57)
-#define LTTNG_KERNEL_ABI_SESSION_TRACK_PID             \
-       _IOW(0xF6, 0x58, int32_t)
-#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID   \
-       _IOW(0xF6, 0x59, int32_t)
+#define LTTNG_KERNEL_ABI_METADATA           _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel)
+#define LTTNG_KERNEL_ABI_CHANNEL            _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel)
+#define LTTNG_KERNEL_ABI_SESSION_START      _IO(0xF6, 0x56)
+#define LTTNG_KERNEL_ABI_SESSION_STOP       _IO(0xF6, 0x57)
+#define LTTNG_KERNEL_ABI_SESSION_TRACK_PID   _IOW(0xF6, 0x58, int32_t)
+#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID _IOW(0xF6, 0x59, int32_t)
 /*
  * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO
  * are generating two different ioctl numbers, but this was not done on
  * purpose. We should generally try to avoid those duplications.
  */
-#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS  _IO(0xF6, 0x58)
-#define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN            _IO(0xF6, 0x59)
+#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
+#define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN           _IO(0xF6, 0x59)
 /* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */
-#define LTTNG_KERNEL_ABI_SESSION_STATEDUMP         _IO(0xF6, 0x5C)
-#define LTTNG_KERNEL_ABI_SESSION_SET_NAME              \
-       _IOW(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
-#define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME             \
+#define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C)
+#define LTTNG_KERNEL_ABI_SESSION_SET_NAME  _IOW(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
+#define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \
        _IOW(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
 
 /* Channel FD ioctl */
-#define LTTNG_KERNEL_ABI_STREAM                        _IO(0xF6, 0x62)
-#define LTTNG_KERNEL_ABI_EVENT                 \
-       _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
-#define LTTNG_KERNEL_ABI_SYSCALL_MASK          \
-       _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
+#define LTTNG_KERNEL_ABI_STREAM              _IO(0xF6, 0x62)
+#define LTTNG_KERNEL_ABI_EVENT       _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
+#define LTTNG_KERNEL_ABI_SYSCALL_MASK _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
 
 /* Event and Channel FD ioctl */
-#define LTTNG_KERNEL_ABI_CONTEXT                       \
-       _IOW(0xF6, 0x71, struct lttng_kernel_abi_context)
+#define LTTNG_KERNEL_ABI_CONTEXT _IOW(0xF6, 0x71, struct lttng_kernel_abi_context)
 
 /* Event, event notifier, Channel and Session ioctl */
-#define LTTNG_KERNEL_ABI_ENABLE                        _IO(0xF6, 0x82)
-#define LTTNG_KERNEL_ABI_DISABLE               _IO(0xF6, 0x83)
+#define LTTNG_KERNEL_ABI_ENABLE         _IO(0xF6, 0x82)
+#define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83)
 
 /* Event notifier group ioctl */
-#define LTTNG_KERNEL_ABI_COUNTER                       \
-       _IOW(0xF6, 0x84, struct lttng_kernel_abi_counter_conf)
+#define LTTNG_KERNEL_ABI_COUNTER _IOW(0xF6, 0x84, struct lttng_kernel_abi_counter_conf)
 
 /* Event and event notifier FD ioctl */
-#define LTTNG_KERNEL_ABI_FILTER                        _IO(0xF6, 0x90)
-#define LTTNG_KERNEL_ABI_ADD_CALLSITE          _IO(0xF6, 0x91)
+#define LTTNG_KERNEL_ABI_FILTER              _IO(0xF6, 0x90)
+#define LTTNG_KERNEL_ABI_ADD_CALLSITE _IO(0xF6, 0x91)
 
 /* Session FD ioctl (continued) */
-#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS      \
+#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \
        _IOW(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
-#define LTTNG_KERNEL_ABI_SESSION_TRACK_ID              \
-       _IOW(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
-#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID            \
-       _IOW(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
+#define LTTNG_KERNEL_ABI_SESSION_TRACK_ID   _IOW(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
+#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID _IOW(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
 
 /* Event notifier group file descriptor ioctl */
-#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE                 \
+#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \
        _IOW(0xF6, 0xB0, struct lttng_kernel_abi_event_notifier)
-#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD  \
-       _IO(0xF6, 0xB1)
+#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD _IO(0xF6, 0xB1)
 
 /* Event notifier file descriptor ioctl */
-#define LTTNG_KERNEL_ABI_CAPTURE               _IO(0xF6, 0xB8)
+#define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8)
 
 /* Counter file descriptor ioctl */
-#define LTTNG_KERNEL_ABI_COUNTER_READ          \
-       IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read)
-#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE             \
+#define LTTNG_KERNEL_ABI_COUNTER_READ IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read)
+#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
        _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_counter_aggregate)
-#define LTTNG_KERNEL_ABI_COUNTER_CLEAR         \
-       _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear)
+#define LTTNG_KERNEL_ABI_COUNTER_CLEAR _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear)
 
 /*
-  * Those ioctl numbers use the wrong direction, but are kept for ABI backward
-  * compatibility.
-  */
- #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME        \
-     _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
- #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME    \
-     _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
- #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID        \
-     _IOW(0xF6, 0x58, int32_t)
- #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID    \
-     _IOW(0xF6, 0x59, int32_t)
- #define LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS    \
-     _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
- #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID        \
-     _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
- #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID        \
-     _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
+ * Those ioctl numbers use the wrong direction, but are kept for ABI backward
+ * compatibility.
+ */
+#define LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME \
+       _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID  _IOW(0xF6, 0x58, int32_t)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID _IOW(0xF6, 0x59, int32_t)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS \
+       _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID \
+       _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
 
 #endif /* _LTT_KERNEL_IOCTL_H */
index e0ff3f2806ea0a187eff3e8df3af17bb0223b23b..6ccfad70deb35f9955e5f62d84c1120b6c24a4d1 100644 (file)
@@ -46,7 +46,7 @@ public:
                return _value;
        }
 
-        WrappedType* operator->() const
+       WrappedType *operator->() const
        {
                return &_value;
        }
index 41dd496053bcbc0ac98853d952f536325c059e0d..98c388f56608846f67d606cb99cb9e9b61431a70 100644 (file)
 
 #include <lttng/lttng-export.h>
 
-extern "C" LTTNG_EXPORT
-int lttng_elf_get_symbol_offset(int fd, char *symbol, uint64_t *offset);
+extern "C" LTTNG_EXPORT int lttng_elf_get_symbol_offset(int fd, char *symbol, uint64_t *offset);
 
-extern "C" LTTNG_EXPORT
-int lttng_elf_get_sdt_probe_offsets(int fd, const char *provider_name,
-               const char *probe_name, uint64_t **offsets, uint32_t *nb_probe);
+extern "C" LTTNG_EXPORT int lttng_elf_get_sdt_probe_offsets(int fd,
+                                                           const char *provider_name,
+                                                           const char *probe_name,
+                                                           uint64_t **offsets,
+                                                           uint32_t *nb_probe);
 
-#endif /* _LTTNG_ELF_H */
+#endif /* _LTTNG_ELF_H */
index 4e13cb4a7c9c4576d1cc01f89a4599f2c6342297..f746c3475cbc768cc423fd574c1709e83548ec65 100644 (file)
@@ -9,9 +9,10 @@
 #ifndef _LTTNG_KERNEL_OLD_H
 #define _LTTNG_KERNEL_OLD_H
 
-#include <stdint.h>
 #include <common/lttng-kernel.hpp>
 
+#include <stdint.h>
+
 /*
  * LTTng DebugFS ABI structures.
  *
@@ -26,8 +27,8 @@ struct lttng_kernel_abi_old_perf_counter_ctx {
 };
 
 /* Event/Channel context */
-#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1  16
-#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING2  ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
+#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1 16
+#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
 struct lttng_kernel_abi_old_context {
        enum lttng_kernel_abi_context_type ctx;
        char padding[LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1];
@@ -60,8 +61,8 @@ struct lttng_kernel_abi_old_function {
        char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
 };
 
-#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING1    16
-#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING2    ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
+#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING1 16
+#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
 struct lttng_kernel_abi_old_event {
        char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
        enum lttng_kernel_abi_instrumentation instrumentation;
@@ -87,12 +88,12 @@ struct lttng_kernel_abi_old_tracer_version {
  */
 #define LTTNG_KERNEL_ABI_OLD_CHANNEL_PADDING1 ((LTTNG_SYMBOL_NAME_LEN + 32))
 struct lttng_kernel_abi_old_channel {
-       int overwrite;                      /* 1: overwrite, 0: discard */
-       uint64_t subbuf_size;               /* bytes */
-       uint64_t num_subbuf;                /* power of 2 */
+       int overwrite; /* 1: overwrite, 0: discard */
+       uint64_t subbuf_size; /* bytes */
+       uint64_t num_subbuf; /* power of 2 */
        unsigned int switch_timer_interval; /* usec */
-       unsigned int read_timer_interval;   /* usec */
-       enum lttng_event_output output;     /* splice, mmap */
+       unsigned int read_timer_interval; /* usec */
+       enum lttng_event_output output; /* splice, mmap */
 
        char padding[LTTNG_KERNEL_ABI_OLD_CHANNEL_PADDING1];
 };
index 2de7ef81067cdbbb3a3e61820a815b56ed1cf15f..ad8d03acfc38f4f92fbbd9cabd2cf0dbe77bfa9b 100644 (file)
@@ -9,16 +9,18 @@
 #ifndef _LTTNG_KERNEL_H
 #define _LTTNG_KERNEL_H
 
-#include <stdint.h>
 #include <common/compiler.hpp>
 #include <common/macros.hpp>
+
 #include <lttng/constant.h>
 #include <lttng/event.h>
 
-#define LTTNG_KERNEL_ABI_SYM_NAME_LEN  256
-#define LTTNG_KERNEL_ABI_MAX_UPROBE_NUM  32
-#define LTTNG_KERNEL_ABI_SESSION_NAME_LEN      256
-#define LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN     26
+#include <stdint.h>
+
+#define LTTNG_KERNEL_ABI_SYM_NAME_LEN                     256
+#define LTTNG_KERNEL_ABI_MAX_UPROBE_NUM                           32
+#define LTTNG_KERNEL_ABI_SESSION_NAME_LEN                 256
+#define LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN 26
 
 /*
  * LTTng DebugFS ABI structures.
  */
 
 enum lttng_kernel_abi_instrumentation {
-       LTTNG_KERNEL_ABI_ALL           = -1,   /* Used within lttng-tools */
-       LTTNG_KERNEL_ABI_TRACEPOINT    = 0,
-       LTTNG_KERNEL_ABI_KPROBE        = 1,
-       LTTNG_KERNEL_ABI_FUNCTION      = 2,
-       LTTNG_KERNEL_ABI_KRETPROBE     = 3,
-       LTTNG_KERNEL_ABI_NOOP          = 4,    /* not hooked */
-       LTTNG_KERNEL_ABI_SYSCALL       = 5,
-       LTTNG_KERNEL_ABI_UPROBE        = 6,
+       LTTNG_KERNEL_ABI_ALL = -1, /* Used within lttng-tools */
+       LTTNG_KERNEL_ABI_TRACEPOINT = 0,
+       LTTNG_KERNEL_ABI_KPROBE = 1,
+       LTTNG_KERNEL_ABI_FUNCTION = 2,
+       LTTNG_KERNEL_ABI_KRETPROBE = 3,
+       LTTNG_KERNEL_ABI_NOOP = 4, /* not hooked */
+       LTTNG_KERNEL_ABI_SYSCALL = 5,
+       LTTNG_KERNEL_ABI_UPROBE = 6,
 };
 
 enum lttng_kernel_abi_context_type {
-       LTTNG_KERNEL_ABI_CONTEXT_PID            = 0,
+       LTTNG_KERNEL_ABI_CONTEXT_PID = 0,
        LTTNG_KERNEL_ABI_CONTEXT_PERF_CPU_COUNTER = 1,
-       LTTNG_KERNEL_ABI_CONTEXT_PROCNAME       = 2,
-       LTTNG_KERNEL_ABI_CONTEXT_PRIO           = 3,
-       LTTNG_KERNEL_ABI_CONTEXT_NICE           = 4,
-       LTTNG_KERNEL_ABI_CONTEXT_VPID           = 5,
-       LTTNG_KERNEL_ABI_CONTEXT_TID            = 6,
-       LTTNG_KERNEL_ABI_CONTEXT_VTID           = 7,
-       LTTNG_KERNEL_ABI_CONTEXT_PPID           = 8,
-       LTTNG_KERNEL_ABI_CONTEXT_VPPID          = 9,
-       LTTNG_KERNEL_ABI_CONTEXT_HOSTNAME       = 10,
-       LTTNG_KERNEL_ABI_CONTEXT_CPU_ID         = 11,
-       LTTNG_KERNEL_ABI_CONTEXT_INTERRUPTIBLE  = 12,
-       LTTNG_KERNEL_ABI_CONTEXT_PREEMPTIBLE    = 13,
+       LTTNG_KERNEL_ABI_CONTEXT_PROCNAME = 2,
+       LTTNG_KERNEL_ABI_CONTEXT_PRIO = 3,
+       LTTNG_KERNEL_ABI_CONTEXT_NICE = 4,
+       LTTNG_KERNEL_ABI_CONTEXT_VPID = 5,
+       LTTNG_KERNEL_ABI_CONTEXT_TID = 6,
+       LTTNG_KERNEL_ABI_CONTEXT_VTID = 7,
+       LTTNG_KERNEL_ABI_CONTEXT_PPID = 8,
+       LTTNG_KERNEL_ABI_CONTEXT_VPPID = 9,
+       LTTNG_KERNEL_ABI_CONTEXT_HOSTNAME = 10,
+       LTTNG_KERNEL_ABI_CONTEXT_CPU_ID = 11,
+       LTTNG_KERNEL_ABI_CONTEXT_INTERRUPTIBLE = 12,
+       LTTNG_KERNEL_ABI_CONTEXT_PREEMPTIBLE = 13,
        LTTNG_KERNEL_ABI_CONTEXT_NEED_RESCHEDULE = 14,
-       LTTNG_KERNEL_ABI_CONTEXT_MIGRATABLE     = 15,
+       LTTNG_KERNEL_ABI_CONTEXT_MIGRATABLE = 15,
        LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_KERNEL = 16,
-       LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER   = 17,
-       LTTNG_KERNEL_ABI_CONTEXT_CGROUP_NS      = 18,
-       LTTNG_KERNEL_ABI_CONTEXT_IPC_NS         = 19,
-       LTTNG_KERNEL_ABI_CONTEXT_MNT_NS         = 20,
-       LTTNG_KERNEL_ABI_CONTEXT_NET_NS         = 21,
-       LTTNG_KERNEL_ABI_CONTEXT_PID_NS         = 22,
-       LTTNG_KERNEL_ABI_CONTEXT_USER_NS        = 23,
-       LTTNG_KERNEL_ABI_CONTEXT_UTS_NS         = 24,
-       LTTNG_KERNEL_ABI_CONTEXT_UID            = 25,
-       LTTNG_KERNEL_ABI_CONTEXT_EUID           = 26,
-       LTTNG_KERNEL_ABI_CONTEXT_SUID           = 27,
-       LTTNG_KERNEL_ABI_CONTEXT_GID            = 28,
-       LTTNG_KERNEL_ABI_CONTEXT_EGID           = 29,
-       LTTNG_KERNEL_ABI_CONTEXT_SGID           = 30,
-       LTTNG_KERNEL_ABI_CONTEXT_VUID           = 31,
-       LTTNG_KERNEL_ABI_CONTEXT_VEUID          = 32,
-       LTTNG_KERNEL_ABI_CONTEXT_VSUID          = 33,
-       LTTNG_KERNEL_ABI_CONTEXT_VGID           = 34,
-       LTTNG_KERNEL_ABI_CONTEXT_VEGID          = 35,
-       LTTNG_KERNEL_ABI_CONTEXT_VSGID          = 36,
-       LTTNG_KERNEL_ABI_CONTEXT_TIME_NS        = 37,
+       LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER = 17,
+       LTTNG_KERNEL_ABI_CONTEXT_CGROUP_NS = 18,
+       LTTNG_KERNEL_ABI_CONTEXT_IPC_NS = 19,
+       LTTNG_KERNEL_ABI_CONTEXT_MNT_NS = 20,
+       LTTNG_KERNEL_ABI_CONTEXT_NET_NS = 21,
+       LTTNG_KERNEL_ABI_CONTEXT_PID_NS = 22,
+       LTTNG_KERNEL_ABI_CONTEXT_USER_NS = 23,
+       LTTNG_KERNEL_ABI_CONTEXT_UTS_NS = 24,
+       LTTNG_KERNEL_ABI_CONTEXT_UID = 25,
+       LTTNG_KERNEL_ABI_CONTEXT_EUID = 26,
+       LTTNG_KERNEL_ABI_CONTEXT_SUID = 27,
+       LTTNG_KERNEL_ABI_CONTEXT_GID = 28,
+       LTTNG_KERNEL_ABI_CONTEXT_EGID = 29,
+       LTTNG_KERNEL_ABI_CONTEXT_SGID = 30,
+       LTTNG_KERNEL_ABI_CONTEXT_VUID = 31,
+       LTTNG_KERNEL_ABI_CONTEXT_VEUID = 32,
+       LTTNG_KERNEL_ABI_CONTEXT_VSUID = 33,
+       LTTNG_KERNEL_ABI_CONTEXT_VGID = 34,
+       LTTNG_KERNEL_ABI_CONTEXT_VEGID = 35,
+       LTTNG_KERNEL_ABI_CONTEXT_VSGID = 36,
+       LTTNG_KERNEL_ABI_CONTEXT_TIME_NS = 37,
 };
 
 /* Perf counter attributes */
@@ -86,8 +88,8 @@ struct lttng_kernel_abi_perf_counter_ctx {
 } LTTNG_PACKED;
 
 /* Event/Channel context */
-#define LTTNG_KERNEL_ABI_CONTEXT_PADDING1  16
-#define LTTNG_KERNEL_ABI_CONTEXT_PADDING2  ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
+#define LTTNG_KERNEL_ABI_CONTEXT_PADDING1 16
+#define LTTNG_KERNEL_ABI_CONTEXT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
 struct lttng_kernel_abi_context {
        enum lttng_kernel_abi_context_type ctx;
        char padding[LTTNG_KERNEL_ABI_CONTEXT_PADDING1];
@@ -130,28 +132,28 @@ struct lttng_kernel_abi_event_callsite {
 } LTTNG_PACKED;
 
 enum lttng_kernel_abi_syscall_entryexit {
-       LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT      = 0,
-       LTTNG_KERNEL_ABI_SYSCALL_ENTRY  = 1,
-       LTTNG_KERNEL_ABI_SYSCALL_EXIT   = 2,
+       LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT = 0,
+       LTTNG_KERNEL_ABI_SYSCALL_ENTRY = 1,
+       LTTNG_KERNEL_ABI_SYSCALL_EXIT = 2,
 };
 
 enum lttng_kernel_abi_syscall_abi {
-       LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL        = 0,
+       LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL = 0,
        LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE = 1,
        LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT = 2,
 };
 
 enum lttng_kernel_abi_syscall_match {
        LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME = 0,
-       LTTNG_KERNEL_ABI_SYSCALL_MATCH_NR       = 1,
+       LTTNG_KERNEL_ABI_SYSCALL_MATCH_NR = 1,
 };
 
 struct lttng_kernel_abi_syscall {
-       uint8_t entryexit;      /* enum lttng_kernel_abi_syscall_entryexit */
-       uint8_t abi;            /* enum lttng_kernel_abi_syscall_abi */
-       uint8_t match;          /* enum lttng_kernel_abi_syscall_match */
+       uint8_t entryexit; /* enum lttng_kernel_abi_syscall_entryexit */
+       uint8_t abi; /* enum lttng_kernel_abi_syscall_abi */
+       uint8_t match; /* enum lttng_kernel_abi_syscall_match */
        uint8_t padding;
-       uint32_t nr;            /* For LTTNG_SYSCALL_MATCH_NR */
+       uint32_t nr; /* For LTTNG_SYSCALL_MATCH_NR */
 } LTTNG_PACKED;
 
 /* Function tracer */
@@ -159,8 +161,8 @@ struct lttng_kernel_abi_function {
        char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
 } LTTNG_PACKED;
 
-#define LTTNG_KERNEL_ABI_EVENT_PADDING1    8
-#define LTTNG_KERNEL_ABI_EVENT_PADDING2    ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
+#define LTTNG_KERNEL_ABI_EVENT_PADDING1 8
+#define LTTNG_KERNEL_ABI_EVENT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
 struct lttng_kernel_abi_event {
        char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
        enum lttng_kernel_abi_instrumentation instrumentation;
@@ -178,7 +180,7 @@ struct lttng_kernel_abi_event {
        } u;
 } LTTNG_PACKED;
 
-#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING        32
+#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING 32
 struct lttng_kernel_abi_event_notifier {
        struct lttng_kernel_abi_event event;
        uint64_t error_counter_idx;
@@ -186,7 +188,7 @@ struct lttng_kernel_abi_event_notifier {
        char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING];
 } LTTNG_PACKED;
 
-#define LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX      4
+#define LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX 4
 
 enum lttng_kernel_abi_counter_arithmetic {
        LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR = 0,
@@ -205,10 +207,10 @@ struct lttng_kernel_abi_counter_dimension {
        uint8_t has_overflow;
 } LTTNG_PACKED;
 
-#define LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1      67
+#define LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1 67
 struct lttng_kernel_abi_counter_conf {
-       uint32_t arithmetic;    /* enum lttng_kernel_abi_counter_arithmetic */
-       uint32_t bitness;       /* enum lttng_kernel_abi_counter_bitness */
+       uint32_t arithmetic; /* enum lttng_kernel_abi_counter_arithmetic */
+       uint32_t bitness; /* enum lttng_kernel_abi_counter_bitness */
        uint32_t number_dimensions;
        int64_t global_sum_step;
        struct lttng_kernel_abi_counter_dimension dimensions[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX];
@@ -230,15 +232,15 @@ struct lttng_kernel_abi_counter_value {
 #define LTTNG_KERNEL_ABI_COUNTER_READ_PADDING 32
 struct lttng_kernel_abi_counter_read {
        struct lttng_kernel_abi_counter_index index;
-       int32_t cpu;    /* -1 for global counter, >= 0 for specific cpu. */
-       struct lttng_kernel_abi_counter_value value;    /* output */
+       int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */
+       struct lttng_kernel_abi_counter_value value; /* output */
        char padding[LTTNG_KERNEL_ABI_COUNTER_READ_PADDING];
 } LTTNG_PACKED;
 
 #define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING 32
 struct lttng_kernel_abi_counter_aggregate {
        struct lttng_kernel_abi_counter_index index;
-       struct lttng_kernel_abi_counter_value value;    /* output */
+       struct lttng_kernel_abi_counter_value value; /* output */
        char padding[LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING];
 } LTTNG_PACKED;
 
@@ -255,7 +257,7 @@ struct lttng_kernel_abi_event_notifier_notification {
        char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING];
 } LTTNG_PACKED;
 
-#define LTTNG_KERNEL_ABI_CAPTURE_BYTECODE_MAX_LEN              65536
+#define LTTNG_KERNEL_ABI_CAPTURE_BYTECODE_MAX_LEN 65536
 struct lttng_kernel_abi_capture_bytecode {
        uint32_t len;
        uint32_t reloc_offset;
@@ -275,7 +277,7 @@ struct lttng_kernel_abi_tracer_abi_version {
 } LTTNG_PACKED;
 
 struct lttng_kernel_abi_syscall_mask {
-       uint32_t len;   /* in bits */
+       uint32_t len; /* in bits */
        char mask[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH];
 } LTTNG_PACKED;
 
@@ -284,17 +286,17 @@ struct lttng_kernel_abi_syscall_mask {
  */
 #define LTTNG_KERNEL_ABI_CHANNEL_PADDING1 ((LTTNG_SYMBOL_NAME_LEN + 32))
 struct lttng_kernel_abi_channel {
-       uint64_t subbuf_size;               /* bytes */
-       uint64_t num_subbuf;                /* power of 2 */
+       uint64_t subbuf_size; /* bytes */
+       uint64_t num_subbuf; /* power of 2 */
        unsigned int switch_timer_interval; /* usec */
-       unsigned int read_timer_interval;   /* usec */
-       enum lttng_event_output output;     /* splice, mmap */
+       unsigned int read_timer_interval; /* usec */
+       enum lttng_event_output output; /* splice, mmap */
 
-       int overwrite;                      /* 1: overwrite, 0: discard */
+       int overwrite; /* 1: overwrite, 0: discard */
        char padding[LTTNG_KERNEL_ABI_CHANNEL_PADDING1];
 } LTTNG_PACKED;
 
-#define KERNEL_FILTER_BYTECODE_MAX_LEN         65536
+#define KERNEL_FILTER_BYTECODE_MAX_LEN 65536
 struct lttng_kernel_abi_filter_bytecode {
        uint32_t len;
        uint32_t reloc_offset;
@@ -317,14 +319,14 @@ struct lttng_kernel_abi_session_creation_time {
 } LTTNG_PACKED;
 
 enum lttng_kernel_abi_tracker_type {
-       LTTNG_KERNEL_ABI_TRACKER_UNKNOWN                = -1,
-
-       LTTNG_KERNEL_ABI_TRACKER_PID            = 0,
-       LTTNG_KERNEL_ABI_TRACKER_VPID           = 1,
-       LTTNG_KERNEL_ABI_TRACKER_UID            = 2,
-       LTTNG_KERNEL_ABI_TRACKER_VUID           = 3,
-       LTTNG_KERNEL_ABI_TRACKER_GID            = 4,
-       LTTNG_KERNEL_ABI_TRACKER_VGID           = 5,
+       LTTNG_KERNEL_ABI_TRACKER_UNKNOWN = -1,
+
+       LTTNG_KERNEL_ABI_TRACKER_PID = 0,
+       LTTNG_KERNEL_ABI_TRACKER_VPID = 1,
+       LTTNG_KERNEL_ABI_TRACKER_UID = 2,
+       LTTNG_KERNEL_ABI_TRACKER_VUID = 3,
+       LTTNG_KERNEL_ABI_TRACKER_GID = 4,
+       LTTNG_KERNEL_ABI_TRACKER_VGID = 5,
 };
 
 struct lttng_kernel_abi_tracker_args {
index ff0d5bb9365fb11cf6e1f9506aeebd80b2e20d80..f1d039a1f4643fa3f3fb30771d5b375e934212a1 100644 (file)
 
 #include <common/compat/string.hpp>
 
+#include <memory>
+#include <pthread.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-
-#include <memory>
-#include <pthread.h>
 #include <type_traits>
 
 /*
 
 #ifdef NDEBUG
 /*
-* Force usage of the assertion condition to prevent unused variable warnings
-* when `assert()` are disabled by the `NDEBUG` definition.
-*/
-# define LTTNG_ASSERT(_cond) ((void) sizeof((void) (_cond), 0))
+ * Force usage of the assertion condition to prevent unused variable warnings
+ * when `assert()` are disabled by the `NDEBUG` definition.
+ */
+#define LTTNG_ASSERT(_cond) ((void) sizeof((void) (_cond), 0))
 #else
-# include <assert.h>
-# define LTTNG_ASSERT(_cond) assert(_cond)
+#include <assert.h>
+#define LTTNG_ASSERT(_cond) assert(_cond)
 #endif
 
 /*
  * Memory allocation zeroed
  */
 
-static inline
-void *zmalloc_internal(size_t size)
+static inline void *zmalloc_internal(size_t size)
 {
        return calloc(1, size);
 }
@@ -133,10 +131,10 @@ AllocatedType *malloc()
  * Malloc a buffer of size `size`, asserting that AllocatedType can be safely
  * malloc-ed (is trivially constructible).
  */
-template<typename AllocatedType>
+template <typename AllocatedType>
 AllocatedType *malloc(size_t size)
 {
-       static_assert (can_malloc<AllocatedType>::value, "type can be malloc'ed");
+       static_assert(can_malloc<AllocatedType>::value, "type can be malloc'ed");
        return (AllocatedType *) malloc(size);
 }
 
@@ -153,9 +151,8 @@ AllocatedType *malloc(size_t size)
  * pointers to void, these will not be checked.
  */
 
-template<typename FreedType>
-struct can_free
-{
+template <typename FreedType>
+struct can_free {
        /*
         * gcc versions before 5.0 lack some type traits defined in C++11.
         * Since in this instance we use the trait to prevent misuses
@@ -185,9 +182,8 @@ template <typename InitializedType,
          typename = typename std::enable_if<!can_memset<InitializedType>::value>::type>
 void *memset(InitializedType *s, int c, size_t n) = delete;
 
-template<typename T>
-struct can_memcpy
-{
+template <typename T>
+struct can_memcpy {
        /*
         * gcc versions before 5.0 lack some type traits defined in C++11.
         * Since in this instance we use the trait to prevent misuses
@@ -233,7 +229,7 @@ template <typename DestinationType,
 void *memmove(DestinationType *d, const SourceType *s, size_t n) = delete;
 
 #ifndef ARRAY_SIZE
-#define ARRAY_SIZE(array)   (sizeof(array) / (sizeof((array)[0])))
+#define ARRAY_SIZE(array) (sizeof(array) / (sizeof((array)[0])))
 #endif
 
 #ifndef LTTNG_PACKED
@@ -241,17 +237,17 @@ void *memmove(DestinationType *d, const SourceType *s, size_t n) = delete;
 #endif
 
 #ifndef LTTNG_NO_SANITIZE_ADDRESS
-#if defined(__clang__) || defined (__GNUC__)
+#if defined(__clang__) || defined(__GNUC__)
 #define LTTNG_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
 #else
 #define LTTNG_NO_SANITIZE_ADDRESS
 #endif
 #endif
 
-#define member_sizeof(type, field)     sizeof(((type *) 0)->field)
+#define member_sizeof(type, field) sizeof(((type *) 0)->field)
 
-#define ASSERT_LOCKED(lock)         LTTNG_ASSERT(pthread_mutex_trylock(&(lock)))
-#define ASSERT_RCU_READ_LOCKED() LTTNG_ASSERT(rcu_read_ongoing())
+#define ASSERT_LOCKED(lock)       LTTNG_ASSERT(pthread_mutex_trylock(&(lock)))
+#define ASSERT_RCU_READ_LOCKED()   LTTNG_ASSERT(rcu_read_ongoing())
 #define ASSERT_RCU_READ_UNLOCKED() LTTNG_ASSERT(!rcu_read_ongoing())
 
 /* Attribute suitable to tag functions as having printf()-like arguments. */
@@ -259,39 +255,36 @@ void *memmove(DestinationType *d, const SourceType *s, size_t n) = delete;
        __attribute__((format(printf, _string_index, _first_to_check)))
 
 /* Attribute suitable to tag functions as having strftime()-like arguments. */
-#define ATTR_FORMAT_STRFTIME(_string_index) \
-       __attribute__((format(strftime, _string_index, 0)))
+#define ATTR_FORMAT_STRFTIME(_string_index) __attribute__((format(strftime, _string_index, 0)))
 
 /* Macros used to ignore specific compiler diagnostics. */
 
 #define DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
-#define DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
+#define DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
 
 #if defined(__clang__)
-  /* Clang */
-# define DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT
-# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
+/* Clang */
+#define DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT
+#define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
        _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
-# define DIAGNOSTIC_IGNORE_LOGICAL_OP
-# define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
-# define DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
-       _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
+#define DIAGNOSTIC_IGNORE_LOGICAL_OP
+#define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
+#define DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
+_Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
 #else
-  /* GCC */
-# define DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT \
+/* GCC */
+#define DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT \
        _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
-# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
+#define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
        _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
-# define DIAGNOSTIC_IGNORE_LOGICAL_OP \
-       _Pragma("GCC diagnostic ignored \"-Wlogical-op\"")
+#define DIAGNOSTIC_IGNORE_LOGICAL_OP _Pragma("GCC diagnostic ignored \"-Wlogical-op\"")
 #if __GNUG__ && __GNUC__ >= 7
-# define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES                         \
+#define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES \
        _Pragma("GCC diagnostic ignored \"-Wduplicated-branches\"")
 #else
-# define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
+#define DIAGNOSTIC_IGNORE_DUPLICATED_BRANCHES
 #endif /* __GNUG__ && __GNUC__ >= 7 */
-# define DIAGNOSTIC_IGNORE_INVALID_OFFSETOF                            \
-       _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
+#define DIAGNOSTIC_IGNORE_INVALID_OFFSETOF _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
 #endif
 
 /* Used to make specific C++ functions to C code. */
@@ -301,17 +294,16 @@ void *memmove(DestinationType *d, const SourceType *s, size_t n) = delete;
 #define C_LINKAGE
 #endif
 
-/*
- * lttng_strncpy returns 0 on success, or nonzero on failure.
- * It checks that the @src string fits into @dst_len before performing
- * the copy. On failure, no copy has been performed.
- *
- * Assumes that 'src' is null-terminated.
- *
- * dst_len includes the string's trailing NULL.
- */
-static inline
-int lttng_strncpy(char *dst, const char *src, size_t dst_len)
+       /*
+        * lttng_strncpy returns 0 on success, or nonzero on failure.
+        * It checks that the @src string fits into @dst_len before performing
+        * the copy. On failure, no copy has been performed.
+        *
+        * Assumes that 'src' is null-terminated.
+        *
+        * dst_len includes the string's trailing NULL.
+        */
+       static inline int lttng_strncpy(char *dst, const char *src, size_t dst_len)
 {
        if (strlen(src) >= dst_len) {
                /* Fail since copying would result in truncation. */
index 50d1916f20239624525c5226a926f5e76f58e3af..9381ce9711d2b57a257310bc52217d239995fc13 100644 (file)
@@ -38,8 +38,7 @@ namespace lttng {
  * a proper, idiomatic, wrapper.
  */
 
-namespace details
-{
+namespace details {
 template <typename WrappedType, void (*DeleterFunction)(WrappedType *)>
 struct create_unique_class {
        struct deleter {
@@ -69,7 +68,8 @@ void free(Type *ptr)
 }
 
 template <typename WrappedType, void (*DeleterFunc)(WrappedType *)>
-std::unique_ptr<WrappedType, typename details::create_unique_class<WrappedType, DeleterFunc>::deleter>
+std::unique_ptr<WrappedType,
+               typename details::create_unique_class<WrappedType, DeleterFunc>::deleter>
 make_unique_wrapper(WrappedType *instance)
 {
        const details::create_unique_class<WrappedType, DeleterFunc> unique_deleter;
index c4ccf94140d5ddf377c2926068aaef6e3a897acb..d6d9db944e0bd716cf926790fa9dd306f8e4020f 100644 (file)
@@ -9,13 +9,14 @@
 #ifndef _MI_LTTNG_H
 #define _MI_LTTNG_H
 
-#include <stdint.h>
-
+#include <common/config/session-config.hpp>
 #include <common/error.hpp>
 #include <common/macros.hpp>
-#include <common/config/session-config.hpp>
+
 #include <lttng/lttng.h>
 
+#include <stdint.h>
+
 /* Don't want to reference snapshot-internal.h here */
 struct lttng_snapshot_output;
 
@@ -55,190 +56,188 @@ struct mi_lttng_error_query_callbacks {
 };
 
 /* Strings related to command */
-LTTNG_EXPORT extern const char * const mi_lttng_element_command;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_action;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_add_context;
-extern const char * const mi_lttng_element_command_add_trigger;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_create;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_destroy;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_disable_channel;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_disable_event;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_enable_channels;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_enable_event;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_list;
-extern const char * const mi_lttng_element_command_list_trigger;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_load;
-extern const char * const mi_lttng_element_command_metadata;
-extern const char * const mi_lttng_element_command_metadata_action;
-extern const char * const mi_lttng_element_command_regenerate;
-extern const char * const mi_lttng_element_command_regenerate_action;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_name;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_output;
-extern const char * const mi_lttng_element_command_remove_trigger;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_save;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_set_session;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_snapshot;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_snapshot_add;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_snapshot_del;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_snapshot_list;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_snapshot_record;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_start;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_stop;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_success;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_track;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_untrack;
-LTTNG_EXPORT extern const char * const mi_lttng_element_command_version;
-extern const char * const mi_lttng_element_command_rotate;
-extern const char * const mi_lttng_element_command_enable_rotation;
-extern const char * const mi_lttng_element_command_disable_rotation;
-extern const char * const mi_lttng_element_command_clear;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_action;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_add_context;
+extern const char *const mi_lttng_element_command_add_trigger;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_create;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_destroy;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_disable_channel;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_disable_event;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_enable_channels;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_enable_event;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_list;
+extern const char *const mi_lttng_element_command_list_trigger;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_load;
+extern const char *const mi_lttng_element_command_metadata;
+extern const char *const mi_lttng_element_command_metadata_action;
+extern const char *const mi_lttng_element_command_regenerate;
+extern const char *const mi_lttng_element_command_regenerate_action;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_name;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_output;
+extern const char *const mi_lttng_element_command_remove_trigger;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_save;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_set_session;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_snapshot;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_snapshot_add;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_snapshot_del;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_snapshot_list;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_snapshot_record;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_start;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_stop;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_success;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_track;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_untrack;
+LTTNG_EXPORT extern const char *const mi_lttng_element_command_version;
+extern const char *const mi_lttng_element_command_rotate;
+extern const char *const mi_lttng_element_command_enable_rotation;
+extern const char *const mi_lttng_element_command_disable_rotation;
+extern const char *const mi_lttng_element_command_clear;
 
 /* Strings related to version command */
-LTTNG_EXPORT extern const char * const mi_lttng_element_version;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_commit;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_description;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_license;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_major;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_minor;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_patch_level;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_str;
-LTTNG_EXPORT extern const char * const mi_lttng_element_version_web;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_commit;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_description;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_license;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_major;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_minor;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_patch_level;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_str;
+LTTNG_EXPORT extern const char *const mi_lttng_element_version_web;
 
 /* String related to a lttng_event_field */
-LTTNG_EXPORT extern const char * const mi_lttng_element_event_field;
-LTTNG_EXPORT extern const char * const mi_lttng_element_event_fields;
+LTTNG_EXPORT extern const char *const mi_lttng_element_event_field;
+LTTNG_EXPORT extern const char *const mi_lttng_element_event_fields;
 
 /* String related to lttng_event_perf_counter_ctx */
-LTTNG_EXPORT extern const char * const mi_lttng_element_perf_counter_context;
+LTTNG_EXPORT extern const char *const mi_lttng_element_perf_counter_context;
 
 /* Strings related to pid */
-LTTNG_EXPORT extern const char * const mi_lttng_element_pid_id;
+LTTNG_EXPORT extern const char *const mi_lttng_element_pid_id;
 
 /* Strings related to save command */
-LTTNG_EXPORT extern const char * const mi_lttng_element_save;
+LTTNG_EXPORT extern const char *const mi_lttng_element_save;
 
 /* Strings related to load command */
-LTTNG_EXPORT extern const char * const mi_lttng_element_load;
-extern const char * const mi_lttng_element_load_overrides;
-extern const char * const mi_lttng_element_load_override_url;
+LTTNG_EXPORT extern const char *const mi_lttng_element_load;
+extern const char *const mi_lttng_element_load_overrides;
+extern const char *const mi_lttng_element_load_override_url;
 
 /* General element of mi_lttng */
-LTTNG_EXPORT extern const char * const mi_lttng_element_empty;
-LTTNG_EXPORT extern const char * const mi_lttng_element_id;
-LTTNG_EXPORT extern const char * const mi_lttng_element_nowrite;
-LTTNG_EXPORT extern const char * const mi_lttng_element_success;
-LTTNG_EXPORT extern const char * const mi_lttng_element_type_enum;
-LTTNG_EXPORT extern const char * const mi_lttng_element_type_float;
-LTTNG_EXPORT extern const char * const mi_lttng_element_type_integer;
-LTTNG_EXPORT extern const char * const mi_lttng_element_type_other;
-LTTNG_EXPORT extern const char * const mi_lttng_element_type_string;
+LTTNG_EXPORT extern const char *const mi_lttng_element_empty;
+LTTNG_EXPORT extern const char *const mi_lttng_element_id;
+LTTNG_EXPORT extern const char *const mi_lttng_element_nowrite;
+LTTNG_EXPORT extern const char *const mi_lttng_element_success;
+LTTNG_EXPORT extern const char *const mi_lttng_element_type_enum;
+LTTNG_EXPORT extern const char *const mi_lttng_element_type_float;
+LTTNG_EXPORT extern const char *const mi_lttng_element_type_integer;
+LTTNG_EXPORT extern const char *const mi_lttng_element_type_other;
+LTTNG_EXPORT extern const char *const mi_lttng_element_type_string;
 
 /* String related to loglevel */
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_alert;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_crit;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_function;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_line;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_module;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_process;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_program;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_system;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_debug_unit;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_emerg;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_err;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_info;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_notice;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_unknown;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_warning;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_alert;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_crit;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_function;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_line;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_module;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_process;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_program;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_system;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_debug_unit;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_emerg;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_err;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_info;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_notice;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_unknown;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_warning;
 
 /* String related to loglevel JUL */
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_all;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_config;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_fine;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_finer;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_finest;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_info;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_off;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_severe;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_jul_warning;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_all;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_config;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_fine;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_finer;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_finest;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_info;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_off;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_severe;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_jul_warning;
 
 /* String related to loglevel Log4j */
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_off;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_fatal;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_error;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_warn;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_info;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_debug;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_trace;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_log4j_all;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_off;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_fatal;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_error;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_warn;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_info;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_debug;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_trace;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_log4j_all;
 
 /* String related to loglevel Python */
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_python_critical;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_python_error;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_python_warning;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_python_info;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_python_debug;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_str_python_notset;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_python_critical;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_python_error;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_python_warning;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_python_info;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_python_debug;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_str_python_notset;
 
 /* String related to loglevel type */
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_type_all;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_type_range;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_type_single;
-LTTNG_EXPORT extern const char * const mi_lttng_loglevel_type_unknown;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_type_all;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_type_range;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_type_single;
+LTTNG_EXPORT extern const char *const mi_lttng_loglevel_type_unknown;
 
 /* String related to a lttng_snapshot */
-LTTNG_EXPORT extern const char * const mi_lttng_element_snapshot_ctrl_url;
-LTTNG_EXPORT extern const char * const mi_lttng_element_snapshot_data_url;
-LTTNG_EXPORT extern const char * const mi_lttng_element_snapshot_max_size;
-LTTNG_EXPORT extern const char * const mi_lttng_element_snapshot_n_ptr;
-LTTNG_EXPORT extern const char * const mi_lttng_element_snapshot_session_name;
-LTTNG_EXPORT extern const char * const mi_lttng_element_snapshots;
+LTTNG_EXPORT extern const char *const mi_lttng_element_snapshot_ctrl_url;
+LTTNG_EXPORT extern const char *const mi_lttng_element_snapshot_data_url;
+LTTNG_EXPORT extern const char *const mi_lttng_element_snapshot_max_size;
+LTTNG_EXPORT extern const char *const mi_lttng_element_snapshot_n_ptr;
+LTTNG_EXPORT extern const char *const mi_lttng_element_snapshot_session_name;
+LTTNG_EXPORT extern const char *const mi_lttng_element_snapshots;
 
 /* String related to track/untrack command */
-LTTNG_EXPORT extern const char * const mi_lttng_element_track_untrack_all_wildcard;
+LTTNG_EXPORT extern const char *const mi_lttng_element_track_untrack_all_wildcard;
 
-extern const char * const mi_lttng_element_session_name;
+extern const char *const mi_lttng_element_session_name;
 
 /* String related to rotate command */
-extern const char * const mi_lttng_element_rotation;
-extern const char * const mi_lttng_element_rotate_status;
-extern const char * const mi_lttng_element_rotation_schedule;
-extern const char * const mi_lttng_element_rotation_schedules;
-extern const char * const mi_lttng_element_rotation_schedule_periodic;
-extern const char * const mi_lttng_element_rotation_schedule_periodic_time_us;
-extern const char * const mi_lttng_element_rotation_schedule_size_threshold;
-extern const char * const mi_lttng_element_rotation_schedule_size_threshold_bytes;
-extern const char * const mi_lttng_element_rotation_schedule_result;
-extern const char * const mi_lttng_element_rotation_schedule_results;
-extern const char * const mi_lttng_element_rotation_state;
-extern const char * const mi_lttng_element_rotation_location;
-extern const char * const mi_lttng_element_rotation_location_local;
-extern const char * const mi_lttng_element_rotation_location_local_absolute_path;
-extern const char * const mi_lttng_element_rotation_location_relay;
-extern const char * const mi_lttng_element_rotation_location_relay_host;
-extern const char * const mi_lttng_element_rotation_location_relay_control_port;
-extern const char * const mi_lttng_element_rotation_location_relay_data_port;
-extern const char * const mi_lttng_element_rotation_location_relay_protocol;
-extern const char * const mi_lttng_element_rotation_location_relay_relative_path;
+extern const char *const mi_lttng_element_rotation;
+extern const char *const mi_lttng_element_rotate_status;
+extern const char *const mi_lttng_element_rotation_schedule;
+extern const char *const mi_lttng_element_rotation_schedules;
+extern const char *const mi_lttng_element_rotation_schedule_periodic;
+extern const char *const mi_lttng_element_rotation_schedule_periodic_time_us;
+extern const char *const mi_lttng_element_rotation_schedule_size_threshold;
+extern const char *const mi_lttng_element_rotation_schedule_size_threshold_bytes;
+extern const char *const mi_lttng_element_rotation_schedule_result;
+extern const char *const mi_lttng_element_rotation_schedule_results;
+extern const char *const mi_lttng_element_rotation_state;
+extern const char *const mi_lttng_element_rotation_location;
+extern const char *const mi_lttng_element_rotation_location_local;
+extern const char *const mi_lttng_element_rotation_location_local_absolute_path;
+extern const char *const mi_lttng_element_rotation_location_relay;
+extern const char *const mi_lttng_element_rotation_location_relay_host;
+extern const char *const mi_lttng_element_rotation_location_relay_control_port;
+extern const char *const mi_lttng_element_rotation_location_relay_data_port;
+extern const char *const mi_lttng_element_rotation_location_relay_protocol;
+extern const char *const mi_lttng_element_rotation_location_relay_relative_path;
 
 /* String related to enum lttng_rotation_state */
-extern const char * const mi_lttng_rotation_state_str_ongoing;
-extern const char * const mi_lttng_rotation_state_str_completed;
-extern const char * const mi_lttng_rotation_state_str_expired;
-extern const char * const mi_lttng_rotation_state_str_error;
+extern const char *const mi_lttng_rotation_state_str_ongoing;
+extern const char *const mi_lttng_rotation_state_str_completed;
+extern const char *const mi_lttng_rotation_state_str_expired;
+extern const char *const mi_lttng_rotation_state_str_error;
 
 /* String related to enum lttng_trace_archive_location_relay_protocol_type */
-extern const char * const mi_lttng_rotation_location_relay_protocol_str_tcp;
+extern const char *const mi_lttng_rotation_location_relay_protocol_str_tcp;
 
 /* String related to rate_policy elements */
 extern const char *const mi_lttng_element_rate_policy;
 extern const char *const mi_lttng_element_rate_policy_every_n;
 extern const char *const mi_lttng_element_rate_policy_once_after_n;
 
-extern const char
-               *const mi_lttng_element_rate_policy_every_n_interval;
-extern const char
-               *const mi_lttng_element_rate_policy_once_after_n_threshold;
+extern const char *const mi_lttng_element_rate_policy_every_n_interval;
+extern const char *const mi_lttng_element_rate_policy_once_after_n_threshold;
 
 /* String related to action elements */
 extern const char *const mi_lttng_element_action;
@@ -248,25 +247,17 @@ extern const char *const mi_lttng_element_action_start_session;
 extern const char *const mi_lttng_element_action_stop_session;
 extern const char *const mi_lttng_element_action_rotate_session;
 extern const char *const mi_lttng_element_action_snapshot_session;
-extern const char
-               *const mi_lttng_element_action_snapshot_session_output;
+extern const char *const mi_lttng_element_action_snapshot_session_output;
 
 /* String related to condition */
 extern const char *const mi_lttng_element_condition;
-extern const char
-               *const mi_lttng_element_condition_buffer_usage_high;
-extern const char
-               *const mi_lttng_element_condition_buffer_usage_low;
-extern const char
-               *const mi_lttng_element_condition_event_rule_matches;
-extern const char
-               *const mi_lttng_element_condition_session_consumed_size;
-extern const char
-               *const mi_lttng_element_condition_session_rotation;
-extern const char
-               *const mi_lttng_element_condition_session_rotation_completed;
-extern const char
-               *const mi_lttng_element_condition_session_rotation_ongoing;
+extern const char *const mi_lttng_element_condition_buffer_usage_high;
+extern const char *const mi_lttng_element_condition_buffer_usage_low;
+extern const char *const mi_lttng_element_condition_event_rule_matches;
+extern const char *const mi_lttng_element_condition_session_consumed_size;
+extern const char *const mi_lttng_element_condition_session_rotation;
+extern const char *const mi_lttng_element_condition_session_rotation_completed;
+extern const char *const mi_lttng_element_condition_session_rotation_ongoing;
 extern const char *const mi_lttng_element_condition_channel_name;
 extern const char *const mi_lttng_element_condition_threshold_ratio;
 extern const char *const mi_lttng_element_condition_threshold_bytes;
@@ -278,12 +269,9 @@ extern const char *const mi_lttng_element_capture_descriptors;
 /* String related to event expression */
 extern const char *const mi_lttng_element_event_expr;
 extern const char *const mi_lttng_element_event_expr_payload_field;
-extern const char
-               *const mi_lttng_element_event_expr_channel_context_field;
-extern const char
-               *const mi_lttng_element_event_expr_app_specific_context_field;
-extern const char
-               *const mi_lttng_element_event_expr_array_field_element;
+extern const char *const mi_lttng_element_event_expr_channel_context_field;
+extern const char *const mi_lttng_element_event_expr_app_specific_context_field;
+extern const char *const mi_lttng_element_event_expr_array_field_element;
 
 extern const char *const mi_lttng_element_event_expr_provider_name;
 extern const char *const mi_lttng_element_event_expr_type_name;
@@ -295,87 +283,59 @@ extern const char *const mi_lttng_element_event_rule;
 /* String related to lttng_event_rule */
 extern const char *const mi_lttng_element_event_rule_event_name;
 extern const char *const mi_lttng_element_event_rule_name_pattern;
-extern const char
-               *const mi_lttng_element_event_rule_filter_expression;
+extern const char *const mi_lttng_element_event_rule_filter_expression;
 extern const char *const mi_lttng_element_event_rule_jul_logging;
 extern const char *const mi_lttng_element_event_rule_kernel_kprobe;
 extern const char *const mi_lttng_element_event_rule_kernel_syscall;
-extern const char
-               *const mi_lttng_element_event_rule_kernel_tracepoint;
+extern const char *const mi_lttng_element_event_rule_kernel_tracepoint;
 extern const char *const mi_lttng_element_event_rule_kernel_uprobe;
 extern const char *const mi_lttng_element_event_rule_log4j_logging;
 extern const char *const mi_lttng_element_event_rule_python_logging;
-extern const char
-               *const mi_lttng_element_event_rule_user_tracepoint;
+extern const char *const mi_lttng_element_event_rule_user_tracepoint;
 
 /* String related to lttng_event_rule_kernel_syscall. */
-extern const char
-               *const mi_lttng_element_event_rule_kernel_syscall_emission_site;
+extern const char *const mi_lttng_element_event_rule_kernel_syscall_emission_site;
 
 /* String related to enum lttng_event_rule_kernel_syscall_emission_site. */
-extern const char *const
-               mi_lttng_event_rule_kernel_syscall_emission_site_entry_exit;
-extern const char
-               *const mi_lttng_event_rule_kernel_syscall_emission_site_entry;
-extern const char
-               *const mi_lttng_event_rule_kernel_syscall_emission_site_exit;
-
-extern const char *const
-               mi_lttng_element_event_rule_user_tracepoint_name_pattern_exclusions;
-extern const char *const
-               mi_lttng_element_event_rule_user_tracepoint_name_pattern_exclusion;
+extern const char *const mi_lttng_event_rule_kernel_syscall_emission_site_entry_exit;
+extern const char *const mi_lttng_event_rule_kernel_syscall_emission_site_entry;
+extern const char *const mi_lttng_event_rule_kernel_syscall_emission_site_exit;
+
+extern const char *const mi_lttng_element_event_rule_user_tracepoint_name_pattern_exclusions;
+extern const char *const mi_lttng_element_event_rule_user_tracepoint_name_pattern_exclusion;
 
 /* String related to log level rule. */
 extern const char *const mi_lttng_element_log_level_rule;
 extern const char *const mi_lttng_element_log_level_rule_exactly;
-extern const char
-               *const mi_lttng_element_log_level_rule_at_least_as_severe_as;
-extern const char *const
-               mi_lttng_element_log_level_rule_at_least_as_severe_as_thre;
+extern const char *const mi_lttng_element_log_level_rule_at_least_as_severe_as;
+extern const char *const mi_lttng_element_log_level_rule_at_least_as_severe_as_thre;
 extern const char *const mi_lttng_element_log_level_rule_level;
 
 /* String related to kernel probe location. */
 extern const char *const mi_lttng_element_kernel_probe_location;
-extern const char
-               *const mi_lttng_element_kernel_probe_location_symbol_offset;
-extern const char *const
-               mi_lttng_element_kernel_probe_location_symbol_offset_name;
-extern const char *const
-               mi_lttng_element_kernel_probe_location_symbol_offset_offset;
-extern const char
-               *const mi_lttng_element_kernel_probe_location_address;
-extern const char
-               *const mi_lttng_element_kernel_probe_location_address_address;
+extern const char *const mi_lttng_element_kernel_probe_location_symbol_offset;
+extern const char *const mi_lttng_element_kernel_probe_location_symbol_offset_name;
+extern const char *const mi_lttng_element_kernel_probe_location_symbol_offset_offset;
+extern const char *const mi_lttng_element_kernel_probe_location_address;
+extern const char *const mi_lttng_element_kernel_probe_location_address_address;
 
 /* String related to userspace probe location. */
 extern const char *const mi_lttng_element_userspace_probe_location;
-extern const char
-               *const mi_lttng_element_userspace_probe_location_binary_path;
-extern const char
-               *const mi_lttng_element_userspace_probe_location_function;
-extern const char
-               *const mi_lttng_element_userspace_probe_location_function_name;
-extern const char
-               *const mi_lttng_element_userspace_probe_location_lookup_method;
-extern const char *const
-               mi_lttng_element_userspace_probe_location_lookup_method_function_default;
-extern const char *const
-               mi_lttng_element_userspace_probe_location_lookup_method_function_elf;
-extern const char *const
-               mi_lttng_element_userspace_probe_location_lookup_method_tracepoint_sdt;
-extern const char
-               *const mi_lttng_element_userspace_probe_location_tracepoint;
-extern const char *const
-               mi_lttng_element_userspace_probe_location_tracepoint_probe_name;
-extern const char *const
-               mi_lttng_element_userspace_probe_location_tracepoint_provider_name;
+extern const char *const mi_lttng_element_userspace_probe_location_binary_path;
+extern const char *const mi_lttng_element_userspace_probe_location_function;
+extern const char *const mi_lttng_element_userspace_probe_location_function_name;
+extern const char *const mi_lttng_element_userspace_probe_location_lookup_method;
+extern const char *const mi_lttng_element_userspace_probe_location_lookup_method_function_default;
+extern const char *const mi_lttng_element_userspace_probe_location_lookup_method_function_elf;
+extern const char *const mi_lttng_element_userspace_probe_location_lookup_method_tracepoint_sdt;
+extern const char *const mi_lttng_element_userspace_probe_location_tracepoint;
+extern const char *const mi_lttng_element_userspace_probe_location_tracepoint_probe_name;
+extern const char *const mi_lttng_element_userspace_probe_location_tracepoint_provider_name;
 
 /* String related to enum
  * lttng_userspace_probe_location_function_instrumentation_type */
-extern const char *const
-               mi_lttng_element_userspace_probe_location_function_instrumentation_type;
-extern const char *const
-               mi_lttng_userspace_probe_location_function_instrumentation_type_entry;
+extern const char *const mi_lttng_element_userspace_probe_location_function_instrumentation_type;
+extern const char *const mi_lttng_userspace_probe_location_function_instrumentation_type_entry;
 
 /* String related to trigger */
 extern const char *const mi_lttng_element_triggers;
@@ -384,18 +344,15 @@ extern const char *const mi_lttng_element_trigger_owner_uid;
 
 /* String related to error_query. */
 extern const char *const mi_lttng_element_error_query_result;
-extern const char
-               *const mi_lttng_element_error_query_result_counter;
-extern const char
-               *const mi_lttng_element_error_query_result_counter_value;
-extern const char
-               *const mi_lttng_element_error_query_result_description;
+extern const char *const mi_lttng_element_error_query_result_counter;
+extern const char *const mi_lttng_element_error_query_result_counter_value;
+extern const char *const mi_lttng_element_error_query_result_description;
 extern const char *const mi_lttng_element_error_query_result_name;
 extern const char *const mi_lttng_element_error_query_result_type;
 extern const char *const mi_lttng_element_error_query_results;
 
 /* String related to add-context command */
-extern const char * const mi_lttng_element_context_symbol;
+extern const char *const mi_lttng_element_context_symbol;
 
 /* Utility string function  */
 const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain);
@@ -405,7 +362,7 @@ const char *mi_lttng_domaintype_string(enum lttng_domain_type value);
 const char *mi_lttng_buffertype_string(enum lttng_buffer_type value);
 const char *mi_lttng_rotation_state_string(enum lttng_rotation_state value);
 const char *mi_lttng_trace_archive_location_relay_protocol_type_string(
-               enum lttng_trace_archive_location_relay_protocol_type value);
+       enum lttng_trace_archive_location_relay_protocol_type value);
 
 /*
  * Create an instance of a machine interface writer.
@@ -458,8 +415,7 @@ int mi_lttng_writer_command_close(struct mi_writer *writer);
  * Returns zero if the XML document could be closed cleanly.
  * Negative values indicate an error.
  */
-int mi_lttng_writer_open_element(struct mi_writer *writer,
-               const char *element_name);
+int mi_lttng_writer_open_element(struct mi_writer *writer, const char *element_name);
 
 /*
  * Close the current element tag.
@@ -480,8 +436,7 @@ int mi_lttng_writer_close_element(struct mi_writer *writer);
  * Returns zero if the XML document could be closed cleanly.
  * Negative values indicate an error.
  */
-int mi_lttng_close_multi_element(struct mi_writer *writer,
-               unsigned int nb_element);
+int mi_lttng_close_multi_element(struct mi_writer *writer, unsigned int nb_element);
 
 /*
  * Write an element of type unsigned int.
@@ -494,7 +449,8 @@ int mi_lttng_close_multi_element(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_writer_write_element_unsigned_int(struct mi_writer *writer,
-               const char *element_name, uint64_t value);
+                                              const char *element_name,
+                                              uint64_t value);
 
 /*
  * Write an element of type signed int.
@@ -507,7 +463,8 @@ int mi_lttng_writer_write_element_unsigned_int(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_writer_write_element_signed_int(struct mi_writer *writer,
-               const char *element_name, int64_t value);
+                                            const char *element_name,
+                                            int64_t value);
 
 /*
  * Write an element of type boolean.
@@ -520,7 +477,8 @@ int mi_lttng_writer_write_element_signed_int(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_writer_write_element_bool(struct mi_writer *writer,
-               const char *element_name, int value);
+                                      const char *element_name,
+                                      int value);
 
 /*
  * Write an element of type string.
@@ -533,7 +491,8 @@ int mi_lttng_writer_write_element_bool(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_writer_write_element_string(struct mi_writer *writer,
-               const char *element_name, const char *value);
+                                        const char *element_name,
+                                        const char *value);
 
 /*
  * Write an element of type double.
@@ -546,8 +505,8 @@ int mi_lttng_writer_write_element_string(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_writer_write_element_double(struct mi_writer *writer,
-               const char *element_name,
-               double value);
+                                        const char *element_name,
+                                        double value);
 
 /*
  * Machine interface of struct version.
@@ -560,8 +519,10 @@ int mi_lttng_writer_write_element_double(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_version(struct mi_writer *writer, struct mi_lttng_version_data *version,
-               const char *lttng_description, const char *lttng_license);
+int mi_lttng_version(struct mi_writer *writer,
+                    struct mi_lttng_version_data *version,
+                    const char *lttng_description,
+                    const char *lttng_license);
 
 /*
  * Machine interface: open a sessions element.
@@ -587,8 +548,7 @@ int mi_lttng_sessions_open(struct mi_writer *writer);
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_session(struct mi_writer *writer,
-               struct lttng_session *session, int is_open);
+int mi_lttng_session(struct mi_writer *writer, struct lttng_session *session, int is_open);
 
 /*
  * Machine interface: open a domains element.
@@ -615,8 +575,7 @@ int mi_lttng_domains_open(struct mi_writer *writer);
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_domain(struct mi_writer *writer,
-               struct lttng_domain *domain, int is_open);
+int mi_lttng_domain(struct mi_writer *writer, struct lttng_domain *domain, int is_open);
 
 /*
  * Machine interface: open a channels element.
@@ -643,8 +602,7 @@ int mi_lttng_channels_open(struct mi_writer *writer);
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_channel(struct mi_writer *writer,
-               struct lttng_channel *channel, int is_open);
+int mi_lttng_channel(struct mi_writer *writer, struct lttng_channel *channel, int is_open);
 
 /*
  * Machine interface of struct channel_attr.
@@ -655,27 +613,25 @@ int mi_lttng_channel(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_channel_attr(struct mi_writer *writer,
-               struct lttng_channel_attr *attr);
+int mi_lttng_channel_attr(struct mi_writer *writer, struct lttng_channel_attr *attr);
 
 /*
-* Machine interface for event common attributes.
-*
-* writer An instance of a mi writer.
-* event single trace event.
-*
-* The common attribute are:
-* - mi event element
-* - event name
-* - event type
-* - enabled tag
-* - event filter
-*
-* Returns zero if the element's value could be written.
-* Negative values indicate an error.
-*/
-int mi_lttng_event_common_attributes(struct mi_writer *writer,
-               struct lttng_event *event);
+ * Machine interface for event common attributes.
+ *
+ * writer An instance of a mi writer.
+ * event single trace event.
+ *
+ * The common attribute are:
+ * - mi event element
+ * - event name
+ * - event type
+ * - enabled tag
+ * - event filter
+ *
+ * Returns zero if the element's value could be written.
+ * Negative values indicate an error.
+ */
+int mi_lttng_event_common_attributes(struct mi_writer *writer, struct lttng_event *event);
 
 /*
  * Machine interface for kernel tracepoint event with a loglevel.
@@ -688,7 +644,8 @@ int mi_lttng_event_common_attributes(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_event_tracepoint_loglevel(struct mi_writer *writer,
-               struct lttng_event *event, enum lttng_domain_type domain);
+                                      struct lttng_event *event,
+                                      enum lttng_domain_type domain);
 
 /*
  * Machine interface for kernel tracepoint event with no loglevel.
@@ -699,8 +656,7 @@ int mi_lttng_event_tracepoint_loglevel(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer *writer,
-               struct lttng_event *event);
+int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer *writer, struct lttng_event *event);
 
 /*
  * Machine interface for kernel function and probe event.
@@ -711,8 +667,7 @@ int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_event_function_probe(struct mi_writer *writer,
-               struct lttng_event *event);
+int mi_lttng_event_function_probe(struct mi_writer *writer, struct lttng_event *event);
 
 /*
  * Machine interface for kernel function entry event.
@@ -723,8 +678,7 @@ int mi_lttng_event_function_probe(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_event_function_entry(struct mi_writer *writer,
-               struct lttng_event *event);
+int mi_lttng_event_function_entry(struct mi_writer *writer, struct lttng_event *event);
 
 /*
  * Machine interface: open an events element.
@@ -756,8 +710,10 @@ int mi_lttng_events_open(struct mi_writer *writer);
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_event(struct mi_writer *writer, struct lttng_event *event,
-               int is_open, enum lttng_domain_type domain);
+int mi_lttng_event(struct mi_writer *writer,
+                  struct lttng_event *event,
+                  int is_open,
+                  enum lttng_domain_type domain);
 
 /*
  * Machine interface for struct lttng_event_field.
@@ -768,8 +724,7 @@ int mi_lttng_event(struct mi_writer *writer, struct lttng_event *event,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_event_field(struct mi_writer *writer,
-               struct lttng_event_field *field);
+int mi_lttng_event_field(struct mi_writer *writer, struct lttng_event_field *field);
 
 /*
  * Machine interface: open a event_fields element.
@@ -801,8 +756,8 @@ int mi_lttng_trackers_open(struct mi_writer *writer);
  *
  * Note: A targets element is also opened for each tracker definition
  */
-int mi_lttng_process_attribute_tracker_open(
-               struct mi_writer *writer, enum lttng_process_attr process_attr);
+int mi_lttng_process_attribute_tracker_open(struct mi_writer *writer,
+                                           enum lttng_process_attr process_attr);
 
 /*
  * Machine interface: open a PIDs element.
@@ -839,8 +794,7 @@ int mi_lttng_processes_open(struct mi_writer *writer);
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_process(struct mi_writer *writer, pid_t pid , const char *name,
-               int is_open);
+int mi_lttng_process(struct mi_writer *writer, pid_t pid, const char *name, int is_open);
 
 /*
  * TODO: move pid of lttng list -u to process semantic on mi api bump
@@ -858,8 +812,7 @@ int mi_lttng_process(struct mi_writer *writer, pid_t pid , const char *name,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_pid(struct mi_writer *writer, pid_t pid , const char *name,
-               int is_open);
+int mi_lttng_pid(struct mi_writer *writer, pid_t pid, const char *name, int is_open);
 
 /*
  * Machine interface: open a process attribute values element.
@@ -880,8 +833,8 @@ int mi_lttng_process_attr_values_open(struct mi_writer *writer);
  * Negative values indicate an error.
  */
 int mi_lttng_all_process_attribute_value(struct mi_writer *writer,
-               enum lttng_process_attr process_attr,
-               bool is_open);
+                                        enum lttng_process_attr process_attr,
+                                        bool is_open);
 
 /*
  * Machine interface for track/untrack of an integral process attribute value.
@@ -892,9 +845,9 @@ int mi_lttng_all_process_attribute_value(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_integral_process_attribute_value(struct mi_writer *writer,
-               enum lttng_process_attr process_attr,
-               int64_t value,
-               bool is_open);
+                                             enum lttng_process_attr process_attr,
+                                             int64_t value,
+                                             bool is_open);
 
 /*
  * Machine interface for track/untrack of a string process attribute value.
@@ -905,9 +858,9 @@ int mi_lttng_integral_process_attribute_value(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_string_process_attribute_value(struct mi_writer *writer,
-               enum lttng_process_attr process_attr,
-               const char *value,
-               bool is_open);
+                                           enum lttng_process_attr process_attr,
+                                           const char *value,
+                                           bool is_open);
 
 /*
  * Machine interface of a context.
@@ -922,8 +875,7 @@ int mi_lttng_string_process_attribute_value(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_context(struct mi_writer *writer,
-               struct lttng_event_context *context, int is_open);
+int mi_lttng_context(struct mi_writer *writer, struct lttng_event_context *context, int is_open);
 
 /*
  * Machine interface of a perf_counter_context.
@@ -936,7 +888,7 @@ int mi_lttng_context(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_perf_counter_context(struct mi_writer *writer,
-               struct lttng_event_perf_counter_ctx  *perf_context);
+                                 struct lttng_event_perf_counter_ctx *perf_context);
 
 /*
  * Machine interface of the snapshot list_output.
@@ -954,8 +906,7 @@ int mi_lttng_perf_counter_context(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_snapshot_output_session_name(struct mi_writer *writer,
-               const char *session_name);
+int mi_lttng_snapshot_output_session_name(struct mi_writer *writer, const char *session_name);
 
 /*
  * Machine interface of the snapshot output.
@@ -974,7 +925,7 @@ int mi_lttng_snapshot_output_session_name(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_snapshot_list_output(struct mi_writer *writer,
-               const struct lttng_snapshot_output *output);
+                                 const struct lttng_snapshot_output *output);
 
 /*
  * Machine interface of the output of the command snapshot del output
@@ -997,8 +948,10 @@ int mi_lttng_snapshot_list_output(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_snapshot_del_output(struct mi_writer *writer, int id,
-               const char *name, const char *current_session_name);
+int mi_lttng_snapshot_del_output(struct mi_writer *writer,
+                                int id,
+                                const char *name,
+                                const char *current_session_name);
 
 /*
  * Machine interface of the output of the command snapshot add output
@@ -1024,8 +977,9 @@ int mi_lttng_snapshot_del_output(struct mi_writer *writer, int id,
  * Negative values indicate an error.
  */
 int mi_lttng_snapshot_add_output(struct mi_writer *writer,
-               const char *current_session_name, const char *n_ptr,
-               struct lttng_snapshot_output *output);
+                                const char *current_session_name,
+                                const char *n_ptr,
+                                struct lttng_snapshot_output *output);
 
 /*
  * Machine interface of the output of the command snapshot
@@ -1045,8 +999,10 @@ int mi_lttng_snapshot_add_output(struct mi_writer *writer,
  * Returns zero if the element's value could be written.
  * Negative values indicate an error.
  */
-int mi_lttng_snapshot_record(struct mi_writer *writer, const char *url,
-               const char *cmdline_ctrl_url, const char *cmdline_data_url);
+int mi_lttng_snapshot_record(struct mi_writer *writer,
+                            const char *url,
+                            const char *cmdline_ctrl_url,
+                            const char *cmdline_data_url);
 
 /*
  * Machine interface representation of a session rotation schedule.
@@ -1062,7 +1018,7 @@ int mi_lttng_snapshot_record(struct mi_writer *writer, const char *url,
  * Negative values indicate an error.
  */
 int mi_lttng_rotation_schedule(struct mi_writer *writer,
-               const struct lttng_rotation_schedule *schedule);
+                              const struct lttng_rotation_schedule *schedule);
 
 /*
  * Machine interface of a session rotation schedule result.
@@ -1083,8 +1039,8 @@ int mi_lttng_rotation_schedule(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_rotation_schedule_result(struct mi_writer *writer,
-               const struct lttng_rotation_schedule *schedule,
-               bool success);
+                                     const struct lttng_rotation_schedule *schedule,
+                                     bool success);
 
 /*
  * Machine interface of a session rotation result.
@@ -1107,8 +1063,8 @@ int mi_lttng_rotation_schedule_result(struct mi_writer *writer,
  * Negative values indicate an error.
  */
 int mi_lttng_rotate(struct mi_writer *writer,
-               const char *session_name,
-               enum lttng_rotation_state rotation_state,
-               const struct lttng_trace_archive_location *location);
+                   const char *session_name,
+                   enum lttng_rotation_state rotation_state,
+                   const struct lttng_trace_archive_location *location);
 
 #endif /* _MI_LTTNG_H */
index 4bb774739a8aa870c03aa328040690e9a725e3a8..69bba5be54254041b89e8f3f0213ac4e4d18ad9a 100644 (file)
  *
  * LTTNG_OPTIONAL_UNSET(&foo.b);
  */
-#define LTTNG_OPTIONAL(type) \
-       struct {             \
+#define LTTNG_OPTIONAL(type)    \
+       struct {                \
                uint8_t is_set; \
-               type value;  \
+               type value;     \
        }
 
 /*
  * Since this returns the 'optional' by value, it is not suitable for all
  * wrapped optional types. It is meant to be used with PODs.
  */
-#define LTTNG_OPTIONAL_GET(optional)                   \
-       ({                                              \
-               LTTNG_ASSERT((optional).is_set);                \
-               (optional).value;                       \
+#define LTTNG_OPTIONAL_GET(optional)             \
+       ({                                       \
+               LTTNG_ASSERT((optional).is_set); \
+               (optional).value;                \
        })
 
 /*
  * an optional value is set to LTTNG_ASSERT() that it is set when fecthing the
  * underlying value's address.
  */
-#define LTTNG_OPTIONAL_GET_PTR(optional)                       \
-       ({                                              \
-               LTTNG_ASSERT((optional).is_set);                \
-               &(optional).value;                      \
+#define LTTNG_OPTIONAL_GET_PTR(optional)         \
+       ({                                       \
+               LTTNG_ASSERT((optional).is_set); \
+               &(optional).value;               \
        })
 
 /*
@@ -83,7 +83,9 @@
  * The wrapped field is set to the value it would gave if it had static storage
  * duration.
  */
-#define LTTNG_OPTIONAL_INIT_UNSET {}
+#define LTTNG_OPTIONAL_INIT_UNSET \
+       {                         \
+       }
 
 /*
  * Initialize an optional field as 'set' with a given value.
        }
 
 /* Set the value of an optional field. */
-#define LTTNG_OPTIONAL_SET(field_ptr, val)     \
-       do {                                    \
-               (field_ptr)->is_set = 1;        \
-               (field_ptr)->value = (val);     \
+#define LTTNG_OPTIONAL_SET(field_ptr, val)  \
+       do {                                \
+               (field_ptr)->is_set = 1;    \
+               (field_ptr)->value = (val); \
        } while (0)
 
 /* Put an optional field in the "unset" (NULL-ed) state. */
-#define LTTNG_OPTIONAL_UNSET(field_ptr)                \
-       do {                                    \
-               (field_ptr)->is_set = 0;        \
+#define LTTNG_OPTIONAL_UNSET(field_ptr)  \
+       do {                             \
+               (field_ptr)->is_set = 0; \
        } while (0)
 
 #endif /* LTTNG_OPTIONAL_H */
index 06bb3d157a2c5fbec8c1882055995c133f791662..1980c0a2f53592204ae29e54297c211ebce64c8c 100644 (file)
@@ -75,9 +75,8 @@ bool lttng_payload_view_is_valid(const struct lttng_payload_view *view);
  *             cause the view to reference the whole payload from the
  *             offset provided.
  */
-struct lttng_payload_view lttng_payload_view_from_payload(
-               const struct lttng_payload *payload, size_t offset,
-               ptrdiff_t len);
+struct lttng_payload_view
+lttng_payload_view_from_payload(const struct lttng_payload *payload, size_t offset, ptrdiff_t len);
 
 /**
  * Return a payload view referencing a subset of a payload referenced by
@@ -89,9 +88,8 @@ struct lttng_payload_view lttng_payload_view_from_payload(
  *             cause the payload view to reference the whole payload view's
  *             buffer view from the offset provided.
  */
-struct lttng_payload_view lttng_payload_view_from_view(
-               struct lttng_payload_view *view, size_t offset,
-               ptrdiff_t len);
+struct lttng_payload_view
+lttng_payload_view_from_view(struct lttng_payload_view *view, size_t offset, ptrdiff_t len);
 
 /**
  * Return a payload view referencing a subset of a dynamic buffer.
@@ -106,8 +104,7 @@ struct lttng_payload_view lttng_payload_view_from_view(
  *             offset provided.
  */
 struct lttng_payload_view lttng_payload_view_from_dynamic_buffer(
-               const struct lttng_dynamic_buffer *buffer, size_t offset,
-               ptrdiff_t len);
+       const struct lttng_dynamic_buffer *buffer, size_t offset, ptrdiff_t len);
 /**
  *
  * Return a payload view referencing a subset of a dynamic buffer.
@@ -121,9 +118,9 @@ struct lttng_payload_view lttng_payload_view_from_dynamic_buffer(
  *             cause the payload view to reference the whole payload from the
  *             offset provided.
  */
-struct lttng_payload_view lttng_payload_view_from_buffer_view(
-               const struct lttng_buffer_view *view, size_t offset,
-               ptrdiff_t len);
+struct lttng_payload_view lttng_payload_view_from_buffer_view(const struct lttng_buffer_view *view,
+                                                             size_t offset,
+                                                             ptrdiff_t len);
 
 /**
  * Return a payload view referencing a subset of the memory referenced by a raw
@@ -136,8 +133,8 @@ struct lttng_payload_view lttng_payload_view_from_buffer_view(
  * Note that a payload view never assumes the ownership of the memory it
  * references.
  */
-struct lttng_payload_view lttng_payload_view_init_from_buffer(
-               const char *src, size_t offset, ptrdiff_t len);
+struct lttng_payload_view
+lttng_payload_view_init_from_buffer(const char *src, size_t offset, ptrdiff_t len);
 
 /**
  * Get the number of file descriptor handles left in a payload view.
@@ -146,8 +143,7 @@ struct lttng_payload_view lttng_payload_view_init_from_buffer(
  *
  * Returns the number of file descriptor handles left on success, -1 on error.
  */
-int lttng_payload_view_get_fd_handle_count(
-               const struct lttng_payload_view *payload_view);
+int lttng_payload_view_get_fd_handle_count(const struct lttng_payload_view *payload_view);
 
 /**
  * Pop an fd handle from a payload view.
@@ -158,7 +154,6 @@ int lttng_payload_view_get_fd_handle_count(
  *
  * Returns an fd_handle on success, -1 on error.
  */
-struct fd_handle *lttng_payload_view_pop_fd_handle(
-               struct lttng_payload_view *payload_view);
+struct fd_handle *lttng_payload_view_pop_fd_handle(struct lttng_payload_view *payload_view);
 
 #endif /* LTTNG_PAYLOAD_VIEW_H */
index 9747f59ef3537eb6d699db76feeff945722cdb8a..0e27efa2c2799a1d6814e16983b6a7f5f8229c7c 100644 (file)
@@ -8,8 +8,8 @@
 #ifndef LTTNG_PAYLOAD_H
 #define LTTNG_PAYLOAD_H
 
-#include <common/dynamic-buffer.hpp>
 #include <common/dynamic-array.hpp>
+#include <common/dynamic-buffer.hpp>
 #include <common/fd-handle.hpp>
 
 /*
@@ -30,8 +30,7 @@ struct lttng_payload {
 void lttng_payload_init(struct lttng_payload *payload);
 
 /* Copy a payload. */
-int lttng_payload_copy(const struct lttng_payload *src_payload,
-               struct lttng_payload *dst_payload);
+int lttng_payload_copy(const struct lttng_payload *src_payload, struct lttng_payload *dst_payload);
 
 /* Release any memory and references held by the payload. */
 void lttng_payload_reset(struct lttng_payload *payload);
@@ -54,7 +53,6 @@ void lttng_payload_clear(struct lttng_payload *payload);
  *
  * Returns 0 on success, -1 on allocation error.
  */
-int lttng_payload_push_fd_handle(struct lttng_payload *payload,
-               struct fd_handle *fd_handle);
+int lttng_payload_push_fd_handle(struct lttng_payload *payload, struct fd_handle *fd_handle);
 
 #endif /* LTTNG_PAYLOAD_H */
index 4e6afc567831868c570ab36c2fa8998fd8357ca0..7c8cf89b6b9b94e3ab00fce5b337a10e7ac57783 100644 (file)
@@ -79,15 +79,13 @@ static inline int lttng_pipe_get_writefd(const struct lttng_pipe *pipe)
 }
 
 struct lttng_pipe *lttng_pipe_open(int flags);
-struct lttng_pipe *lttng_pipe_named_open(const char *path, mode_t mode,
-               int flags);
+struct lttng_pipe *lttng_pipe_named_open(const char *path, mode_t mode, int flags);
 int lttng_pipe_write_close(struct lttng_pipe *pipe);
 int lttng_pipe_read_close(struct lttng_pipe *pipe);
 void lttng_pipe_destroy(struct lttng_pipe *pipe);
 
 ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count);
-ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf,
-               size_t count);
+ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, size_t count);
 /* Returns and releases the read end of the pipe. */
 int lttng_pipe_release_readfd(struct lttng_pipe *pipe);
 /* Returns and releases the write end of the pipe. */
index b34b45935861ce3f131304d7b908a0eea734bd5e..7d037e47226cf2469503bf30b8073915fb134349 100644 (file)
@@ -10,8 +10,8 @@
 
 #include <common/exception.hpp>
 
-#include <pthread.h>
 #include <mutex>
+#include <pthread.h>
 
 namespace lttng {
 namespace pthread {
index dfab9538c0cab31cd4f556547a9f4e7b261d7fe3..5a038a563e12b339a25f307cf4e83cc12c6d1bfc 100644 (file)
@@ -73,9 +73,8 @@ void getrandom_nonblock(char *out_data, std::size_t size)
        }
 }
 #else /* defined(__linux__) && defined(SYS_getrandom) && defined(HAVE_SYS_RANDOM_H) */
-__attribute__((noreturn))
-void getrandom_nonblock(char *out_data __attribute__((unused)),
-               std::size_t size __attribute__((unused)))
+__attribute__((noreturn)) void getrandom_nonblock(char *out_data __attribute__((unused)),
+                                                 std::size_t size __attribute__((unused)))
 {
        LTTNG_THROW_RANDOM_PRODUCTION_ERROR("getrandom() is not supported by this platform");
 }
index 0430485c34c46c801110963af6c40947e5b600cd..7ba6ede5022985ceb069c2a8659f0d5e6c444df1 100644 (file)
@@ -21,9 +21,9 @@ using seed_t = unsigned int;
 class production_error : public ::lttng::runtime_error {
 public:
        explicit production_error(const std::string& msg,
-                       const char *file_name,
-                       const char *function_name,
-                       unsigned int line_number);
+                                 const char *file_name,
+                                 const char *function_name,
+                                 unsigned int line_number);
 };
 
 /*
index 1818fdb261f6f7c53f1f1bb788014ec8201c1f25..d3f80929d6cfcf4bb6208559009cca790323b746 100644 (file)
@@ -8,9 +8,10 @@
  *
  */
 
-#include <unistd.h>
 #include <common/macros.hpp>
 
+#include <unistd.h>
+
 /*
  * lttng_read and lttng_write take care of EINTR and partial read/write.
  * Upon success, they return the "count" received as parameter.
index 05d1ec684630a3bb95b6286424aeba78ac646687..f7b16229881915d1689ea8d00e45d42aa91a890d 100644 (file)
@@ -8,13 +8,13 @@
 #ifndef _RELAYD_H
 #define _RELAYD_H
 
-#include <unistd.h>
-#include <stdbool.h>
-
+#include <common/dynamic-array.hpp>
 #include <common/sessiond-comm/relayd.hpp>
 #include <common/sessiond-comm/sessiond-comm.hpp>
 #include <common/trace-chunk.hpp>
-#include <common/dynamic-array.hpp>
+
+#include <stdbool.h>
+#include <unistd.h>
 
 struct relayd_stream_rotation_position {
        uint64_t stream_id;
@@ -30,51 +30,63 @@ struct relayd_stream_rotation_position {
 int relayd_connect(struct lttcomm_relayd_sock *sock);
 int relayd_close(struct lttcomm_relayd_sock *sock);
 int relayd_create_session(struct lttcomm_relayd_sock *rsock,
-               uint64_t *relayd_session_id,
-               const char *session_name, const char *hostname,
-               const char *base_path, int session_live_timer,
-               unsigned int snapshot, uint64_t sessiond_session_id,
-               const lttng_uuid& sessiond_uuid,
-               const uint64_t *current_chunk_id,
-               time_t creation_time, bool session_name_contains_creation_time,
-               char *output_path);
-int relayd_add_stream(struct lttcomm_relayd_sock *sock, const char *channel_name,
-               const char *domain_name, const char *pathname, uint64_t *stream_id,
-               uint64_t tracefile_size, uint64_t tracefile_count,
-               struct lttng_trace_chunk *trace_chunk);
+                         uint64_t *relayd_session_id,
+                         const char *session_name,
+                         const char *hostname,
+                         const char *base_path,
+                         int session_live_timer,
+                         unsigned int snapshot,
+                         uint64_t sessiond_session_id,
+                         const lttng_uuid& sessiond_uuid,
+                         const uint64_t *current_chunk_id,
+                         time_t creation_time,
+                         bool session_name_contains_creation_time,
+                         char *output_path);
+int relayd_add_stream(struct lttcomm_relayd_sock *sock,
+                     const char *channel_name,
+                     const char *domain_name,
+                     const char *pathname,
+                     uint64_t *stream_id,
+                     uint64_t tracefile_size,
+                     uint64_t tracefile_count,
+                     struct lttng_trace_chunk *trace_chunk);
 int relayd_streams_sent(struct lttcomm_relayd_sock *rsock);
-int relayd_send_close_stream(struct lttcomm_relayd_sock *sock, uint64_t stream_id,
-               uint64_t last_net_seq_num);
+int relayd_send_close_stream(struct lttcomm_relayd_sock *sock,
+                            uint64_t stream_id,
+                            uint64_t last_net_seq_num);
 int relayd_version_check(struct lttcomm_relayd_sock *sock);
 int relayd_start_data(struct lttcomm_relayd_sock *sock);
 int relayd_send_metadata(struct lttcomm_relayd_sock *sock, size_t len);
 int relayd_send_data_hdr(struct lttcomm_relayd_sock *sock,
-               struct lttcomm_relayd_data_hdr *hdr, size_t size);
-int relayd_data_pending(struct lttcomm_relayd_sock *sock, uint64_t stream_id,
-               uint64_t last_net_seq_num);
-int relayd_quiescent_control(struct lttcomm_relayd_sock *sock,
-               uint64_t metadata_stream_id);
+                        struct lttcomm_relayd_data_hdr *hdr,
+                        size_t size);
+int relayd_data_pending(struct lttcomm_relayd_sock *sock,
+                       uint64_t stream_id,
+                       uint64_t last_net_seq_num);
+int relayd_quiescent_control(struct lttcomm_relayd_sock *sock, uint64_t metadata_stream_id);
 int relayd_begin_data_pending(struct lttcomm_relayd_sock *sock, uint64_t id);
-int relayd_end_data_pending(struct lttcomm_relayd_sock *sock, uint64_t id,
-               unsigned int *is_data_inflight);
+int relayd_end_data_pending(struct lttcomm_relayd_sock *sock,
+                           uint64_t id,
+                           unsigned int *is_data_inflight);
 int relayd_send_index(struct lttcomm_relayd_sock *rsock,
-               struct ctf_packet_index *index, uint64_t relay_stream_id,
-               uint64_t net_seq_num);
-int relayd_reset_metadata(struct lttcomm_relayd_sock *rsock,
-               uint64_t stream_id, uint64_t version);
+                     struct ctf_packet_index *index,
+                     uint64_t relay_stream_id,
+                     uint64_t net_seq_num);
+int relayd_reset_metadata(struct lttcomm_relayd_sock *rsock, uint64_t stream_id, uint64_t version);
 /* `positions` is an array of `stream_count` relayd_stream_rotation_position. */
 int relayd_rotate_streams(struct lttcomm_relayd_sock *sock,
-               unsigned int stream_count, const uint64_t *new_chunk_id,
-               const struct relayd_stream_rotation_position *positions);
-int relayd_create_trace_chunk(struct lttcomm_relayd_sock *sock,
-               struct lttng_trace_chunk *chunk);
+                         unsigned int stream_count,
+                         const uint64_t *new_chunk_id,
+                         const struct relayd_stream_rotation_position *positions);
+int relayd_create_trace_chunk(struct lttcomm_relayd_sock *sock, struct lttng_trace_chunk *chunk);
 int relayd_close_trace_chunk(struct lttcomm_relayd_sock *sock,
-               struct lttng_trace_chunk *chunk,
-               char *path);
+                            struct lttng_trace_chunk *chunk,
+                            char *path);
 int relayd_trace_chunk_exists(struct lttcomm_relayd_sock *sock,
-               uint64_t chunk_id, bool *chunk_exists);
+                             uint64_t chunk_id,
+                             bool *chunk_exists);
 int relayd_get_configuration(struct lttcomm_relayd_sock *sock,
-               uint64_t query_flags,
-               uint64_t *result_flags);
+                            uint64_t query_flags,
+                            uint64_t *result_flags);
 
 #endif /* _RELAYD_H */
index 86c56c987381bb483e587c9edcd8852a491de2a6..db3ba5042f3b1e7a07e27514b04e4a44fefe0aaa 100644 (file)
@@ -9,13 +9,13 @@
  *
  */
 
+#include <common/macros.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+
 #include <stdint.h>
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <common/macros.hpp>
-#include <common/sessiond-comm/sessiond-comm.hpp>
-
 /*
  * The run-as process is launched by forking without an exec*() call. This means
  * that any resource allocated before the run-as worker is launched should be
 using post_fork_cleanup_cb = int (*)(void *);
 
 int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int run_as_mkdirat_recursive(int dirfd, const char *path, mode_t mode,
-               uid_t uid, gid_t gid);
+int run_as_mkdirat_recursive(int dirfd, const char *path, mode_t mode, uid_t uid, gid_t gid);
 int run_as_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int run_as_mkdirat(int dirfd, const char *path, mode_t mode,
-               uid_t uid, gid_t gid);
+int run_as_mkdirat(int dirfd, const char *path, mode_t mode, uid_t uid, gid_t gid);
 int run_as_open(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid);
-int run_as_openat(int dirfd, const char *filename, int flags, mode_t mode,
-               uid_t uid, gid_t gid);
+int run_as_openat(int dirfd, const char *filename, int flags, mode_t mode, uid_t uid, gid_t gid);
 int run_as_unlink(const char *path, uid_t uid, gid_t gid);
 int run_as_unlinkat(int dirfd, const char *filename, uid_t uid, gid_t gid);
 int run_as_rmdir(const char *path, uid_t uid, gid_t gid);
@@ -47,18 +44,27 @@ int run_as_rmdir_recursive(const char *path, uid_t uid, gid_t gid, int flags);
 int run_as_rmdirat(int dirfd, const char *path, uid_t uid, gid_t gid);
 int run_as_rmdirat_recursive(int dirfd, const char *path, uid_t uid, gid_t gid, int flags);
 int run_as_rename(const char *old_name, const char *new_name, uid_t uid, gid_t gid);
-int run_as_renameat(int old_dirfd, const char *old_name,
-               int new_dirfd, const char *new_name, uid_t uid, gid_t gid);
-int run_as_extract_elf_symbol_offset(int fd, const char* function,
-               uid_t uid, gid_t gid, uint64_t *offset);
-int run_as_extract_sdt_probe_offsets(int fd, const char *provider_name,
-               const char* probe_name, uid_t uid, gid_t gid,
-               uint64_t **offsets, uint32_t *num_offset);
+int run_as_renameat(int old_dirfd,
+                   const char *old_name,
+                   int new_dirfd,
+                   const char *new_name,
+                   uid_t uid,
+                   gid_t gid);
+int run_as_extract_elf_symbol_offset(
+       int fd, const char *function, uid_t uid, gid_t gid, uint64_t *offset);
+int run_as_extract_sdt_probe_offsets(int fd,
+                                    const char *provider_name,
+                                    const char *probe_name,
+                                    uid_t uid,
+                                    gid_t gid,
+                                    uint64_t **offsets,
+                                    uint32_t *num_offset);
 int run_as_generate_filter_bytecode(const char *filter_expression,
-               const struct lttng_credentials *creds,
-               struct lttng_bytecode **bytecode);
+                                   const struct lttng_credentials *creds,
+                                   struct lttng_bytecode **bytecode);
 int run_as_create_worker(const char *procname,
-               post_fork_cleanup_cb clean_up_func, void *clean_up_user_data);
+                        post_fork_cleanup_cb clean_up_func,
+                        void *clean_up_user_data);
 void run_as_destroy_worker();
 
 #endif /* _RUNAS_H */
index 65d379ec06cde75c6d39545e743572c0a7a0c375..2d2d0fa4a50f98734c653de30b4e20bf89839451 100644 (file)
@@ -9,22 +9,23 @@
 #ifndef AGENT_COMM
 #define AGENT_COMM
 
-#include <stdint.h>
-
 #include <common/compiler.hpp>
 #include <common/macros.hpp>
+
 #include <lttng/lttng.h>
 
+#include <stdint.h>
+
 /*
  * Command value passed in the header.
  */
 enum lttcomm_agent_command {
-       AGENT_CMD_LIST                  = 1,
-       AGENT_CMD_ENABLE                = 2,
-       AGENT_CMD_DISABLE               = 3,
-       AGENT_CMD_REG_DONE              = 4,    /* End registration process. */
-       AGENT_CMD_APP_CTX_ENABLE        = 5,
-       AGENT_CMD_APP_CTX_DISABLE       = 6,
+       AGENT_CMD_LIST = 1,
+       AGENT_CMD_ENABLE = 2,
+       AGENT_CMD_DISABLE = 3,
+       AGENT_CMD_REG_DONE = 4, /* End registration process. */
+       AGENT_CMD_APP_CTX_ENABLE = 5,
+       AGENT_CMD_APP_CTX_DISABLE = 6,
 };
 
 /*
@@ -32,11 +33,11 @@ enum lttcomm_agent_command {
  */
 enum lttcomm_agent_ret_code {
        /* Success, assumed to be the first entry */
-       AGENT_RET_CODE_SUCCESS          = 1,
+       AGENT_RET_CODE_SUCCESS = 1,
        /* Invalid command */
-       AGENT_RET_CODE_INVALID          = 2,
+       AGENT_RET_CODE_INVALID = 2,
        /* Unknown logger name */
-       AGENT_RET_CODE_UNKNOWN_NAME     = 3,
+       AGENT_RET_CODE_UNKNOWN_NAME = 3,
        AGENT_RET_CODE_NR,
 };
 
@@ -44,9 +45,9 @@ enum lttcomm_agent_ret_code {
  * Agent application communication header.
  */
 struct lttcomm_agent_hdr {
-       uint64_t data_size;             /* data size following this header */
-       uint32_t cmd;                   /* Enum of agent command. */
-       uint32_t cmd_version;   /* command version */
+       uint64_t data_size; /* data size following this header */
+       uint32_t cmd; /* Enum of agent command. */
+       uint32_t cmd_version; /* command version */
 } LTTNG_PACKED;
 
 /*
@@ -91,4 +92,4 @@ struct lttcomm_agent_list_reply {
        char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH];
 } LTTNG_PACKED;
 
-#endif /* AGENT_COMM */
+#endif /* AGENT_COMM */
index 6e24fb3ebf709edfd5303bbeb0800b0952acb289..f1fc4c069704fd4f241db5bd58ed37bb5c07acea 100644 (file)
@@ -8,10 +8,13 @@
 #ifndef _LTTCOMM_INET_H
 #define _LTTCOMM_INET_H
 
-#include <limits.h>
-
 #include "sessiond-comm.hpp"
 
+#include <lttng/lttng-export.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
 /* See man tcp(7) for more detail about this value. */
 #define LTTCOMM_INET_PROC_SYN_RETRIES_PATH "/proc/sys/net/ipv4/tcp_syn_retries"
 #define LTTCOMM_INET_PROC_FIN_TIMEOUT_PATH "/proc/sys/net/ipv4/tcp_fin_timeout"
@@ -24,7 +27,7 @@
  * (180/5) by considering that it grows linearly. This is of course uncertain
  * but this is the best approximation we can do at runtime.
  */
-#define LTTCOMM_INET_SYN_TIMEOUT_FACTOR                36
+#define LTTCOMM_INET_SYN_TIMEOUT_FACTOR 36
 
 /*
  * Maximum timeout value in seconds of a TCP connection for both send/recv and
@@ -36,8 +39,7 @@ LTTNG_EXPORT extern unsigned long lttcomm_inet_tcp_timeout;
 struct lttcomm_sock;
 
 /* Net family callback */
-extern int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type,
-               int proto);
+extern int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto);
 
 extern struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock);
 extern int lttcomm_bind_inet_sock(struct lttcomm_sock *sock);
@@ -45,12 +47,12 @@ extern int lttcomm_close_inet_sock(struct lttcomm_sock *sock);
 extern int lttcomm_connect_inet_sock(struct lttcomm_sock *sock);
 extern int lttcomm_listen_inet_sock(struct lttcomm_sock *sock, int backlog);
 
-extern ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
-               size_t len, int flags);
-extern ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock,
-               const void *buf, size_t len, int flags);
+extern ssize_t
+lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf, size_t len, int flags);
+extern ssize_t
+lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, const void *buf, size_t len, int flags);
 
 /* Initialize inet communication layer. */
 extern void lttcomm_inet_init();
 
-#endif /* _LTTCOMM_INET_H */
+#endif /* _LTTCOMM_INET_H */
index d6122fdfae0363558904ad7946ec13259bc78a74..674751e552e3ce2890fa591b319547d2bb70a333 100644 (file)
@@ -8,27 +8,26 @@
 #ifndef _LTTCOMM_INET6_H
 #define _LTTCOMM_INET6_H
 
-#include <limits.h>
-
 #include "sessiond-comm.hpp"
 
+#include <limits.h>
+#include <sys/types.h>
+
 /* Stub */
 struct lttcomm_sock;
 
 /* Net family callback */
-extern int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type,
-               int proto);
+extern int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto);
 
-extern struct lttcomm_sock *lttcomm_accept_inet6_sock(
-               struct lttcomm_sock *sock);
+extern struct lttcomm_sock *lttcomm_accept_inet6_sock(struct lttcomm_sock *sock);
 extern int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock);
 extern int lttcomm_close_inet6_sock(struct lttcomm_sock *sock);
 extern int lttcomm_connect_inet6_sock(struct lttcomm_sock *sock);
 extern int lttcomm_listen_inet6_sock(struct lttcomm_sock *sock, int backlog);
 
-extern ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
-               size_t len, int flags);
-extern ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock,
-               const void *buf, size_t len, int flags);
+extern ssize_t
+lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf, size_t len, int flags);
+extern ssize_t
+lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, const void *buf, size_t len, int flags);
 
-#endif /* _LTTCOMM_INET6_H */
+#endif /* _LTTCOMM_INET6_H */
index 0865254fa7dd14cd190499cabd7d4e26fc8eb619..6a0a79201ca356e0b79a382f951ab4cbf55da109 100644 (file)
@@ -9,24 +9,25 @@
 #ifndef _RELAYD_COMM
 #define _RELAYD_COMM
 
-#include <limits.h>
-#include <stdint.h>
-
-#include <lttng/lttng.h>
 #include <common/compiler.hpp>
 #include <common/defaults.hpp>
 #include <common/index/ctf-index.hpp>
 #include <common/macros.hpp>
-#include <common/uuid.hpp>
 #include <common/optional.hpp>
+#include <common/uuid.hpp>
+
+#include <lttng/lttng.h>
+
+#include <limits.h>
+#include <stdint.h>
 
-#define RELAYD_VERSION_COMM_MAJOR             VERSION_MAJOR
-#define RELAYD_VERSION_COMM_MINOR             VERSION_MINOR
+#define RELAYD_VERSION_COMM_MAJOR VERSION_MAJOR
+#define RELAYD_VERSION_COMM_MINOR VERSION_MINOR
 
-#define RELAYD_COMM_LTTNG_HOST_NAME_MAX_2_4    64
-#define RELAYD_COMM_LTTNG_NAME_MAX_2_4 255
-#define RELAYD_COMM_LTTNG_PATH_MAX     4096
-#define RELAYD_COMM_DEFAULT_STREAM_NAME_LEN    264 /* 256 + 8 */
+#define RELAYD_COMM_LTTNG_HOST_NAME_MAX_2_4 64
+#define RELAYD_COMM_LTTNG_NAME_MAX_2_4     255
+#define RELAYD_COMM_LTTNG_PATH_MAX         4096
+#define RELAYD_COMM_DEFAULT_STREAM_NAME_LEN 264 /* 256 + 8 */
 
 /*
  * lttng-relayd communication header.
@@ -34,9 +35,9 @@
 struct lttcomm_relayd_hdr {
        /* Circuit ID not used for now so always ignored */
        uint64_t circuit_id;
-       uint64_t data_size;             /* data size following this header */
-       uint32_t cmd;                   /* enum lttcomm_relayd_command */
-       uint32_t cmd_version;   /* command version */
+       uint64_t data_size; /* data size following this header */
+       uint32_t cmd; /* enum lttcomm_relayd_command */
+       uint32_t cmd_version; /* command version */
 } LTTNG_PACKED;
 
 /*
@@ -45,10 +46,10 @@ struct lttcomm_relayd_hdr {
 struct lttcomm_relayd_data_hdr {
        /* Circuit ID not used for now so always ignored */
        uint64_t circuit_id;
-       uint64_t stream_id;     /* Stream ID known by the relayd */
-       uint64_t net_seq_num;   /* Network sequence number, per stream. */
-       uint32_t data_size;     /* data size following this header */
-       uint32_t padding_size;  /* Size of 0 padding the data */
+       uint64_t stream_id; /* Stream ID known by the relayd */
+       uint64_t net_seq_num; /* Network sequence number, per stream. */
+       uint32_t data_size; /* data size following this header */
+       uint32_t padding_size; /* Size of 0 padding the data */
 } LTTNG_PACKED;
 
 /*
@@ -124,7 +125,7 @@ struct lttcomm_relayd_metadata_payload {
  */
 struct lttcomm_relayd_close_stream {
        uint64_t stream_id;
-       uint64_t last_net_seq_num;      /* sequence number of last packet */
+       uint64_t last_net_seq_num; /* sequence number of last packet */
 } LTTNG_PACKED;
 
 /*
@@ -170,13 +171,11 @@ static inline size_t lttcomm_relayd_index_len(uint32_t major, uint32_t minor)
        if (major == 1) {
                switch (minor) {
                case 0:
-                       return offsetof(struct lttcomm_relayd_index, stream_id)
-                               + member_sizeof(struct lttcomm_relayd_index,
-                                               stream_id);
+                       return offsetof(struct lttcomm_relayd_index, stream_id) +
+                               member_sizeof(struct lttcomm_relayd_index, stream_id);
                case 1:
-                       return offsetof(struct lttcomm_relayd_index, packet_seq_num)
-                               + member_sizeof(struct lttcomm_relayd_index,
-                                               packet_seq_num);
+                       return offsetof(struct lttcomm_relayd_index, packet_seq_num) +
+                               member_sizeof(struct lttcomm_relayd_index, packet_seq_num);
                default:
                        abort();
                }
@@ -358,4 +357,4 @@ struct lttcomm_relayd_get_configuration_reply {
        char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH];
 } LTTNG_PACKED;
 
-#endif /* _RELAYD_COMM */
+#endif /* _RELAYD_COMM */
index e9cb85a05f6a30715b9928daee2aec537069bea4..982d517f1ad5a63d87ff7f8dce58a44290e89059 100644 (file)
 #ifndef _LTTNG_SESSIOND_COMM_H
 #define _LTTNG_SESSIOND_COMM_H
 
-#include <limits.h>
-#include <lttng/lttng.h>
-#include <lttng/snapshot-internal.hpp>
-#include <lttng/save-internal.hpp>
-#include <lttng/channel-internal.hpp>
-#include <lttng/trigger/trigger-internal.hpp>
-#include <lttng/rotate-internal.hpp>
+#include "inet.hpp"
+#include "inet6.hpp"
+
 #include <common/compat/socket.hpp>
 #include <common/compiler.hpp>
-#include <common/uri.hpp>
 #include <common/defaults.hpp>
-#include <common/uuid.hpp>
 #include <common/macros.hpp>
 #include <common/optional.hpp>
+#include <common/unix.hpp>
+#include <common/uri.hpp>
+#include <common/uuid.hpp>
+
+#include <lttng/channel-internal.hpp>
+#include <lttng/lttng.h>
+#include <lttng/rotate-internal.hpp>
+#include <lttng/save-internal.hpp>
+#include <lttng/snapshot-internal.hpp>
+#include <lttng/trigger/trigger-internal.hpp>
 
 #include <arpa/inet.h>
+#include <limits.h>
 #include <netinet/in.h>
 #include <stdint.h>
 #include <sys/un.h>
 
-#include "inet.hpp"
-#include "inet6.hpp"
-#include <common/unix.hpp>
-
 /* Queue size of listen(2) */
 #define LTTNG_SESSIOND_COMM_MAX_LISTEN 64
 
 /* Maximum number of FDs that can be sent over a Unix socket */
 #if defined(__linux__)
 /* Based on the kernel's SCM_MAX_FD which is 253 since 2.6.38 (255 before) */
-#define LTTCOMM_MAX_SEND_FDS           253
+#define LTTCOMM_MAX_SEND_FDS 253
 #else
-#define LTTCOMM_MAX_SEND_FDS           16
+#define LTTCOMM_MAX_SEND_FDS 16
 #endif
 
 enum lttcomm_sessiond_command {
@@ -97,14 +98,12 @@ enum lttcomm_sessiond_command {
        LTTCOMM_SESSIOND_COMMAND_MAX,
 };
 
-static inline
-bool lttcomm_sessiond_command_is_valid(enum lttcomm_sessiond_command cmd)
+static inline bool lttcomm_sessiond_command_is_valid(enum lttcomm_sessiond_command cmd)
 {
        return cmd > LTTCOMM_SESSIOND_COMMAND_MIN && cmd < LTTCOMM_SESSIOND_COMMAND_MAX;
 }
 
-static inline
-const char *lttcomm_sessiond_command_str(enum lttcomm_sessiond_command cmd)
+static inline const char *lttcomm_sessiond_command_str(enum lttcomm_sessiond_command cmd)
 {
        switch (cmd) {
        case LTTCOMM_SESSIOND_COMMAND_ADD_CONTEXT:
@@ -199,42 +198,41 @@ const char *lttcomm_sessiond_command_str(enum lttcomm_sessiond_command cmd)
 }
 
 enum lttcomm_relayd_command {
-       RELAYD_ADD_STREAM                   = 1,
-       RELAYD_CREATE_SESSION               = 2,
-       RELAYD_START_DATA                   = 3,
-       RELAYD_UPDATE_SYNC_INFO             = 4,
-       RELAYD_VERSION                      = 5,
-       RELAYD_SEND_METADATA                = 6,
-       RELAYD_CLOSE_STREAM                 = 7,
-       RELAYD_DATA_PENDING                 = 8,
-       RELAYD_QUIESCENT_CONTROL            = 9,
-       RELAYD_BEGIN_DATA_PENDING           = 10,
-       RELAYD_END_DATA_PENDING             = 11,
-       RELAYD_ADD_INDEX                    = 12,
-       RELAYD_SEND_INDEX                   = 13,
-       RELAYD_CLOSE_INDEX                  = 14,
+       RELAYD_ADD_STREAM = 1,
+       RELAYD_CREATE_SESSION = 2,
+       RELAYD_START_DATA = 3,
+       RELAYD_UPDATE_SYNC_INFO = 4,
+       RELAYD_VERSION = 5,
+       RELAYD_SEND_METADATA = 6,
+       RELAYD_CLOSE_STREAM = 7,
+       RELAYD_DATA_PENDING = 8,
+       RELAYD_QUIESCENT_CONTROL = 9,
+       RELAYD_BEGIN_DATA_PENDING = 10,
+       RELAYD_END_DATA_PENDING = 11,
+       RELAYD_ADD_INDEX = 12,
+       RELAYD_SEND_INDEX = 13,
+       RELAYD_CLOSE_INDEX = 14,
        /* Live-reading commands (2.4+). */
-       RELAYD_LIST_SESSIONS                = 15,
+       RELAYD_LIST_SESSIONS = 15,
        /* All streams of the channel have been sent to the relayd (2.4+). */
-       RELAYD_STREAMS_SENT                 = 16,
+       RELAYD_STREAMS_SENT = 16,
        /* Ask the relay to reset the metadata trace file (2.8+) */
-       RELAYD_RESET_METADATA               = 17,
+       RELAYD_RESET_METADATA = 17,
        /* Ask the relay to rotate a set of stream files (2.11+) */
-       RELAYD_ROTATE_STREAMS                = 18,
+       RELAYD_ROTATE_STREAMS = 18,
        /* Ask the relay to create a trace chunk (2.11+) */
-       RELAYD_CREATE_TRACE_CHUNK           = 19,
+       RELAYD_CREATE_TRACE_CHUNK = 19,
        /* Ask the relay to close a trace chunk (2.11+) */
-       RELAYD_CLOSE_TRACE_CHUNK            = 20,
+       RELAYD_CLOSE_TRACE_CHUNK = 20,
        /* Ask the relay whether a trace chunk exists (2.11+) */
-       RELAYD_TRACE_CHUNK_EXISTS           = 21,
+       RELAYD_TRACE_CHUNK_EXISTS = 21,
        /* Get the current configuration of a relayd peer (2.12+) */
-       RELAYD_GET_CONFIGURATION            = 22,
+       RELAYD_GET_CONFIGURATION = 22,
 
        /* Feature branch specific commands start at 10000. */
 };
 
-static inline
-const char *lttcomm_relayd_command_str(lttcomm_relayd_command cmd)
+static inline const char *lttcomm_relayd_command_str(lttcomm_relayd_command cmd)
 {
        switch (cmd) {
        case RELAYD_ADD_STREAM:
@@ -290,7 +288,7 @@ const char *lttcomm_relayd_command_str(lttcomm_relayd_command cmd)
  * lttcomm error code.
  */
 enum lttcomm_return_code {
-       LTTCOMM_CONSUMERD_SUCCESS            = 0,   /* Everything went fine. */
+       LTTCOMM_CONSUMERD_SUCCESS = 0, /* Everything went fine. */
        /*
         * Some code paths use -1 to express an error, others
         * negate this consumer return code. Starting codes at
@@ -298,39 +296,39 @@ enum lttcomm_return_code {
         * and legitimate status codes.
         */
        LTTCOMM_CONSUMERD_COMMAND_SOCK_READY = 100, /* Command socket ready */
-       LTTCOMM_CONSUMERD_SUCCESS_RECV_FD,          /* Success on receiving fds */
-       LTTCOMM_CONSUMERD_ERROR_RECV_FD,            /* Error on receiving fds */
-       LTTCOMM_CONSUMERD_ERROR_RECV_CMD,           /* Error on receiving command */
-       LTTCOMM_CONSUMERD_POLL_ERROR,               /* Error in polling thread */
-       LTTCOMM_CONSUMERD_POLL_NVAL,                /* Poll on closed fd */
-       LTTCOMM_CONSUMERD_POLL_HUP,                 /* All fds have hungup */
-       LTTCOMM_CONSUMERD_EXIT_SUCCESS,             /* Consumerd exiting normally */
-       LTTCOMM_CONSUMERD_EXIT_FAILURE,             /* Consumerd exiting on error */
-       LTTCOMM_CONSUMERD_OUTFD_ERROR,              /* Error opening the tracefile */
-       LTTCOMM_CONSUMERD_SPLICE_EBADF,             /* EBADF from splice(2) */
-       LTTCOMM_CONSUMERD_SPLICE_EINVAL,            /* EINVAL from splice(2) */
-       LTTCOMM_CONSUMERD_SPLICE_ENOMEM,            /* ENOMEM from splice(2) */
-       LTTCOMM_CONSUMERD_SPLICE_ESPIPE,            /* ESPIPE from splice(2) */
-       LTTCOMM_CONSUMERD_ENOMEM,                   /* Consumer is out of memory */
-       LTTCOMM_CONSUMERD_ERROR_METADATA,           /* Error with metadata. */
-       LTTCOMM_CONSUMERD_FATAL,                    /* Fatal error. */
-       LTTCOMM_CONSUMERD_RELAYD_FAIL,              /* Error on remote relayd */
-       LTTCOMM_CONSUMERD_CHANNEL_FAIL,             /* Channel creation failed. */
-       LTTCOMM_CONSUMERD_CHAN_NOT_FOUND,           /* Channel not found. */
-       LTTCOMM_CONSUMERD_ALREADY_SET,              /* Resource already set. */
-       LTTCOMM_CONSUMERD_ROTATION_FAIL,            /* Rotation has failed. */
-       LTTCOMM_CONSUMERD_SNAPSHOT_FAILED,          /* snapshot has failed. */
-       LTTCOMM_CONSUMERD_CREATE_TRACE_CHUNK_FAILED,/* Trace chunk creation failed. */
+       LTTCOMM_CONSUMERD_SUCCESS_RECV_FD, /* Success on receiving fds */
+       LTTCOMM_CONSUMERD_ERROR_RECV_FD, /* Error on receiving fds */
+       LTTCOMM_CONSUMERD_ERROR_RECV_CMD, /* Error on receiving command */
+       LTTCOMM_CONSUMERD_POLL_ERROR, /* Error in polling thread */
+       LTTCOMM_CONSUMERD_POLL_NVAL, /* Poll on closed fd */
+       LTTCOMM_CONSUMERD_POLL_HUP, /* All fds have hungup */
+       LTTCOMM_CONSUMERD_EXIT_SUCCESS, /* Consumerd exiting normally */
+       LTTCOMM_CONSUMERD_EXIT_FAILURE, /* Consumerd exiting on error */
+       LTTCOMM_CONSUMERD_OUTFD_ERROR, /* Error opening the tracefile */
+       LTTCOMM_CONSUMERD_SPLICE_EBADF, /* EBADF from splice(2) */
+       LTTCOMM_CONSUMERD_SPLICE_EINVAL, /* EINVAL from splice(2) */
+       LTTCOMM_CONSUMERD_SPLICE_ENOMEM, /* ENOMEM from splice(2) */
+       LTTCOMM_CONSUMERD_SPLICE_ESPIPE, /* ESPIPE from splice(2) */
+       LTTCOMM_CONSUMERD_ENOMEM, /* Consumer is out of memory */
+       LTTCOMM_CONSUMERD_ERROR_METADATA, /* Error with metadata. */
+       LTTCOMM_CONSUMERD_FATAL, /* Fatal error. */
+       LTTCOMM_CONSUMERD_RELAYD_FAIL, /* Error on remote relayd */
+       LTTCOMM_CONSUMERD_CHANNEL_FAIL, /* Channel creation failed. */
+       LTTCOMM_CONSUMERD_CHAN_NOT_FOUND, /* Channel not found. */
+       LTTCOMM_CONSUMERD_ALREADY_SET, /* Resource already set. */
+       LTTCOMM_CONSUMERD_ROTATION_FAIL, /* Rotation has failed. */
+       LTTCOMM_CONSUMERD_SNAPSHOT_FAILED, /* snapshot has failed. */
+       LTTCOMM_CONSUMERD_CREATE_TRACE_CHUNK_FAILED, /* Trace chunk creation failed. */
        LTTCOMM_CONSUMERD_CLOSE_TRACE_CHUNK_FAILED, /* Trace chunk close failed. */
-       LTTCOMM_CONSUMERD_INVALID_PARAMETERS,       /* Invalid parameters. */
+       LTTCOMM_CONSUMERD_INVALID_PARAMETERS, /* Invalid parameters. */
        LTTCOMM_CONSUMERD_TRACE_CHUNK_EXISTS_LOCAL, /* Trace chunk exists on consumer daemon. */
-       LTTCOMM_CONSUMERD_TRACE_CHUNK_EXISTS_REMOTE,/* Trace chunk exists on relay daemon. */
-       LTTCOMM_CONSUMERD_UNKNOWN_TRACE_CHUNK,      /* Unknown trace chunk. */
-       LTTCOMM_CONSUMERD_RELAYD_CLEAR_DISALLOWED,  /* Relayd does not accept clear command. */
-       LTTCOMM_CONSUMERD_UNKNOWN_ERROR,            /* Unknown error. */
+       LTTCOMM_CONSUMERD_TRACE_CHUNK_EXISTS_REMOTE, /* Trace chunk exists on relay daemon. */
+       LTTCOMM_CONSUMERD_UNKNOWN_TRACE_CHUNK, /* Unknown trace chunk. */
+       LTTCOMM_CONSUMERD_RELAYD_CLEAR_DISALLOWED, /* Relayd does not accept clear command. */
+       LTTCOMM_CONSUMERD_UNKNOWN_ERROR, /* Unknown error. */
 
        /* MUST be last element */
-       LTTCOMM_NR,                                             /* Last element */
+       LTTCOMM_NR, /* Last element */
 };
 
 /* lttng socket protocol. */
@@ -343,8 +341,8 @@ enum lttcomm_sock_proto {
  * Index in the net_families array below. Please keep in sync!
  */
 enum lttcomm_sock_domain {
-       LTTCOMM_INET      = 0,
-       LTTCOMM_INET6     = 1,
+       LTTCOMM_INET = 0,
+       LTTCOMM_INET6 = 1,
 };
 
 enum lttcomm_metadata_command {
@@ -393,19 +391,17 @@ struct lttcomm_relayd_sock {
 
 struct lttcomm_net_family {
        int family;
-       int (*create) (struct lttcomm_sock *sock, int type, int proto);
+       int (*create)(struct lttcomm_sock *sock, int type, int proto);
 };
 
 struct lttcomm_proto_ops {
-       int (*bind) (struct lttcomm_sock *sock);
-       int (*close) (struct lttcomm_sock *sock);
-       int (*connect) (struct lttcomm_sock *sock);
-       struct lttcomm_sock *(*accept) (struct lttcomm_sock *sock);
-       int (*listen) (struct lttcomm_sock *sock, int backlog);
-       ssize_t (*recvmsg) (struct lttcomm_sock *sock, void *buf, size_t len,
-                       int flags);
-       ssize_t (*sendmsg) (struct lttcomm_sock *sock, const void *buf,
-                       size_t len, int flags);
+       int (*bind)(struct lttcomm_sock *sock);
+       int (*close)(struct lttcomm_sock *sock);
+       int (*connect)(struct lttcomm_sock *sock);
+       struct lttcomm_sock *(*accept)(struct lttcomm_sock *sock);
+       int (*listen)(struct lttcomm_sock *sock, int backlog);
+       ssize_t (*recvmsg)(struct lttcomm_sock *sock, void *buf, size_t len, int flags);
+       ssize_t (*sendmsg)(struct lttcomm_sock *sock, const void *buf, size_t len, int flags);
 };
 
 struct process_attr_integral_value_comm {
@@ -419,7 +415,7 @@ struct process_attr_integral_value_comm {
  * Data structure received from lttng client to session daemon.
  */
 struct lttcomm_session_msg {
-       uint32_t cmd_type;      /* enum lttcomm_sessiond_command */
+       uint32_t cmd_type; /* enum lttcomm_sessiond_command */
        struct lttng_session session;
        struct lttng_domain domain;
        union {
@@ -464,7 +460,7 @@ struct lttcomm_session_msg {
                } LTTNG_PACKED snapshot_record;
                struct {
                        uint32_t nb_uri;
-                       unsigned int timer_interval;    /* usec */
+                       unsigned int timer_interval; /* usec */
                } LTTNG_PACKED session_live;
                struct {
                        struct lttng_save_session_attr attr;
@@ -538,17 +534,17 @@ struct lttcomm_session_msg {
        uint32_t fd_count;
 } LTTNG_PACKED;
 
-#define LTTNG_FILTER_MAX_LEN   65536
-#define LTTNG_SESSION_DESCRIPTOR_MAX_LEN       65536
+#define LTTNG_FILTER_MAX_LEN            65536
+#define LTTNG_SESSION_DESCRIPTOR_MAX_LEN 65536
 
 /*
  * Filter bytecode data. The reloc table is located at the end of the
  * bytecode. It is made of tuples: (uint16_t, var. len. string). It
  * starts at reloc_table_offset.
  */
-#define LTTNG_FILTER_PADDING   32
+#define LTTNG_FILTER_PADDING 32
 struct lttng_bytecode {
-       uint32_t len;   /* len of data */
+       uint32_t len; /* len of data */
        uint32_t reloc_table_offset;
        uint64_t seqnum;
        char padding[LTTNG_FILTER_PADDING];
@@ -560,15 +556,14 @@ struct lttng_bytecode {
  * by zero or more names, where the actual number of names is given by
  * the 'count' item of the structure.
  */
-#define LTTNG_EVENT_EXCLUSION_PADDING  32
+#define LTTNG_EVENT_EXCLUSION_PADDING 32
 struct lttng_event_exclusion {
        uint32_t count;
        char padding[LTTNG_EVENT_EXCLUSION_PADDING];
        char names[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH][LTTNG_SYMBOL_NAME_LEN];
 } LTTNG_PACKED;
 
-#define LTTNG_EVENT_EXCLUSION_NAME_AT(_exclusion, _i) \
-       ((_exclusion)->names[_i])
+#define LTTNG_EVENT_EXCLUSION_NAME_AT(_exclusion, _i) ((_exclusion)->names[_i])
 
 /*
  * Listing command header.
@@ -622,9 +617,9 @@ struct lttcomm_tracker_command_header {
  * Data structure for the response from sessiond to the lttng client.
  */
 struct lttcomm_lttng_msg {
-       uint32_t cmd_type;      /* enum lttcomm_sessiond_command */
-       uint32_t ret_code;      /* enum lttcomm_return_code */
-       uint32_t pid;           /* pid_t */
+       uint32_t cmd_type; /* enum lttcomm_sessiond_command */
+       uint32_t ret_code; /* enum lttcomm_return_code */
+       uint32_t pid; /* pid_t */
        uint32_t cmd_header_size;
        uint32_t data_size;
        uint32_t fd_count;
@@ -640,7 +635,7 @@ struct lttcomm_lttng_output_id {
  * operation.
  */
 struct lttcomm_consumer_msg {
-       uint32_t cmd_type;      /* enum lttng_consumer_command */
+       uint32_t cmd_type; /* enum lttng_consumer_command */
        union {
                struct {
                        uint64_t channel_key;
@@ -669,10 +664,10 @@ struct lttcomm_consumer_msg {
                struct {
                        uint64_t stream_key;
                        uint64_t channel_key;
-                       int32_t cpu;    /* On which CPU this stream is assigned. */
+                       int32_t cpu; /* On which CPU this stream is assigned. */
                        /* Tells the consumer if the stream should be or not monitored. */
                        uint32_t no_monitor;
-               } LTTNG_PACKED stream;  /* Only used by Kernel. */
+               } LTTNG_PACKED stream; /* Only used by Kernel. */
                struct {
                        uint64_t net_index;
                        enum lttng_stream_type type;
@@ -691,33 +686,33 @@ struct lttcomm_consumer_msg {
                        uint64_t session_id;
                } LTTNG_PACKED data_pending;
                struct {
-                       uint64_t subbuf_size;                   /* bytes */
-                       uint64_t num_subbuf;                    /* power of 2 */
-                       int32_t overwrite;                      /* 1: overwrite, 0: discard */
-                       uint32_t switch_timer_interval;         /* usec */
-                       uint32_t read_timer_interval;           /* usec */
-                       unsigned int live_timer_interval;       /* usec */
-                       uint8_t is_live;                        /* is part of a live session */
-                       uint32_t monitor_timer_interval;        /* usec */
-                       int32_t output;                         /* splice, mmap */
-                       int32_t type;                           /* metadata or per_cpu */
-                       uint64_t session_id;                    /* Tracing session id */
-                       char pathname[PATH_MAX];                /* Channel file path. */
-                       char name[LTTNG_SYMBOL_NAME_LEN];       /* Channel name. */
+                       uint64_t subbuf_size; /* bytes */
+                       uint64_t num_subbuf; /* power of 2 */
+                       int32_t overwrite; /* 1: overwrite, 0: discard */
+                       uint32_t switch_timer_interval; /* usec */
+                       uint32_t read_timer_interval; /* usec */
+                       unsigned int live_timer_interval; /* usec */
+                       uint8_t is_live; /* is part of a live session */
+                       uint32_t monitor_timer_interval; /* usec */
+                       int32_t output; /* splice, mmap */
+                       int32_t type; /* metadata or per_cpu */
+                       uint64_t session_id; /* Tracing session id */
+                       char pathname[PATH_MAX]; /* Channel file path. */
+                       char name[LTTNG_SYMBOL_NAME_LEN]; /* Channel name. */
                        /* Credentials used to open the UST buffer shared mappings. */
                        struct {
                                uint32_t uid;
                                uint32_t gid;
                        } LTTNG_PACKED buffer_credentials;
-                       uint64_t relayd_id;                     /* Relayd id if apply. */
-                       uint64_t key;                           /* Unique channel key. */
+                       uint64_t relayd_id; /* Relayd id if apply. */
+                       uint64_t key; /* Unique channel key. */
                        /* ID of the session's current trace chunk. */
                        LTTNG_OPTIONAL_COMM(uint64_t) LTTNG_PACKED chunk_id;
-                       unsigned char uuid[LTTNG_UUID_LEN];     /* uuid for ust tracer. */
-                       uint32_t chan_id;                       /* Channel ID on the tracer side. */
-                       uint64_t tracefile_size;        /* bytes */
-                       uint32_t tracefile_count;       /* number of tracefiles */
-                       uint64_t session_id_per_pid;    /* Per-pid session ID. */
+                       unsigned char uuid[LTTNG_UUID_LEN]; /* uuid for ust tracer. */
+                       uint32_t chan_id; /* Channel ID on the tracer side. */
+                       uint64_t tracefile_size; /* bytes */
+                       uint32_t tracefile_count; /* number of tracefiles */
+                       uint64_t session_id_per_pid; /* Per-pid session ID. */
                        /* Tells the consumer if the stream should be or not monitored. */
                        uint32_t monitor;
                        /*
@@ -738,29 +733,29 @@ struct lttcomm_consumer_msg {
                        uint64_t key;
                } LTTNG_PACKED destroy_channel;
                struct {
-                       uint64_t key;   /* Metadata channel key. */
-                       uint64_t target_offset; /* Offset in the consumer */
-                       uint64_t len;   /* Length of metadata to be received. */
+                       uint64_t key; /* Metadata channel key. */
+                       uint64_t target_offset; /* Offset in the consumer */
+                       uint64_t len; /* Length of metadata to be received. */
                        uint64_t version; /* Version of the metadata. */
                } LTTNG_PACKED push_metadata;
                struct {
-                       uint64_t key;   /* Metadata channel key. */
+                       uint64_t key; /* Metadata channel key. */
                } LTTNG_PACKED close_metadata;
                struct {
-                       uint64_t key;   /* Metadata channel key. */
+                       uint64_t key; /* Metadata channel key. */
                } LTTNG_PACKED setup_metadata;
                struct {
-                       uint64_t key;   /* Channel key. */
+                       uint64_t key; /* Channel key. */
                } LTTNG_PACKED flush_channel;
                struct {
-                       uint64_t key;   /* Channel key. */
+                       uint64_t key; /* Channel key. */
                } LTTNG_PACKED clear_quiescent_channel;
                struct {
                        char pathname[PATH_MAX];
                        /* Indicate if the snapshot goes on the relayd or locally. */
                        uint32_t use_relayd;
-                       uint32_t metadata;              /* This a metadata snapshot. */
-                       uint64_t relayd_id;             /* Relayd id if apply. */
+                       uint32_t metadata; /* This a metadata snapshot. */
+                       uint64_t relayd_id; /* Relayd id if apply. */
                        uint64_t key;
                        uint64_t nb_packets_per_stream;
                } LTTNG_PACKED snapshot_channel;
@@ -812,7 +807,8 @@ struct lttcomm_consumer_msg {
                        LTTNG_OPTIONAL_COMM(struct {
                                uint32_t uid;
                                uint32_t gid;
-                       } LTTNG_PACKED ) LTTNG_PACKED credentials;
+                       } LTTNG_PACKED)
+                       LTTNG_PACKED credentials;
                } LTTNG_PACKED create_trace_chunk;
                struct {
                        LTTNG_OPTIONAL_COMM(uint64_t) LTTNG_PACKED relayd_id;
@@ -903,8 +899,8 @@ struct lttcomm_ust_msg {
 struct lttcomm_ust_reply {
        uint32_t handle;
        uint32_t cmd;
-       uint32_t ret_code;      /* enum lttcomm_return_code */
-       uint32_t ret_val;       /* return value */
+       uint32_t ret_code; /* enum lttcomm_return_code */
+       uint32_t ret_val; /* return value */
        union {
                struct {
                        uint64_t memory_map_size;
@@ -921,30 +917,30 @@ struct lttcomm_ust_reply {
 const char *lttcomm_get_readable_code(enum lttcomm_return_code code);
 
 int lttcomm_init_inet_sockaddr(struct lttcomm_sockaddr *sockaddr,
-               const char *ip, unsigned int port);
+                              const char *ip,
+                              unsigned int port);
 int lttcomm_init_inet6_sockaddr(struct lttcomm_sockaddr *sockaddr,
-               const char *ip, unsigned int port);
+                               const char *ip,
+                               unsigned int port);
 
 struct lttcomm_sock *lttcomm_alloc_sock(enum lttcomm_sock_proto proto);
 int lttcomm_populate_sock_from_open_socket(struct lttcomm_sock *sock,
-               int fd,
-               enum lttcomm_sock_proto protocol);
+                                          int fd,
+                                          enum lttcomm_sock_proto protocol);
 int lttcomm_create_sock(struct lttcomm_sock *sock);
 struct lttcomm_sock *lttcomm_alloc_sock_from_uri(struct lttng_uri *uri);
 void lttcomm_destroy_sock(struct lttcomm_sock *sock);
 struct lttcomm_sock *lttcomm_alloc_copy_sock(struct lttcomm_sock *src);
-void lttcomm_copy_sock(struct lttcomm_sock *dst,
-               struct lttcomm_sock *src);
+void lttcomm_copy_sock(struct lttcomm_sock *dst, struct lttcomm_sock *src);
 
 /* Relayd socket object. */
-struct lttcomm_relayd_sock *lttcomm_alloc_relayd_sock(
-               struct lttng_uri *uri, uint32_t major, uint32_t minor);
+struct lttcomm_relayd_sock *
+lttcomm_alloc_relayd_sock(struct lttng_uri *uri, uint32_t major, uint32_t minor);
 
 int lttcomm_setsockopt_rcv_timeout(int sock, unsigned int msec);
 int lttcomm_setsockopt_snd_timeout(int sock, unsigned int msec);
 
-int lttcomm_sock_get_port(const struct lttcomm_sock *sock,
-               uint16_t *port);
+int lttcomm_sock_get_port(const struct lttcomm_sock *sock, uint16_t *port);
 /*
  * Set a port to an lttcomm_sock. This will have no effect is the socket is
  * already bound.
@@ -955,4 +951,4 @@ void lttcomm_init();
 /* Get network timeout, in milliseconds */
 unsigned long lttcomm_get_network_timeout();
 
-#endif /* _LTTNG_SESSIOND_COMM_H */
+#endif /* _LTTNG_SESSIOND_COMM_H */
index d7442152f16af428d433330c646d52d1db9d72b5..3018fb813034043798ba0f4f65d73643a2e0245c 100644 (file)
@@ -20,20 +20,16 @@ struct mi_writer;
 
 bool lttng_snapshot_output_validate(const struct lttng_snapshot_output *output);
 
-bool lttng_snapshot_output_is_equal(
-               const struct lttng_snapshot_output *a,
-               const struct lttng_snapshot_output *b);
+bool lttng_snapshot_output_is_equal(const struct lttng_snapshot_output *a,
+                                   const struct lttng_snapshot_output *b);
 
-int lttng_snapshot_output_serialize(
-               const struct lttng_snapshot_output *output,
-               struct lttng_payload *payload);
+int lttng_snapshot_output_serialize(const struct lttng_snapshot_output *output,
+                                   struct lttng_payload *payload);
 
-ssize_t lttng_snapshot_output_create_from_payload(
-               struct lttng_payload_view *view,
-               struct lttng_snapshot_output **output_p);
+ssize_t lttng_snapshot_output_create_from_payload(struct lttng_payload_view *view,
+                                                 struct lttng_snapshot_output **output_p);
 
-enum lttng_error_code lttng_snapshot_output_mi_serialize(
-               const struct lttng_snapshot_output *output,
-               struct mi_writer *writer);
+enum lttng_error_code lttng_snapshot_output_mi_serialize(const struct lttng_snapshot_output *output,
+                                                        struct mi_writer *writer);
 
 #endif /* COMMON_SNAPSHOT_H */
index 4c2fe0252824b30afcfa3404cf30534c8eb6d851..f7c7a82b5fde0ea2e4c98c62ba191cec8e24d126 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <lttng/lttng-export.h>
+
 #include <stdbool.h>
 
 /*
@@ -21,7 +22,7 @@
  * This symbol was mistakenly made public before the 2.12 release. It can't
  * be removed (but it can be stubbed-out if necessary).
  */
-extern "C" LTTNG_EXPORT
-int spawn_viewer(const char *trace_path, char *opt_viewer, bool opt_live_mode);
+extern "C" LTTNG_EXPORT int
+spawn_viewer(const char *trace_path, char *opt_viewer, bool opt_live_mode);
 
 #endif /* ifndef LTTNG_SPAWN_VIEWER_H */
index 244652332f1eee0d60a541baef9e53739b82b8b3..2cc9ed66ef2cd7c303166150b2bcd364b2a19b69 100644 (file)
@@ -16,6 +16,6 @@
  * assumes that no grouping/locale-aware formatting is performed (i.e. using
  * the `'` specifier in POSIX formatting functions).
  */
-#define MAX_INT_DEC_LEN(val)       ((3 * sizeof(val)) + 2)
+#define MAX_INT_DEC_LEN(val) ((3 * sizeof(val)) + 2)
 
 #endif /* _STRING_UTILS_FORMAT_H */
index 4be165f9c9508e38638c431f6a31d79ec97f79f3..f6c9b8f828360adc4b08437477f81c3d578f552b 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef _STRING_UTILS_H
 #define _STRING_UTILS_H
 
-#include <stdbool.h>
-#include <common/macros.hpp>
 #include <common/dynamic-array.hpp>
+#include <common/macros.hpp>
+
+#include <stdbool.h>
 
 void strutils_normalize_star_glob_pattern(char *pattern);
 
@@ -20,12 +21,14 @@ bool strutils_is_star_at_the_end_only_glob_pattern(const char *pattern);
 
 char *strutils_unescape_string(const char *input, char only_char);
 
-int strutils_split(const char *input, char delim, bool escape_delim,
-               struct lttng_dynamic_pointer_array *out_strings);
+int strutils_split(const char *input,
+                  char delim,
+                  bool escape_delim,
+                  struct lttng_dynamic_pointer_array *out_strings);
 
 void strutils_free_null_terminated_array_of_strings(char **array);
 
-size_t strutils_array_of_strings_len(char * const *array);
+size_t strutils_array_of_strings_len(char *const *array);
 
 /*
  * Append `append` to the malloc-end string `str`.
@@ -41,7 +44,6 @@ C_LINKAGE int strutils_append_str(char **str, const char *append);
  * Like `strutils_append_str`, but the appended string is formatted using
  * `fmt` and the following arguments.
  */
-C_LINKAGE ATTR_FORMAT_PRINTF(2, 3)
-int strutils_appendf(char **s, const char *fmt, ...);
+C_LINKAGE ATTR_FORMAT_PRINTF(2, 3) int strutils_appendf(char **s, const char *fmt, ...);
 
 #endif /* _STRING_UTILS_H */
index 33cb9aa340cc71e64939be17844aaea3e42fa26c..3682493eae4202750b083275dfae34dd82c9a621 100644 (file)
@@ -23,40 +23,38 @@ void *lttng_testpoint_lookup(const char *name);
  * set.
  * Return a non-zero error code to indicate failure.
  */
-#define testpoint(name)                                \
-       ((caa_unlikely(lttng_testpoint_activated))      \
-       ? __testpoint_##name##_wrapper() : 0)
+#define testpoint(name) \
+       ((caa_unlikely(lttng_testpoint_activated)) ? __testpoint_##name##_wrapper() : 0)
 
 /*
  * One wrapper per testpoint is generated. This is to keep track of the symbol
  * lookup status and the corresponding function pointer, if any.
  */
-#define _TESTPOINT_DECL(_name)                                         \
-       static inline int __testpoint_##_name##_wrapper(void)           \
-       {                                                               \
-               int ret = 0;                                            \
-               static int (*tp)(void);                                 \
-               static int found;                                       \
-               const char *tp_name = "__testpoint_" #_name;            \
-                                                                       \
-               if (tp) {                                               \
-                       ret = tp();                                     \
-               } else {                                                \
-                       if (!found) {                                   \
-                               tp = (int (*)(void)) lttng_testpoint_lookup(tp_name);   \
-                               if (tp) {                               \
-                                       found = 1;                      \
-                                       ret = tp();                     \
-                               } else {                                \
-                                       found = -1;                     \
-                               }                                       \
-                       }                                               \
-               }                                                       \
-               return ret;                                             \
+#define _TESTPOINT_DECL(_name)                                                        \
+       static inline int __testpoint_##_name##_wrapper(void)                         \
+       {                                                                             \
+               int ret = 0;                                                          \
+               static int (*tp)(void);                                               \
+               static int found;                                                     \
+               const char *tp_name = "__testpoint_" #_name;                          \
+                                                                                      \
+               if (tp) {                                                             \
+                       ret = tp();                                                   \
+               } else {                                                              \
+                       if (!found) {                                                 \
+                               tp = (int (*)(void)) lttng_testpoint_lookup(tp_name); \
+                               if (tp) {                                             \
+                                       found = 1;                                    \
+                                       ret = tp();                                   \
+                               } else {                                              \
+                                       found = -1;                                   \
+                               }                                                     \
+                       }                                                             \
+               }                                                                     \
+               return ret;                                                           \
        }
 
 /* Testpoint declaration */
-#define TESTPOINT_DECL(name)   \
-       _TESTPOINT_DECL(name)
+#define TESTPOINT_DECL(name) _TESTPOINT_DECL(name)
 
 #endif /* NTESTPOINT */
index 2c52f334cfe00b29aeb3e125f1e707413dbbc0a5..d07152c18a1dfd0167f368e0ca9272132571b07a 100644 (file)
@@ -8,38 +8,38 @@
 #ifndef LTTNG_TIME_H
 #define LTTNG_TIME_H
 
-#include <time.h>
+#include <common/compat/time.hpp>
+#include <common/macros.hpp>
+
 #include <ctime>
 #include <stdbool.h>
 #include <string>
+#include <time.h>
 
-#include <common/macros.hpp>
-#include <common/compat/time.hpp>
-
-#define MSEC_PER_SEC    1000ULL
-#define NSEC_PER_SEC    1000000000ULL
-#define NSEC_PER_MSEC   1000000ULL
-#define NSEC_PER_USEC   1000ULL
-#define USEC_PER_SEC    1000000ULL
-#define USEC_PER_MSEC   1000ULL
+#define MSEC_PER_SEC  1000ULL
+#define NSEC_PER_SEC  1000000000ULL
+#define NSEC_PER_MSEC 1000000ULL
+#define NSEC_PER_USEC 1000ULL
+#define USEC_PER_SEC  1000000ULL
+#define USEC_PER_MSEC 1000ULL
 
-#define SEC_PER_MINUTE  60ULL
+#define SEC_PER_MINUTE 60ULL
 #define MINUTE_PER_HOUR 60ULL
 
 #define USEC_PER_MINUTE (USEC_PER_SEC * SEC_PER_MINUTE)
-#define USEC_PER_HOURS  (USEC_PER_MINUTE * MINUTE_PER_HOUR)
+#define USEC_PER_HOURS (USEC_PER_MINUTE * MINUTE_PER_HOUR)
 
-#define ISO8601_STR_LEN sizeof("YYYYmmddTHHMMSS+HHMM")
+#define ISO8601_STR_LEN         sizeof("YYYYmmddTHHMMSS+HHMM")
 #define DATETIME_STR_LEN sizeof("YYYYmmdd-HHMMSS")
 
 bool locale_supports_utf8();
 
-#define NSEC_UNIT       "ns"
-#define USEC_UNIT       (locale_supports_utf8() ? "µs" : "us")
-#define MSEC_UNIT       "ms"
-#define SEC_UNIT        "s"
-#define MIN_UNIT        "m"
-#define HR_UNIT         "h"
+#define NSEC_UNIT "ns"
+#define USEC_UNIT (locale_supports_utf8() ? "µs" : "us")
+#define MSEC_UNIT "ms"
+#define SEC_UNIT  "s"
+#define MIN_UNIT  "m"
+#define HR_UNIT          "h"
 
 /*
  * timespec_to_ms: Convert timespec to milliseconds.
index 3731f33ba4569e62b089085f2e0671e00a481228..89125ca5033fd9e094593e3e412b4789238f6878 100644 (file)
@@ -8,12 +8,13 @@
 #ifndef LTTNG_TRACE_CHUNK_REGISTRY_H
 #define LTTNG_TRACE_CHUNK_REGISTRY_H
 
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
 #include <common/macros.hpp>
 #include <common/trace-chunk.hpp>
 
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
 struct lttng_trace_chunk_registry;
 
 /*
@@ -38,8 +39,7 @@ struct lttng_trace_chunk_registry *lttng_trace_chunk_registry_create();
  * (i.e. all references to the trace chunks it contains must be released) before
  * it is destroyed.
  */
-void lttng_trace_chunk_registry_destroy(
-               struct lttng_trace_chunk_registry *registry);
+void lttng_trace_chunk_registry_destroy(struct lttng_trace_chunk_registry *registry);
 
 /*
  * Publish a trace chunk for a given session id.
@@ -54,13 +54,14 @@ void lttng_trace_chunk_registry_destroy(
  *
  * Returns an lttng_trace_chunk on success, NULL on error.
  */
-struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
-               struct lttng_trace_chunk_registry *registry,
-               uint64_t session_id, struct lttng_trace_chunk *chunk);
+struct lttng_trace_chunk *
+lttng_trace_chunk_registry_publish_chunk(struct lttng_trace_chunk_registry *registry,
+                                        uint64_t session_id,
+                                        struct lttng_trace_chunk *chunk);
 /*
  * Adds the `previously_published` parameter which allows the caller
  * to know if a trace chunk equivalent to `chunk` was previously published.
- * 
+ *
  * The registry holds a reference to the published trace chunks it contains.
  * Trace chunks automatically unpublish themselves from their registry on
  * destruction.
@@ -68,7 +69,7 @@ struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
  * This information is necessary to drop the reference of newly published
  * chunks when a user doesn't wish to explicitly maintain all references
  * to a given trace chunk.
- * 
+ *
  * For instance, the relay daemon doesn't need the registry to hold a
  * reference since it controls the lifetime of its trace chunks.
  * Conversely, the consumer daemons rely on the session daemon to inform
@@ -76,10 +77,11 @@ struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
  * belong to a specific top-level object: they are always retrieved from
  * the registry by `id`.
  */
-struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
-               struct lttng_trace_chunk_registry *registry,
-               uint64_t session_id, struct lttng_trace_chunk *chunk,
-               bool *previously_published);
+struct lttng_trace_chunk *
+lttng_trace_chunk_registry_publish_chunk(struct lttng_trace_chunk_registry *registry,
+                                        uint64_t session_id,
+                                        struct lttng_trace_chunk *chunk,
+                                        bool *previously_published);
 
 /*
  * Look-up a trace chunk by session_id and chunk_id.
@@ -87,19 +89,18 @@ struct lttng_trace_chunk *lttng_trace_chunk_registry_publish_chunk(
  *
  * Returns an lttng_trace_chunk on success, NULL if the chunk does not exist.
  */
-struct lttng_trace_chunk *
-lttng_trace_chunk_registry_find_chunk(
-               const struct lttng_trace_chunk_registry *registry,
-               uint64_t session_id, uint64_t chunk_id);
+struct lttng_trace_chunk *lttng_trace_chunk_registry_find_chunk(
+       const struct lttng_trace_chunk_registry *registry, uint64_t session_id, uint64_t chunk_id);
 
 /*
  * Query the existence of a trace chunk by session_id and chunk_id.
  *
  * Returns 0 on success, a negative value on error.
  */
-int lttng_trace_chunk_registry_chunk_exists(
-               const struct lttng_trace_chunk_registry *registry,
-               uint64_t session_id, uint64_t chunk_id, bool *chunk_exists);
+int lttng_trace_chunk_registry_chunk_exists(const struct lttng_trace_chunk_registry *registry,
+                                           uint64_t session_id,
+                                           uint64_t chunk_id,
+                                           bool *chunk_exists);
 
 /*
  * Look-up an anonymous trace chunk by session_id.
@@ -108,11 +109,10 @@ int lttng_trace_chunk_registry_chunk_exists(
  * Returns an lttng_trace_chunk on success, NULL if the chunk does not exist.
  */
 struct lttng_trace_chunk *
-lttng_trace_chunk_registry_find_anonymous_chunk(
-               const struct lttng_trace_chunk_registry *registry,
-               uint64_t session_id);
+lttng_trace_chunk_registry_find_anonymous_chunk(const struct lttng_trace_chunk_registry *registry,
+                                               uint64_t session_id);
 
-unsigned int lttng_trace_chunk_registry_put_each_chunk(
-               const struct lttng_trace_chunk_registry *registry);
+unsigned int
+lttng_trace_chunk_registry_put_each_chunk(const struct lttng_trace_chunk_registry *registry);
 
 #endif /* LTTNG_TRACE_CHUNK_REGISTRY_H */
index 3fcf833c21ecba8b8ec0053323014b0dea97700f..5364f5cd6b93518264502cb01a0336607545bab1 100644 (file)
@@ -12,6 +12,7 @@
 #include <common/credentials.hpp>
 #include <common/fd-tracker/fd-tracker.hpp>
 #include <common/macros.hpp>
+
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
@@ -72,110 +73,101 @@ enum lttng_trace_chunk_command_type {
 
 struct lttng_trace_chunk *lttng_trace_chunk_create_anonymous();
 
-struct lttng_trace_chunk *lttng_trace_chunk_create(
-               uint64_t chunk_id,
-               time_t chunk_creation_time,
-               const char *path);
+struct lttng_trace_chunk *
+lttng_trace_chunk_create(uint64_t chunk_id, time_t chunk_creation_time, const char *path);
 
 void lttng_trace_chunk_set_fd_tracker(struct lttng_trace_chunk *chunk,
-               struct fd_tracker *fd_tracker);
+                                     struct fd_tracker *fd_tracker);
 
 /*
  * Copy a trace chunk. The copy that is returned is always a _user_
  * mode chunk even if the source chunk was an _owner_ as there can never be
  * two _owners_ of the same trace output.
  */
-struct lttng_trace_chunk *lttng_trace_chunk_copy(
-               struct lttng_trace_chunk *source_chunk);
+struct lttng_trace_chunk *lttng_trace_chunk_copy(struct lttng_trace_chunk *source_chunk);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_get_id(
-               struct lttng_trace_chunk *chunk, uint64_t *id);
+enum lttng_trace_chunk_status lttng_trace_chunk_get_id(struct lttng_trace_chunk *chunk,
+                                                      uint64_t *id);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_get_creation_timestamp(
-               struct lttng_trace_chunk *chunk, time_t *creation_ts);
+enum lttng_trace_chunk_status
+lttng_trace_chunk_get_creation_timestamp(struct lttng_trace_chunk *chunk, time_t *creation_ts);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_get_close_timestamp(
-               struct lttng_trace_chunk *chunk, time_t *close_ts);
+enum lttng_trace_chunk_status lttng_trace_chunk_get_close_timestamp(struct lttng_trace_chunk *chunk,
+                                                                   time_t *close_ts);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_set_close_timestamp(
-               struct lttng_trace_chunk *chunk, time_t close_ts);
+enum lttng_trace_chunk_status lttng_trace_chunk_set_close_timestamp(struct lttng_trace_chunk *chunk,
+                                                                   time_t close_ts);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_get_name(
-               struct lttng_trace_chunk *chunk, const char **name,
-               bool *name_overridden);
+enum lttng_trace_chunk_status lttng_trace_chunk_get_name(struct lttng_trace_chunk *chunk,
+                                                        const char **name,
+                                                        bool *name_overridden);
 
 bool lttng_trace_chunk_get_name_overridden(struct lttng_trace_chunk *chunk);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_override_name(
-               struct lttng_trace_chunk *chunk, const char *name);
+enum lttng_trace_chunk_status lttng_trace_chunk_override_name(struct lttng_trace_chunk *chunk,
+                                                             const char *name);
+
+enum lttng_trace_chunk_status lttng_trace_chunk_rename_path(struct lttng_trace_chunk *chunk,
+                                                           const char *path);
+
+enum lttng_trace_chunk_status
+lttng_trace_chunk_get_credentials(struct lttng_trace_chunk *chunk,
+                                 struct lttng_credentials *credentials);
+
+enum lttng_trace_chunk_status
+lttng_trace_chunk_set_credentials(struct lttng_trace_chunk *chunk,
+                                 const struct lttng_credentials *credentials);
+
+enum lttng_trace_chunk_status
+lttng_trace_chunk_set_credentials_current_user(struct lttng_trace_chunk *chunk);
+
+enum lttng_trace_chunk_status
+lttng_trace_chunk_set_as_owner(struct lttng_trace_chunk *chunk,
+                              struct lttng_directory_handle *session_output_directory);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_rename_path(
-               struct lttng_trace_chunk *chunk, const char *path);
+enum lttng_trace_chunk_status
+lttng_trace_chunk_set_as_user(struct lttng_trace_chunk *chunk,
+                             struct lttng_directory_handle *chunk_directory);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_get_credentials(
-               struct lttng_trace_chunk *chunk,
-               struct lttng_credentials *credentials);
+enum lttng_trace_chunk_status
+lttng_trace_chunk_get_session_output_directory_handle(struct lttng_trace_chunk *chunk,
+                                                     struct lttng_directory_handle **handle);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_set_credentials(
-               struct lttng_trace_chunk *chunk,
-               const struct lttng_credentials *credentials);
+enum lttng_trace_chunk_status
+lttng_trace_chunk_borrow_chunk_directory_handle(struct lttng_trace_chunk *chunk,
+                                               const struct lttng_directory_handle **handle);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_set_credentials_current_user(
-               struct lttng_trace_chunk *chunk);
+enum lttng_trace_chunk_status lttng_trace_chunk_create_subdirectory(struct lttng_trace_chunk *chunk,
+                                                                   const char *subdirectory_path);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_set_as_owner(
-               struct lttng_trace_chunk *chunk,
-               struct lttng_directory_handle *session_output_directory);
+enum lttng_trace_chunk_status lttng_trace_chunk_open_file(struct lttng_trace_chunk *chunk,
+                                                         const char *filename,
+                                                         int flags,
+                                                         mode_t mode,
+                                                         int *out_fd,
+                                                         bool expect_no_file);
 
-enum lttng_trace_chunk_status lttng_trace_chunk_set_as_user(
-               struct lttng_trace_chunk *chunk,
-               struct lttng_directory_handle *chunk_directory);
+enum lttng_trace_chunk_status lttng_trace_chunk_open_fs_handle(struct lttng_trace_chunk *chunk,
+                                                              const char *filename,
+                                                              int flags,
+                                                              mode_t mode,
+                                                              struct fs_handle **out_handle,
+                                                              bool expect_no_file);
+
+int lttng_trace_chunk_unlink_file(struct lttng_trace_chunk *chunk, const char *filename);
+
+enum lttng_trace_chunk_status
+lttng_trace_chunk_get_close_command(struct lttng_trace_chunk *chunk,
+                                   enum lttng_trace_chunk_command_type *command_type);
 
 enum lttng_trace_chunk_status
-lttng_trace_chunk_get_session_output_directory_handle(
-               struct lttng_trace_chunk *chunk,
-               struct lttng_directory_handle **handle);
-
-enum lttng_trace_chunk_status lttng_trace_chunk_borrow_chunk_directory_handle(
-               struct lttng_trace_chunk *chunk,
-               const struct lttng_directory_handle **handle);
-
-enum lttng_trace_chunk_status lttng_trace_chunk_create_subdirectory(
-               struct lttng_trace_chunk *chunk,
-               const char *subdirectory_path);
-
-enum lttng_trace_chunk_status lttng_trace_chunk_open_file(
-               struct lttng_trace_chunk *chunk,
-               const char *filename,
-               int flags,
-               mode_t mode,
-               int *out_fd,
-               bool expect_no_file);
-
-enum lttng_trace_chunk_status lttng_trace_chunk_open_fs_handle(
-               struct lttng_trace_chunk *chunk,
-               const char *filename,
-               int flags,
-               mode_t mode,
-               struct fs_handle **out_handle,
-               bool expect_no_file);
-
-int lttng_trace_chunk_unlink_file(struct lttng_trace_chunk *chunk,
-               const char *filename);
-
-enum lttng_trace_chunk_status lttng_trace_chunk_get_close_command(
-               struct lttng_trace_chunk *chunk,
-               enum lttng_trace_chunk_command_type *command_type);
-
-enum lttng_trace_chunk_status lttng_trace_chunk_set_close_command(
-               struct lttng_trace_chunk *chunk,
-               enum lttng_trace_chunk_command_type command_type);
-
-const char *lttng_trace_chunk_command_type_get_name(
-               enum lttng_trace_chunk_command_type command);
+lttng_trace_chunk_set_close_command(struct lttng_trace_chunk *chunk,
+                                   enum lttng_trace_chunk_command_type command_type);
+
+const char *lttng_trace_chunk_command_type_get_name(enum lttng_trace_chunk_command_type command);
 
 bool lttng_trace_chunk_ids_equal(const struct lttng_trace_chunk *chunk_a,
-               const struct lttng_trace_chunk *chunk_b);
+                                const struct lttng_trace_chunk *chunk_b);
 
 /* Returns true on success. */
 bool lttng_trace_chunk_get(struct lttng_trace_chunk *chunk);
index e53a2a18535627fd6ce13edbd7b69e77a2b958a1..3d6c20c3f47a74841042f74e0ad500d444302c8a 100644 (file)
@@ -9,14 +9,14 @@
 #ifndef LTTNG_COMMON_TRACKER_H
 #define LTTNG_COMMON_TRACKER_H
 
-#include <lttng/lttng-error.h>
-#include <lttng/tracker.h>
-
 #include <common/buffer-view.hpp>
 #include <common/dynamic-array.hpp>
 #include <common/macros.hpp>
 #include <common/sessiond-comm/sessiond-comm.hpp>
 
+#include <lttng/lttng-error.h>
+#include <lttng/tracker.h>
+
 struct process_attr_value {
        enum lttng_process_attr_value_type type;
        union value {
@@ -38,42 +38,37 @@ const char *lttng_process_attr_to_string(enum lttng_process_attr process_attr);
 struct lttng_process_attr_values *lttng_process_attr_values_create();
 
 /* Prefixed with '_' since the name conflicts with a public API. */
-unsigned int _lttng_process_attr_values_get_count(
-               const struct lttng_process_attr_values *values);
+unsigned int _lttng_process_attr_values_get_count(const struct lttng_process_attr_values *values);
 
-const struct process_attr_value *lttng_process_attr_tracker_values_get_at_index(
-               const struct lttng_process_attr_values *values,
-               unsigned int index);
+const struct process_attr_value *
+lttng_process_attr_tracker_values_get_at_index(const struct lttng_process_attr_values *values,
+                                              unsigned int index);
 
-int lttng_process_attr_values_serialize(
-               const struct lttng_process_attr_values *values,
-               struct lttng_dynamic_buffer *buffer);
+int lttng_process_attr_values_serialize(const struct lttng_process_attr_values *values,
+                                       struct lttng_dynamic_buffer *buffer);
 
-ssize_t lttng_process_attr_values_create_from_buffer(
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               const struct lttng_buffer_view *buffer_view,
-               struct lttng_process_attr_values **_values);
+ssize_t lttng_process_attr_values_create_from_buffer(enum lttng_domain_type domain,
+                                                    enum lttng_process_attr process_attr,
+                                                    const struct lttng_buffer_view *buffer_view,
+                                                    struct lttng_process_attr_values **_values);
 
-void lttng_process_attr_values_destroy(
-               struct lttng_process_attr_values *values);
+void lttng_process_attr_values_destroy(struct lttng_process_attr_values *values);
 
-struct process_attr_value *process_attr_value_copy(
-               const struct process_attr_value *value);
+struct process_attr_value *process_attr_value_copy(const struct process_attr_value *value);
 
 unsigned long process_attr_value_hash(const struct process_attr_value *a);
 
 bool process_attr_tracker_value_equal(const struct process_attr_value *a,
-               const struct process_attr_value *b);
+                                     const struct process_attr_value *b);
 
 void process_attr_value_destroy(struct process_attr_value *value);
 
-enum lttng_error_code process_attr_value_from_comm(
-               enum lttng_domain_type domain,
-               enum lttng_process_attr process_attr,
-               enum lttng_process_attr_value_type value_type,
-               const struct process_attr_integral_value_comm *integral_value,
-               const struct lttng_buffer_view *value_view,
-               struct process_attr_value **value);
+enum lttng_error_code
+process_attr_value_from_comm(enum lttng_domain_type domain,
+                            enum lttng_process_attr process_attr,
+                            enum lttng_process_attr_value_type value_type,
+                            const struct process_attr_integral_value_comm *integral_value,
+                            const struct lttng_buffer_view *value_view,
+                            struct process_attr_value **value);
 
 #endif /* LTTNG_COMMON_TRACKER_H */
index 22ddf2edb0a177b37f676de579ee286b2cc055d6..5a4984b716b6aea960c6bd3ecc6182fd08e196df 100644 (file)
@@ -8,13 +8,13 @@
 #ifndef _LTTCOMM_UNIX_H
 #define _LTTCOMM_UNIX_H
 
-#include <limits.h>
-#include <sys/un.h>
-
 #include <common/compat/socket.hpp>
 #include <common/macros.hpp>
-#include <common/payload.hpp>
 #include <common/payload-view.hpp>
+#include <common/payload.hpp>
+
+#include <limits.h>
+#include <sys/un.h>
 
 int lttcomm_create_unix_sock(const char *pathname);
 int lttcomm_create_anon_unix_socketpair(int *fds);
@@ -25,20 +25,17 @@ int lttcomm_close_unix_sock(int sock);
 
 /* Send a message accompanied by fd(s) over a unix socket. */
 ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd);
-ssize_t lttcomm_send_payload_view_fds_unix_sock(int sock,
-               struct lttng_payload_view *view);
-ssize_t lttcomm_send_fds_unix_sock_non_block(
-               int sock, const int *fds, size_t nb_fd);
+ssize_t lttcomm_send_payload_view_fds_unix_sock(int sock, struct lttng_payload_view *view);
+ssize_t lttcomm_send_fds_unix_sock_non_block(int sock, const int *fds, size_t nb_fd);
 ssize_t lttcomm_send_payload_view_fds_unix_sock_non_block(int sock,
-               struct lttng_payload_view *view);
+                                                         struct lttng_payload_view *view);
 
 /* Recv a message accompanied by fd(s) from a unix socket */
 ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
-ssize_t lttcomm_recv_payload_fds_unix_sock(int sock, size_t nb_fd,
-               struct lttng_payload *payload);
+ssize_t lttcomm_recv_payload_fds_unix_sock(int sock, size_t nb_fd, struct lttng_payload *payload);
 ssize_t lttcomm_recv_fds_unix_sock_non_block(int sock, int *fds, size_t nb_fd);
-ssize_t lttcomm_recv_payload_fds_unix_sock_non_block(int sock, size_t nb_fd,
-               struct lttng_payload *payload);
+ssize_t
+lttcomm_recv_payload_fds_unix_sock_non_block(int sock, size_t nb_fd, struct lttng_payload *payload);
 
 ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len);
 ssize_t lttcomm_recv_unix_sock_non_block(int sock, void *buf, size_t len);
@@ -46,9 +43,8 @@ ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len);
 ssize_t lttcomm_send_unix_sock_non_block(int sock, const void *buf, size_t len);
 
 ssize_t lttcomm_send_creds_unix_sock(int sock, const void *buf, size_t len);
-ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
-               lttng_sock_cred *creds);
+ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len, lttng_sock_cred *creds);
 
 int lttcomm_setsockopt_creds_unix_sock(int sock);
 
-#endif /* _LTTCOMM_UNIX_H */
+#endif /* _LTTCOMM_UNIX_H */
index edb53b7b59e0e842791a4ed9529e681f6d24439d..35bb2905c9e44cfeaf14b6e065d39696861ce8a6 100644 (file)
@@ -9,8 +9,8 @@
 #define LTTNG_URCU_H
 
 #define _LGPL_SOURCE
-#include <urcu.h>
 #include <mutex>
+#include <urcu.h>
 
 namespace lttng {
 namespace urcu {
index fe5c02afd2b7efbf554e71175678732c99e4fecc..7cc352943fa0f2dded7ea6a77fca49bb5c45de1b 100644 (file)
@@ -8,20 +8,22 @@
 #ifndef URI_H
 #define URI_H
 
-#include <netinet/in.h>
-#include <lttng/lttng.h>
 #include <common/macros.hpp>
 
+#include <lttng/lttng.h>
+
+#include <netinet/in.h>
+
 /* Destination type of lttng URI */
 enum lttng_dst_type {
-       LTTNG_DST_IPV4                        = 1,
-       LTTNG_DST_IPV6                        = 2,
-       LTTNG_DST_PATH                        = 3,
+       LTTNG_DST_IPV4 = 1,
+       LTTNG_DST_IPV6 = 2,
+       LTTNG_DST_PATH = 3,
 };
 
 /* Type of lttng URI where it is a final destination or a hop */
 enum lttng_uri_type {
-       LTTNG_URI_DST,  /* The URI is a final destination */
+       LTTNG_URI_DST, /* The URI is a final destination */
        /*
         * Hops are not supported yet but planned for a future release.
         *
@@ -40,8 +42,8 @@ enum lttng_stream_type {
  * should be ignored.
  */
 enum lttng_proto_type {
-       LTTNG_PROTO_TYPE_NONE                 = 0,
-       LTTNG_TCP                             = 1,
+       LTTNG_PROTO_TYPE_NONE = 0,
+       LTTNG_TCP = 1,
        /*
         * UDP protocol is not supported for now.
         *
@@ -69,8 +71,7 @@ struct lttng_uri {
 int uri_compare(struct lttng_uri *uri1, struct lttng_uri *uri2);
 void uri_free(struct lttng_uri *uri);
 ssize_t uri_parse(const char *str_uri, struct lttng_uri **uris);
-ssize_t uri_parse_str_urls(const char *ctrl_url, const char *data_url,
-               struct lttng_uri **uris);
+ssize_t uri_parse_str_urls(const char *ctrl_url, const char *data_url, struct lttng_uri **uris);
 int uri_to_str_url(struct lttng_uri *uri, char *dst, size_t size);
 
 #endif /* _LTT_URI_H */
index 1996a5b51572a137f13c8806db9ead70f949a4cb..7d0e00614ab89117d4ff770afdef383385c00e0f 100644 (file)
 
 #include <common/compat/errno.hpp>
 #include <common/consumer/consumer.hpp>
+
 #include <stdbool.h>
 
 #ifdef HAVE_LIBLTTNG_UST_CTL
 
 int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
-int lttng_ustconsumer_sample_snapshot_positions(
-               struct lttng_consumer_stream *stream);
+int lttng_ustconsumer_sample_snapshot_positions(struct lttng_consumer_stream *stream);
 
-int lttng_ustconsumer_get_produced_snapshot(
-               struct lttng_consumer_stream *stream, unsigned long *pos);
-int lttng_ustconsumer_get_consumed_snapshot(
-               struct lttng_consumer_stream *stream, unsigned long *pos);
+int lttng_ustconsumer_get_produced_snapshot(struct lttng_consumer_stream *stream,
+                                           unsigned long *pos);
+int lttng_ustconsumer_get_consumed_snapshot(struct lttng_consumer_stream *stream,
+                                           unsigned long *pos);
 
 int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
-               int sock, struct pollfd *consumer_sockpoll);
+                              int sock,
+                              struct pollfd *consumer_sockpoll);
 
 extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
 extern void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan);
@@ -33,246 +34,224 @@ extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
 extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
 
 int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
-               struct lttng_consumer_local_data *ctx);
+                                    struct lttng_consumer_local_data *ctx);
 int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
 
 void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
 
-int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream,
-               int producer_active);
-int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
-               uint64_t *stream_id);
+int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream, int producer_active);
+int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, uint64_t *stream_id);
 int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
 void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht);
 void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata);
 void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream);
-int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
-               uint64_t len, uint64_t version,
-               struct lttng_consumer_channel *channel, int timer, int wait);
+int lttng_ustconsumer_recv_metadata(int sock,
+                                   uint64_t key,
+                                   uint64_t offset,
+                                   uint64_t len,
+                                   uint64_t version,
+                                   struct lttng_consumer_channel *channel,
+                                   int timer,
+                                   int wait);
 int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
-               struct lttng_consumer_channel *channel, int timer, int wait);
-enum sync_metadata_status lttng_ustconsumer_sync_metadata(
-               struct lttng_consumer_local_data *ctx,
-               struct lttng_consumer_stream *metadata);
-int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
-               int producer);
+                                      struct lttng_consumer_channel *channel,
+                                      int timer,
+                                      int wait);
+enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
+                                                         struct lttng_consumer_stream *metadata);
+int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, int producer);
 int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream);
-int lttng_ustconsumer_get_current_timestamp(
-               struct lttng_consumer_stream *stream, uint64_t *ts);
-int lttng_ustconsumer_get_sequence_number(
-               struct lttng_consumer_stream *stream, uint64_t *seq);
+int lttng_ustconsumer_get_current_timestamp(struct lttng_consumer_stream *stream, uint64_t *ts);
+int lttng_ustconsumer_get_sequence_number(struct lttng_consumer_stream *stream, uint64_t *seq);
 void lttng_ustconsumer_sigbus_handle(void *addr);
 
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
-static inline
-ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
-               struct lttng_consumer_local_data *ctx __attribute__((unused)),
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               unsigned long len __attribute__((unused)),
-               unsigned long padding __attribute__((unused)))
+static inline ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
+       struct lttng_consumer_local_data *ctx __attribute__((unused)),
+       struct lttng_consumer_stream *stream __attribute__((unused)),
+       unsigned long len __attribute__((unused)),
+       unsigned long padding __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
-               struct lttng_consumer_local_data *ctx __attribute__((unused)),
-               struct lttng_consumer_stream *uststream __attribute__((unused)),
-               unsigned long len __attribute__((unused)),
-               unsigned long padding __attribute__((unused)))
+static inline ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
+       struct lttng_consumer_local_data *ctx __attribute__((unused)),
+       struct lttng_consumer_stream *uststream __attribute__((unused)),
+       unsigned long len __attribute__((unused)),
+       unsigned long padding __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_take_snapshot(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream
+                                                 __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_sample_snapshot_positions(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline int lttng_ustconsumer_sample_snapshot_positions(struct lttng_consumer_stream *stream
+                                                             __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_get_produced_snapshot(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               unsigned long *pos __attribute__((unused)))
+static inline int lttng_ustconsumer_get_produced_snapshot(struct lttng_consumer_stream *stream
+                                                         __attribute__((unused)),
+                                                         unsigned long *pos
+                                                         __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_get_consumed_snapshot(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               unsigned long *pos __attribute__((unused)))
+static inline int lttng_ustconsumer_get_consumed_snapshot(struct lttng_consumer_stream *stream
+                                                         __attribute__((unused)),
+                                                         unsigned long *pos
+                                                         __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_recv_cmd(
-               struct lttng_consumer_local_data *ctx __attribute__((unused)),
-               int sock __attribute__((unused)),
-               struct pollfd *consumer_sockpoll __attribute__((unused)))
+static inline int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx
+                                            __attribute__((unused)),
+                                            int sock __attribute__((unused)),
+                                            struct pollfd *consumer_sockpoll
+                                            __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-void lttng_ustconsumer_del_channel(
-               struct lttng_consumer_channel *chan __attribute__((unused)))
+static inline void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan
+                                                __attribute__((unused)))
 {
 }
 
-static inline
-void lttng_ustconsumer_free_channel(
-               struct lttng_consumer_channel *chan __attribute__((unused)))
+static inline void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan
+                                                 __attribute__((unused)))
 {
 }
 
-static inline
-int lttng_ustconsumer_add_stream(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream
+                                              __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-void lttng_ustconsumer_del_stream(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream
+                                               __attribute__((unused)))
 {
 }
 
-static inline
-int lttng_ustconsumer_read_subbuffer(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               struct lttng_consumer_local_data *ctx __attribute__((unused)))
+static inline int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream
+                                                  __attribute__((unused)),
+                                                  struct lttng_consumer_local_data *ctx
+                                                  __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_on_recv_stream(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream
+                                                  __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-void lttng_ustconsumer_on_stream_hangup(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream
+                                                     __attribute__((unused)))
 {
 }
 
-static inline
-int lttng_ustconsumer_data_pending(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream
+                                                __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream __attribute__((unused)),
-               int producer_active __attribute__((unused)))
+static inline int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream
+                                        __attribute__((unused)),
+                                        int producer_active __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-void lttng_ustconsumer_close_all_metadata(
-               struct lttng_ht *ht __attribute__((unused)))
+static inline void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht __attribute__((unused)))
 {
 }
 
-static inline
-void lttng_ustconsumer_close_metadata(
-               struct lttng_consumer_channel *metadata __attribute__((unused)))
+static inline void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata
+                                                   __attribute__((unused)))
 {
 }
-static inline
-void lttng_ustconsumer_close_stream_wakeup(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream
+                                                        __attribute__((unused)))
 {
 }
 
-static inline
-int lttng_ustconsumer_recv_metadata(int sock __attribute__((unused)),
-               uint64_t key __attribute__((unused)),
-               uint64_t offset __attribute__((unused)),
-               uint64_t len __attribute__((unused)),
-               uint64_t version __attribute__((unused)),
-               struct lttng_consumer_channel *channel __attribute__((unused)),
-               int timer __attribute__((unused)))
+static inline int lttng_ustconsumer_recv_metadata(int sock __attribute__((unused)),
+                                                 uint64_t key __attribute__((unused)),
+                                                 uint64_t offset __attribute__((unused)),
+                                                 uint64_t len __attribute__((unused)),
+                                                 uint64_t version __attribute__((unused)),
+                                                 struct lttng_consumer_channel *channel
+                                                 __attribute__((unused)),
+                                                 int timer __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_request_metadata(
-               struct lttng_consumer_local_data *ctx __attribute__((unused)),
-               struct lttng_consumer_channel *channel __attribute__((unused)),
-               int timer __attribute__((unused)),
-               int wait __attribute__((unused)))
+static inline int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx
+                                                    __attribute__((unused)),
+                                                    struct lttng_consumer_channel *channel
+                                                    __attribute__((unused)),
+                                                    int timer __attribute__((unused)),
+                                                    int wait __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-enum sync_metadata_status lttng_ustconsumer_sync_metadata(
-               struct lttng_consumer_local_data *ctx __attribute__((unused)),
-               struct lttng_consumer_stream *metadata __attribute__((unused)))
+static inline enum sync_metadata_status
+lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx __attribute__((unused)),
+                               struct lttng_consumer_stream *metadata __attribute__((unused)))
 {
        return SYNC_METADATA_STATUS_ERROR;
 }
 
-static inline
-int lttng_ustconsumer_flush_buffer(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               int producer __attribute__((unused)))
+static inline int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream
+                                                __attribute__((unused)),
+                                                int producer __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_clear_buffer(
-               struct lttng_consumer_stream *stream __attribute__((unused)))
+static inline int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream
+                                                __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_get_current_timestamp(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               uint64_t *ts __attribute__((unused)))
+static inline int lttng_ustconsumer_get_current_timestamp(struct lttng_consumer_stream *stream
+                                                         __attribute__((unused)),
+                                                         uint64_t *ts __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_get_sequence_number(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               uint64_t *seq __attribute__((unused)))
+static inline int lttng_ustconsumer_get_sequence_number(struct lttng_consumer_stream *stream
+                                                       __attribute__((unused)),
+                                                       uint64_t *seq __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-int lttng_ustconsumer_get_stream_id(
-               struct lttng_consumer_stream *stream __attribute__((unused)),
-               uint64_t *stream_id __attribute__((unused)))
+static inline int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream
+                                                 __attribute__((unused)),
+                                                 uint64_t *stream_id __attribute__((unused)))
 {
        return -ENOSYS;
 }
 
-static inline
-void lttng_ustconsumer_sigbus_handle(
-               void *addr __attribute__((unused)))
+static inline void lttng_ustconsumer_sigbus_handle(void *addr __attribute__((unused)))
 {
 }
 #endif /* HAVE_LIBLTTNG_UST_CTL */
index 12fafe2e3edef094cf944a80a625a638c794f818..b190a9b2852c52c352e75ac337818ba7e5e78f76 100644 (file)
@@ -8,15 +8,16 @@
 #ifndef _COMMON_UTILS_H
 #define _COMMON_UTILS_H
 
-#include <getopt.h>
+#include <common/compat/directory-handle.hpp>
+
 #include <lttng/lttng-error.h>
+
+#include <getopt.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <common/compat/directory-handle.hpp>
-
 #define KIBI_LOG2 10
 #define MEBI_LOG2 20
 #define GIBI_LOG2 30
@@ -30,11 +31,15 @@ int utils_set_fd_cloexec(int fd);
 int utils_create_pid_file(pid_t pid, const char *filepath);
 int utils_mkdir(const char *path, mode_t mode, int uid, int gid);
 int utils_mkdir_recursive(const char *path, mode_t mode, int uid, int gid);
-int utils_stream_file_path(const char *path_name, const char *file_name,
-               uint64_t size, uint64_t count, const char *suffix,
-               char *out_stream_path, size_t stream_path_len);
-int utils_parse_size_suffix(char const * const str, uint64_t * const size);
-int utils_parse_time_suffix(char const * const str, uint64_t * const time_us);
+int utils_stream_file_path(const char *path_name,
+                          const char *file_name,
+                          uint64_t size,
+                          uint64_t count,
+                          const char *suffix,
+                          char *out_stream_path,
+                          size_t stream_path_len);
+int utils_parse_size_suffix(char const *const str, uint64_t *const size);
+int utils_parse_time_suffix(char const *const str, uint64_t *const time_us);
 int utils_get_count_order_u32(uint32_t x);
 int utils_get_count_order_u64(uint64_t x);
 const char *utils_get_home_dir();
@@ -44,8 +49,7 @@ size_t utils_get_current_time_str(const char *format, char *dst, size_t len)
        ATTR_FORMAT_STRFTIME(1);
 
 int utils_get_group_id(const char *name, bool warn, gid_t *gid);
-char *utils_generate_optstring(const struct option *long_options,
-               size_t opt_count);
+char *utils_generate_optstring(const struct option *long_options, size_t opt_count);
 int utils_create_lock_file(const char *filepath);
 int utils_recursive_rmdir(const char *path);
 int utils_truncate_stream_file(int fd, off_t length);
@@ -53,10 +57,8 @@ int utils_show_help(int section, const char *page_name, const char *help_msg);
 int utils_get_memory_available(uint64_t *value);
 int utils_get_memory_total(uint64_t *value);
 int utils_change_working_directory(const char *path);
-enum lttng_error_code utils_user_id_from_name(
-               const char *user_name, uid_t *user_id);
-enum lttng_error_code utils_group_id_from_name(
-               const char *group_name, gid_t *group_id);
+enum lttng_error_code utils_user_id_from_name(const char *user_name, uid_t *user_id);
+enum lttng_error_code utils_group_id_from_name(const char *group_name, gid_t *group_id);
 
 /*
  * Parse `str` as an unsigned long long value.
@@ -66,7 +68,6 @@ enum lttng_error_code utils_group_id_from_name(
  * - `str` is zero length
  * - `str` contains invalid
  */
-int utils_parse_unsigned_long_long(const char *str,
-               unsigned long long *value);
+int utils_parse_unsigned_long_long(const char *str, unsigned long long *value);
 
 #endif /* _COMMON_UTILS_H */
index 586c2ad67c06fcdaac63c39759dee0e95ae8a7d6..9bec2d55ae08f8fe50ae73c726bdaa5bbd31de15 100644 (file)
@@ -9,34 +9,34 @@
 #define LTTNG_UUID_H
 
 #include <common/macros.hpp>
+
+#include <array>
+#include <inttypes.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include <inttypes.h>
-#include <array>
 #include <string>
 
 /*
  * Includes final \0.
  */
-#define LTTNG_UUID_STR_LEN     37
-#define LTTNG_UUID_LEN         16
-#define LTTNG_UUID_VER         4
+#define LTTNG_UUID_STR_LEN 37
+#define LTTNG_UUID_LEN    16
+#define LTTNG_UUID_VER    4
 
-#define LTTNG_UUID_FMT \
-       "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "-%02" SCNx8 \
-       "%02" SCNx8 "-%02" SCNx8 "%02" SCNx8 "-%02" SCNx8 "%02" SCNx8 \
-       "-%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 \
-       "%02" SCNx8
+#define LTTNG_UUID_FMT                                                                        \
+       "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "-%02" SCNx8 "%02" SCNx8 "-%02" SCNx8 \
+       "%02" SCNx8 "-%02" SCNx8 "%02" SCNx8 "-%02" SCNx8 "%02" SCNx8 "%02" SCNx8 "%02" SCNx8 \
+       "%02" SCNx8 "%02" SCNx8
 
-#define LTTNG_UUID_FMT_VALUES(uuid) \
-       (uuid)[0], (uuid)[1], (uuid)[2], (uuid)[3], (uuid)[4], (uuid)[5], \
-       (uuid)[6], (uuid)[7], (uuid)[8], (uuid)[9], (uuid)[10], (uuid)[11], \
-       (uuid)[12], (uuid)[13], (uuid)[14], (uuid)[15]
+#define LTTNG_UUID_FMT_VALUES(uuid)                                                               \
+       (uuid)[0], (uuid)[1], (uuid)[2], (uuid)[3], (uuid)[4], (uuid)[5], (uuid)[6], (uuid)[7],   \
+               (uuid)[8], (uuid)[9], (uuid)[10], (uuid)[11], (uuid)[12], (uuid)[13], (uuid)[14], \
+               (uuid)[15]
 
-#define LTTNG_UUID_SCAN_VALUES(uuid) \
-       &(uuid)[0], &(uuid)[1], &(uuid)[2], &(uuid)[3], &(uuid)[4], &(uuid)[5], \
-       &(uuid)[6], &(uuid)[7], &(uuid)[8], &(uuid)[9], &(uuid)[10], &(uuid)[11], \
-       &(uuid)[12], &(uuid)[13], &(uuid)[14], &(uuid)[15]
+#define LTTNG_UUID_SCAN_VALUES(uuid)                                                        \
+       &(uuid)[0], &(uuid)[1], &(uuid)[2], &(uuid)[3], &(uuid)[4], &(uuid)[5], &(uuid)[6], \
+               &(uuid)[7], &(uuid)[8], &(uuid)[9], &(uuid)[10], &(uuid)[11], &(uuid)[12],  \
+               &(uuid)[13], &(uuid)[14], &(uuid)[15]
 
 using lttng_uuid = std::array<uint8_t, LTTNG_UUID_LEN>;
 
index 75c9ac447da2ce1320c9bf6c26d5a1b458abc7c1..d88fe0f66af96a1029afe019e925fb6d2cb7d809 100644 (file)
 
 #define _LGPL_SOURCE
 
+#include "macros.hpp"
+
+#include <stdbool.h>
 #include <stdint.h>
 #include <urcu/wfstack.h>
-#include <stdbool.h>
-#include "macros.hpp"
 
 struct lttng_waiter {
        struct cds_wfs_node wait_queue_node;
index 8ec35907459eb7bad89ae27c413e1f9165049016..c490f8993c0c1ca55b31613dbad82d1142bce47b 100644 (file)
@@ -13,8 +13,8 @@
 #define _LGPL_SOURCE
 #include "lttng-ctl-helper.hpp"
 
-#include <common/compiler.hpp>
 #include <common/compat/errno.hpp>
+#include <common/compiler.hpp>
 #include <common/defaults.hpp>
 #include <common/utils.hpp>
 
index 4b025a4e268d753543b7929e59c2dc15e63a1d9b..843462e9f4d91b4161cee7de3f5e61418995a011 100644 (file)
@@ -8,14 +8,14 @@
 #ifndef LTTNG_CTL_HELPER_H
 #define LTTNG_CTL_HELPER_H
 
-#include <stdio.h>
-
 #include <common/sessiond-comm/sessiond-comm.hpp>
+
 #include <lttng/lttng.h>
 
+#include <stdio.h>
+
 /* Copy helper functions. */
-void lttng_ctl_copy_lttng_domain(struct lttng_domain *dst,
-               struct lttng_domain *src);
+void lttng_ctl_copy_lttng_domain(struct lttng_domain *dst, struct lttng_domain *src);
 
 /*
  * Sends the lttcomm message to the session daemon and fills buf if the
@@ -25,10 +25,13 @@ void lttng_ctl_copy_lttng_domain(struct lttng_domain *dst,
  * error code. If buf is NULL, 0 is returned on success.
  */
 int lttng_ctl_ask_sessiond_fds_varlen(struct lttcomm_session_msg *lsm,
-               const int *fds, size_t nb_fd,
-               const void *vardata, size_t vardata_len,
-               void **user_payload_buf, void **user_cmd_header_buf,
-               size_t *user_cmd_header_len);
+                                     const int *fds,
+                                     size_t nb_fd,
+                                     const void *vardata,
+                                     size_t vardata_len,
+                                     void **user_payload_buf,
+                                     void **user_cmd_header_buf,
+                                     size_t *user_cmd_header_len);
 
 /*
  * Sends the lttcomm message to the session daemon and fills the reply payload.
@@ -36,37 +39,34 @@ int lttng_ctl_ask_sessiond_fds_varlen(struct lttcomm_session_msg *lsm,
  * Return the size of the received data on success or else a negative lttng
  * error code.
  */
-int lttng_ctl_ask_sessiond_payload(struct lttng_payload_view *message,
-               struct lttng_payload *reply);
+int lttng_ctl_ask_sessiond_payload(struct lttng_payload_view *message, struct lttng_payload *reply);
 
 /*
  * Calls lttng_ctl_ask_sessiond_fds_varlen() with no expected command header.
  */
-static inline int lttng_ctl_ask_sessiond_varlen_no_cmd_header(
-               struct lttcomm_session_msg *lsm,
-               const void *vardata,
-               size_t vardata_len,
-               void **user_payload_buf)
+static inline int lttng_ctl_ask_sessiond_varlen_no_cmd_header(struct lttcomm_session_msg *lsm,
+                                                             const void *vardata,
+                                                             size_t vardata_len,
+                                                             void **user_payload_buf)
 {
-       return lttng_ctl_ask_sessiond_fds_varlen(lsm, NULL, 0, vardata,
-               vardata_len, user_payload_buf, NULL, NULL);
+       return lttng_ctl_ask_sessiond_fds_varlen(
+               lsm, NULL, 0, vardata, vardata_len, user_payload_buf, NULL, NULL);
 }
 
 /*
  * Calls lttng_ctl_ask_sessiond_fds_varlen() with fds and no expected command header.
  */
-static inline
-int lttng_ctl_ask_sessiond_fds_no_cmd_header(struct lttcomm_session_msg *lsm,
-               const int *fds, size_t nb_fd, void **buf __attribute__((unused)))
+static inline int lttng_ctl_ask_sessiond_fds_no_cmd_header(struct lttcomm_session_msg *lsm,
+                                                          const int *fds,
+                                                          size_t nb_fd,
+                                                          void **buf __attribute__((unused)))
 {
-       return lttng_ctl_ask_sessiond_fds_varlen(lsm, fds, nb_fd, NULL,
-               0, NULL, NULL, NULL);
+       return lttng_ctl_ask_sessiond_fds_varlen(lsm, fds, nb_fd, NULL, 0, NULL, NULL, NULL);
 }
 /*
  * Use this if no variable length data needs to be sent.
  */
-static inline
-int lttng_ctl_ask_sessiond(struct lttcomm_session_msg *lsm, void **buf)
+static inline int lttng_ctl_ask_sessiond(struct lttcomm_session_msg *lsm, void **buf)
 {
        return lttng_ctl_ask_sessiond_varlen_no_cmd_header(lsm, NULL, 0, buf);
 }
index aa1c964c399180ce95dc769ce5f1cfa404bc7536..7a8b549f1b59b6e34a5572dff34ab13eb70b6095 100644 (file)
@@ -6,12 +6,11 @@
  */
 
 #include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
 #include <linux/perf_event.h>
 #include <perfmon/perf_event.h>
 #include <perfmon/pfmlib_perf_event.h>
+#include <stdio.h>
+#include <string.h>
 
 int main(int argc, char **argv)
 {
@@ -25,14 +24,16 @@ int main(int argc, char **argv)
        struct perf_event_attr attr;
 
        if (argc != 2) {
-               fprintf(stderr, "Usage: %s <pmu counter to find>\n"
-                               "ex: %s UNHALTED_REFERENCE_CYCLES\n"
-                               "Returns the event raw number if found and actionable with"
-                               "return code 0.\n"
-                               "If not found returns 1,"
-                               "If not actionable return 2,"
-                               "on error returns 255\n",
-                               argv[0], argv[0]);
+               fprintf(stderr,
+                       "Usage: %s <pmu counter to find>\n"
+                       "ex: %s UNHALTED_REFERENCE_CYCLES\n"
+                       "Returns the event raw number if found and actionable with"
+                       "return code 0.\n"
+                       "If not found returns 1,"
+                       "If not actionable return 2,"
+                       "on error returns 255\n",
+                       argv[0],
+                       argv[0]);
                ret = -1;
                goto end;
        }
@@ -54,18 +55,15 @@ int main(int argc, char **argv)
 
        ret = pfm_initialize();
        if (ret != PFM_SUCCESS) {
-               fprintf(stderr, "Failed to initialise libpfm: %s",
-                               pfm_strerror(ret));
+               fprintf(stderr, "Failed to initialise libpfm: %s", pfm_strerror(ret));
                ret = 255;
                goto end;
        }
 
-       ret = pfm_get_os_event_encoding(argv[1],
-                       PFM_PLM0 | PFM_PLM1 | PFM_PLM2 | PFM_PLM3,
-                       PFM_OS_PERF_EVENT, &pencoder);
+       ret = pfm_get_os_event_encoding(
+               argv[1], PFM_PLM0 | PFM_PLM1 | PFM_PLM2 | PFM_PLM3, PFM_OS_PERF_EVENT, &pencoder);
        if (ret != PFM_SUCCESS) {
-               fprintf(stderr, "libpfm: error pfm_get_os_event_encoding: %s\n",
-                               pfm_strerror(ret));
+               fprintf(stderr, "libpfm: error pfm_get_os_event_encoding: %s\n", pfm_strerror(ret));
                ret = 1;
                goto end;
        }
@@ -93,8 +91,7 @@ int main(int argc, char **argv)
        /* perf_event_open is provided by perfmon/perf_event.h. */
        fd = perf_event_open(pencoder.attr, 0, -1, -1, 0);
        if (fd == -1) {
-               fprintf(stderr, "perf: error perf_event_open: %d: %s\n", errno,
-                               strerror(errno));
+               fprintf(stderr, "perf: error perf_event_open: %d: %s\n", errno, strerror(errno));
                ret = 2;
                goto end;
        }
index d4f8a57bd8650355163eb59ce717caad955ab4b6..681d191785f13340c62dfd507f0bf56cfbf82813 100644 (file)
@@ -46,8 +46,17 @@ int main(int argc, char **argv)
 
        for (i = 0; i < nr_iter; i++) {
                netint = htonl(i);
-               tracepoint(tp, tptest, i, netint, values, text, strlen(text), escape, dbl, flt,
-                       net_values);
+               tracepoint(tp,
+                          tptest,
+                          i,
+                          netint,
+                          values,
+                          text,
+                          strlen(text),
+                          escape,
+                          dbl,
+                          flt,
+                          net_values);
                usleep(nr_usec);
        }
 
index ce2b6d1e9498f24a0f76c4c3a6c643805178cca1..44ca83573bd8c097939d697ad6d0a0b8b030bc50 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(tp, tptest,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               char *, etext, double, doublearg, float, floatarg,
-               uint32_t *, net_values),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_array_network(uint32_t, arrfield3, net_values, 3)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_sequence_network(uint32_t, seqfield3, net_values, size_t, 3)
-               ctf_sequence(long, seqfield4, values, size_t, 3)
-               ctf_string(stringfield, text)
-               ctf_string(stringfield2, etext)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
+TRACEPOINT_EVENT(
+       tp,
+       tptest,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               char *,
+               etext,
+               double,
+               doublearg,
+               float,
+               floatarg,
+               uint32_t *,
+               net_values),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_array_network(
+                                         uint32_t,
+                                         arrfield3,
+                                         net_values,
+                                         3) ctf_sequence(char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_sequence_network(uint32_t,
+                                                                      seqfield3,
+                                                                      net_values,
+                                                                      size_t,
+                                                                      3) ctf_sequence(long,
+                                                                                      seqfield4,
+                                                                                      values,
+                                                                                      size_t,
+                                                                                      3)
+                                                         ctf_string(stringfield,
+                                                                    text) ctf_string(stringfield2,
+                                                                                     etext)
+                                                                 ctf_float(float,
+                                                                           floatfield,
+                                                                           floatarg)
+                                                                         ctf_float(double,
+                                                                                   doublefield,
+                                                                                   doublearg)))
 
 #endif /* _TRACEPOINT_TP_H */
 
index deeab67b91b5c07fa698cb65c885261ebc7d4e01..805eff8840c26203d367fb9bbf5a9db7d55ad025 100644 (file)
@@ -6,17 +6,16 @@
  *
  */
 
+#include <lttng/health.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include <lttng/health.h>
-
 static const char *relayd_path;
 
-static
-int check_component(struct lttng_health *lh, const char *component_name,
-               int ok_if_not_running)
+static int
+check_component(struct lttng_health *lh, const char *component_name, int ok_if_not_running)
 {
        const struct lttng_health_thread *thread;
        int nr_threads, i, status;
@@ -25,8 +24,7 @@ int check_component(struct lttng_health *lh, const char *component_name,
                if (ok_if_not_running) {
                        return 0;
                }
-               fprintf(stderr, "Error querying %s health\n",
-                       component_name);
+               fprintf(stderr, "Error querying %s health\n", component_name);
                return -1;
        }
        status = lttng_health_state(lh);
@@ -54,15 +52,13 @@ int check_component(struct lttng_health *lh, const char *component_name,
                        continue;
                }
                printf("Thread \"%s\" is not responding in component \"%s\".\n",
-                       lttng_health_thread_name(thread),
-                       component_name);
-
+                      lttng_health_thread_name(thread),
+                      component_name);
        }
        return status;
 }
 
-static
-int check_sessiond(void)
+static int check_sessiond(void)
 {
        struct lttng_health *lh;
        int status;
@@ -80,8 +76,7 @@ int check_sessiond(void)
        return status;
 }
 
-static
-int check_consumerd(enum lttng_health_consumerd hc)
+static int check_consumerd(enum lttng_health_consumerd hc)
 {
        struct lttng_health *lh;
        int status;
@@ -104,8 +99,7 @@ int check_consumerd(enum lttng_health_consumerd hc)
        return status;
 }
 
-static
-int check_relayd(const char *path)
+static int check_relayd(const char *path)
 {
        struct lttng_health *lh;
        int status;
@@ -129,11 +123,12 @@ int main(int argc, char *argv[])
 
        for (i = 1; i < argc; i++) {
                size_t relayd_path_arg_len = strlen("--relayd-path=");
-               if (!strncmp(argv[i], "--relayd-path=",
-                               relayd_path_arg_len)) {
+               if (!strncmp(argv[i], "--relayd-path=", relayd_path_arg_len)) {
                        relayd_path = &argv[i][relayd_path_arg_len];
                } else {
-                       fprintf(stderr, "Unknown option \"%s\". Try --relayd-path=PATH.\n", argv[i]);
+                       fprintf(stderr,
+                               "Unknown option \"%s\". Try --relayd-path=PATH.\n",
+                               argv[i]);
                        exit(EXIT_FAILURE);
                }
        }
index 6520337e4c41ec7ea7b0dad06c66a21cff55fab7..2994694fda1be8d2c818fc3c653ef617eebb0170 100644 (file)
@@ -7,17 +7,17 @@
  */
 
 #include <lttng/lttng-export.h>
+
+#include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
 #include <urcu.h>
 
 /*
  * Check if the specified environment variable is set.
  * Return 1 if set, otherwise 0.
  */
-static
-int check_env_var(const char *env)
+static int check_env_var(const char *env)
 {
        if (env) {
                char *env_val = getenv(env);
index d01ad4cb9210c2b854af4165b5c96fdec0e37c98..c88e5742a30b08ec6cac328e0ff5de742986a9c1 100644 (file)
@@ -7,9 +7,10 @@
  */
 
 #include <lttng/lttng-export.h>
+
+#include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
 #include <unistd.h>
 #include <urcu.h>
 
@@ -19,8 +20,7 @@
  * Check if the specified environment variable is set.
  * Return 1 if set, otherwise 0.
  */
-static
-int check_env_var(const char *env)
+static int check_env_var(const char *env)
 {
        if (env) {
                char *env_val = getenv(env);
@@ -32,8 +32,7 @@ int check_env_var(const char *env)
        return 0;
 }
 
-static
-void do_stall(void)
+static void do_stall(void)
 {
        unsigned int sleep_time = STALL_TIME;
 
index b7e1a9f42f8eef81fa0be4ef55d924eec30c3034..1f7158aea34457782fb6a7e34005e88795f3b672 100644 (file)
@@ -9,12 +9,6 @@
  *
  */
 
-#include <stdio.h>
-#include <stdbool.h>
-#include <string.h>
-#include <unistd.h>
-#include <inttypes.h>
-
 #include <lttng/action/action.h>
 #include <lttng/action/list.h>
 #include <lttng/action/notify.h>
 #include <lttng/condition/evaluation.h>
 #include <lttng/domain.h>
 #include <lttng/endpoint.h>
+#include <lttng/lttng-error.h>
 #include <lttng/notification/channel.h>
 #include <lttng/notification/notification.h>
 #include <lttng/trigger/trigger.h>
-#include <lttng/lttng-error.h>
+
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 
 static unsigned int nr_notifications = 0;
 static unsigned int nr_expected_notifications = 0;
@@ -39,12 +39,10 @@ static bool use_action_list = false;
 static enum lttng_condition_type buffer_usage_type = LTTNG_CONDITION_TYPE_UNKNOWN;
 static enum lttng_domain_type domain_type = LTTNG_DOMAIN_NONE;
 
-int handle_condition(
-               const struct lttng_condition *condition,
-               const struct lttng_evaluation *condition_evaluation);
+int handle_condition(const struct lttng_condition *condition,
+                    const struct lttng_evaluation *condition_evaluation);
 
-static
-int parse_arguments(char **argv)
+static int parse_arguments(char **argv)
 {
        int sscanf_ret;
        const char *domain_type_string = NULL;
@@ -91,32 +89,29 @@ int parse_arguments(char **argv)
        /* Ratio or bytes ? */
        if (!strcasecmp("bytes", buffer_usage_threshold_type)) {
                is_threshold_ratio = false;
-               sscanf_ret = sscanf(buffer_usage_threshold_value, "%" SCNu64,
-                               &threshold_bytes);
+               sscanf_ret = sscanf(buffer_usage_threshold_value, "%" SCNu64, &threshold_bytes);
                if (sscanf_ret != 1) {
                        printf("error: Invalid buffer usage threshold value bytes (integer), sscanf returned %d\n",
-                                       sscanf_ret);
+                              sscanf_ret);
                        goto error;
                }
        }
 
        if (!strcasecmp("ratio", buffer_usage_threshold_type)) {
                is_threshold_ratio = true;
-               sscanf_ret = sscanf(buffer_usage_threshold_value, "%lf",
-                               &threshold_ratio);
+               sscanf_ret = sscanf(buffer_usage_threshold_value, "%lf", &threshold_ratio);
                if (sscanf_ret != 1) {
                        printf("error: Invalid buffer usage threshold value ratio (float), sscanf returned %d\n",
-                                       sscanf_ret);
+                              sscanf_ret);
                        goto error;
                }
        }
 
        /* Number of notification to expect */
-       sscanf_ret = sscanf(nr_expected_notifications_string, "%d",
-                       &nr_expected_notifications);
+       sscanf_ret = sscanf(nr_expected_notifications_string, "%d", &nr_expected_notifications);
        if (sscanf_ret != 1) {
                printf("error: Invalid nr_expected_notifications, sscanf returned %d\n",
-                               sscanf_ret);
+                      sscanf_ret);
                goto error;
        }
 
@@ -162,8 +157,8 @@ int main(int argc, char **argv)
        }
 
        /* Setup */
-       notification_channel = lttng_notification_channel_create(
-                       lttng_session_daemon_notification_endpoint);
+       notification_channel =
+               lttng_notification_channel_create(lttng_session_daemon_notification_endpoint);
        if (!notification_channel) {
                printf("error: Could not create notification channel\n");
                ret = 1;
@@ -191,10 +186,10 @@ int main(int argc, char **argv)
 
        if (is_threshold_ratio) {
                condition_status = lttng_condition_buffer_usage_set_threshold_ratio(
-                               condition, threshold_ratio);
+                       condition, threshold_ratio);
        } else {
-               condition_status = lttng_condition_buffer_usage_set_threshold(
-                               condition, threshold_bytes);
+               condition_status =
+                       lttng_condition_buffer_usage_set_threshold(condition, threshold_bytes);
        }
 
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
@@ -203,22 +198,19 @@ int main(int argc, char **argv)
                goto end;
        }
 
-       condition_status = lttng_condition_buffer_usage_set_session_name(
-                       condition, session_name);
+       condition_status = lttng_condition_buffer_usage_set_session_name(condition, session_name);
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
                printf("error: Could not set session name\n");
                ret = 1;
                goto end;
        }
-       condition_status = lttng_condition_buffer_usage_set_channel_name(
-                       condition, channel_name);
+       condition_status = lttng_condition_buffer_usage_set_channel_name(condition, channel_name);
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
                printf("error: Could not set channel name\n");
                ret = 1;
                goto end;
        }
-       condition_status = lttng_condition_buffer_usage_set_domain_type(
-                       condition, domain_type);
+       condition_status = lttng_condition_buffer_usage_set_domain_type(condition, domain_type);
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
                printf("error: Could not set domain type\n");
                ret = 1;
@@ -302,9 +294,8 @@ int main(int argc, char **argv)
                        goto end;
                }
                /* Receive the next notification. */
-               status = lttng_notification_channel_get_next_notification(
-                               notification_channel,
-                               &notification);
+               status = lttng_notification_channel_get_next_notification(notification_channel,
+                                                                         &notification);
 
                switch (status) {
                case LTTNG_NOTIFICATION_CHANNEL_STATUS_OK:
@@ -355,9 +346,8 @@ end:
        return ret;
 }
 
-int handle_condition(
-               const struct lttng_condition *condition,
-               const struct lttng_evaluation *evaluation)
+int handle_condition(const struct lttng_condition *condition,
+                    const struct lttng_evaluation *evaluation)
 {
        int ret = 0;
        const char *string_low = "low";
@@ -379,22 +369,19 @@ int handle_condition(
        }
 
        /* Fetch info to test */
-       ret = lttng_condition_buffer_usage_get_session_name(condition,
-                       &condition_session_name);
+       ret = lttng_condition_buffer_usage_get_session_name(condition, &condition_session_name);
        if (ret) {
                printf("error: session name could not be fetched\n");
                ret = 1;
                goto end;
        }
-       ret = lttng_condition_buffer_usage_get_channel_name(condition,
-                       &condition_channel_name);
+       ret = lttng_condition_buffer_usage_get_channel_name(condition, &condition_channel_name);
        if (ret) {
                printf("error: channel name could not be fetched\n");
                ret = 1;
                goto end;
        }
-       ret = lttng_condition_buffer_usage_get_domain_type(condition,
-                       &condition_domain_type);
+       ret = lttng_condition_buffer_usage_get_domain_type(condition, &condition_domain_type);
        if (ret) {
                printf("error: domain type could not be fetched\n");
                ret = 1;
@@ -420,8 +407,7 @@ int handle_condition(
        }
 
        if (is_threshold_ratio) {
-               lttng_evaluation_buffer_usage_get_usage_ratio(
-                               evaluation, &buffer_usage_ratio);
+               lttng_evaluation_buffer_usage_get_usage_ratio(evaluation, &buffer_usage_ratio);
                switch (condition_type) {
                case LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW:
                        if (buffer_usage_ratio > threshold_ratio) {
@@ -443,8 +429,7 @@ int handle_condition(
                        goto end;
                }
        } else {
-               lttng_evaluation_buffer_usage_get_usage(
-                               evaluation, &buffer_usage_bytes);
+               lttng_evaluation_buffer_usage_get_usage(evaluation, &buffer_usage_bytes);
                switch (condition_type) {
                case LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW:
                        if (buffer_usage_bytes > threshold_bytes) {
index 55ee2e69e79b15c37d7464150b94b6ae87e2397d..1007de44ee18e5d7ce987c8b14714a512b97c145 100644 (file)
@@ -9,12 +9,13 @@
  *
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <tap/tap.h>
+#include <lttng/lttng.h>
+
 #include <stdint.h>
+#include <stdio.h>
 #include <string.h>
-#include <lttng/lttng.h>
+#include <tap/tap.h>
+#include <unistd.h>
 
 #define TEST_COUNT 36
 
@@ -25,41 +26,35 @@ struct session {
 
 uint64_t expected_rotation_id = UINT64_MAX;
 
-static
-int test_condition(struct lttng_condition *condition, const char *type_name)
+static int test_condition(struct lttng_condition *condition, const char *type_name)
 {
        int ret = 0;
        const char *out_session_name;
-       const char * const session_name = "test session name";
+       const char *const session_name = "test session name";
        enum lttng_condition_status status;
 
-       status = lttng_condition_session_rotation_get_session_name(condition,
-                       &out_session_name);
+       status = lttng_condition_session_rotation_get_session_name(condition, &out_session_name);
        ok(status == LTTNG_CONDITION_STATUS_UNSET,
-                       "Getting unset name of %s condition fails with LTTNG_CONDITION_STATUS_UNSET",
-                       type_name);
+          "Getting unset name of %s condition fails with LTTNG_CONDITION_STATUS_UNSET",
+          type_name);
 
-       status = lttng_condition_session_rotation_set_session_name(condition,
-                       session_name);
+       status = lttng_condition_session_rotation_set_session_name(condition, session_name);
        ok(status == LTTNG_CONDITION_STATUS_OK,
-                       "Setting session name \"%s\" of %s condition succeeds",
-                       session_name, type_name);
+          "Setting session name \"%s\" of %s condition succeeds",
+          session_name,
+          type_name);
 
-       status = lttng_condition_session_rotation_get_session_name(condition,
-                       &out_session_name);
-       ok(status == LTTNG_CONDITION_STATUS_OK,
-                       "Getting name of %s condition succeeds",
-                       type_name);
+       status = lttng_condition_session_rotation_get_session_name(condition, &out_session_name);
+       ok(status == LTTNG_CONDITION_STATUS_OK, "Getting name of %s condition succeeds", type_name);
 
        ok(out_session_name && !strcmp(session_name, out_session_name),
-                       "Session name returned by %s condition matches the expected name",
-                       type_name);
+          "Session name returned by %s condition matches the expected name",
+          type_name);
        return ret;
 }
 
-static
-int setup_rotation_trigger(const struct session *session,
-               struct lttng_notification_channel *notification_channel)
+static int setup_rotation_trigger(const struct session *session,
+                                 struct lttng_notification_channel *notification_channel)
 {
        int ret;
        struct lttng_condition *rotation_ongoing_condition = NULL;
@@ -78,8 +73,7 @@ int setup_rotation_trigger(const struct session *session,
        }
 
        /* Create rotation ongoing and completed conditions. */
-       rotation_ongoing_condition =
-                       lttng_condition_session_rotation_ongoing_create();
+       rotation_ongoing_condition = lttng_condition_session_rotation_ongoing_create();
        ok(rotation_ongoing_condition, "Create session rotation ongoing condition");
        if (!rotation_ongoing_condition) {
                ret = -1;
@@ -90,15 +84,14 @@ int setup_rotation_trigger(const struct session *session,
                goto end;
        }
        condition_status = lttng_condition_session_rotation_set_session_name(
-                       rotation_ongoing_condition, session->name);
+               rotation_ongoing_condition, session->name);
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
                ret = -1;
                diag("Failed to set session name on session rotation ongoing condition");
                goto end;
        }
 
-       rotation_completed_condition =
-                       lttng_condition_session_rotation_completed_create();
+       rotation_completed_condition = lttng_condition_session_rotation_completed_create();
        ok(rotation_completed_condition, "Create session rotation completed condition");
        if (!rotation_completed_condition) {
                ret = -1;
@@ -110,42 +103,38 @@ int setup_rotation_trigger(const struct session *session,
                goto end;
        }
        condition_status = lttng_condition_session_rotation_set_session_name(
-                       rotation_completed_condition, session->name);
+               rotation_completed_condition, session->name);
        if (condition_status != LTTNG_CONDITION_STATUS_OK) {
                ret = -1;
                goto end;
        }
 
        notification_channel_status = lttng_notification_channel_subscribe(
-                       notification_channel, rotation_ongoing_condition);
+               notification_channel, rotation_ongoing_condition);
        ok(notification_channel_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK,
-                       "Subscribe to session rotation ongoing notifications");
-       if (notification_channel_status !=
-                       LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
+          "Subscribe to session rotation ongoing notifications");
+       if (notification_channel_status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
                ret = -1;
                goto end;
        }
        notification_channel_status = lttng_notification_channel_subscribe(
-                       notification_channel, rotation_completed_condition);
+               notification_channel, rotation_completed_condition);
        ok(notification_channel_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK,
-                       "Subscribe to session rotation completed notifications");
-       if (notification_channel_status !=
-                       LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
+          "Subscribe to session rotation completed notifications");
+       if (notification_channel_status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
                ret = -1;
                goto end;
        }
 
        /* Create rotation ongoing and completed triggers. */
-       rotation_ongoing_trigger = lttng_trigger_create(
-                       rotation_ongoing_condition, notify);
+       rotation_ongoing_trigger = lttng_trigger_create(rotation_ongoing_condition, notify);
        ok(rotation_ongoing_trigger, "Create a rotation ongoing notification trigger");
        if (!rotation_ongoing_trigger) {
                ret = -1;
                goto end;
        }
 
-       rotation_completed_trigger = lttng_trigger_create(
-                       rotation_completed_condition, notify);
+       rotation_completed_trigger = lttng_trigger_create(rotation_completed_condition, notify);
        ok(rotation_completed_trigger, "Create a rotation completed notification trigger");
        if (!rotation_completed_trigger) {
                ret = -1;
@@ -153,18 +142,15 @@ int setup_rotation_trigger(const struct session *session,
        }
 
        /* Register rotation ongoing and completed triggers. */
-       ret_code = lttng_register_trigger_with_automatic_name(
-                       rotation_ongoing_trigger);
+       ret_code = lttng_register_trigger_with_automatic_name(rotation_ongoing_trigger);
        ok(ret_code == LTTNG_OK, "Registered session rotation ongoing trigger");
        if (ret_code != LTTNG_OK) {
                ret = -ret_code;
                goto end;
        }
 
-       ret_code = lttng_register_trigger_with_automatic_name(
-                       rotation_completed_trigger);
-       ok(ret_code == LTTNG_OK,
-                       "Registered session rotation completed trigger");
+       ret_code = lttng_register_trigger_with_automatic_name(rotation_completed_trigger);
+       ok(ret_code == LTTNG_OK, "Registered session rotation completed trigger");
        if (ret_code != LTTNG_OK) {
                ret = -ret_code;
                goto end;
@@ -179,12 +165,10 @@ end:
        return ret;
 }
 
-static
-int test_notification(
-               struct lttng_notification_channel *notification_channel,
-               const struct session *session,
-               const char *expected_notification_type_name,
-               enum lttng_condition_type expected_condition_type)
+static int test_notification(struct lttng_notification_channel *notification_channel,
+                            const struct session *session,
+                            const char *expected_notification_type_name,
+                            enum lttng_condition_type expected_condition_type)
 {
        int ret = 0;
        bool notification_pending;
@@ -202,28 +186,28 @@ int test_notification(
        const char *chunk_path = NULL;
 
        notification_channel_status = lttng_notification_channel_has_pending_notification(
-                       notification_channel, &notification_pending);
+               notification_channel, &notification_pending);
        ok(notification_channel_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK,
-                       "Check for %s notification pending on notification channel",
-                       expected_notification_type_name);
+          "Check for %s notification pending on notification channel",
+          expected_notification_type_name);
        if (notification_channel_status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
                ret = -1;
                goto end;
        }
 
        ok(notification_pending,
-                       "Session %s notification is pending on notification channel",
-                       expected_notification_type_name);
+          "Session %s notification is pending on notification channel",
+          expected_notification_type_name);
        if (!notification_pending) {
                ret = -1;
                goto end;
        }
 
        notification_channel_status = lttng_notification_channel_get_next_notification(
-                       notification_channel, &notification);
+               notification_channel, &notification);
        ok(notification_channel_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK && notification,
-                       "Get %s notification from notification channel",
-                       expected_notification_type_name);
+          "Get %s notification from notification channel",
+          expected_notification_type_name);
        if (notification_channel_status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK || !notification) {
                ret = -1;
                goto end;
@@ -238,18 +222,18 @@ int test_notification(
 
        condition_type = lttng_condition_get_type(condition);
        ok(condition_type == expected_condition_type,
-                       "Notification condition obtained from notification channel is of type \"%s\"",
-                       expected_notification_type_name);
+          "Notification condition obtained from notification channel is of type \"%s\"",
+          expected_notification_type_name);
        if (condition_type != expected_condition_type) {
                ret = -1;
                goto end;
        }
 
-       condition_status = lttng_condition_session_rotation_get_session_name(
-                       condition, &session_name);
+       condition_status =
+               lttng_condition_session_rotation_get_session_name(condition, &session_name);
        ok(condition_status == LTTNG_CONDITION_STATUS_OK && session_name &&
-                       !strcmp(session_name, session->name),
-                       "Condition obtained from notification has the correct session name assigned");
+                  !strcmp(session_name, session->name),
+          "Condition obtained from notification has the correct session name assigned");
        if (condition_status != LTTNG_CONDITION_STATUS_OK || !session_name) {
                ret = -1;
                goto end;
@@ -263,18 +247,17 @@ int test_notification(
        }
        condition_type = lttng_evaluation_get_type(evaluation);
        ok(condition_type == expected_condition_type,
-                       "Condition evaluation obtained from notification channel is of type \"%s\"",
-                       expected_notification_type_name);
+          "Condition evaluation obtained from notification channel is of type \"%s\"",
+          expected_notification_type_name);
        if (condition_type != expected_condition_type) {
                ret = -1;
                goto end;
        }
 
-       evaluation_status = lttng_evaluation_session_rotation_get_id(evaluation,
-                       &rotation_id);
+       evaluation_status = lttng_evaluation_session_rotation_get_id(evaluation, &rotation_id);
        ok(evaluation_status == LTTNG_EVALUATION_STATUS_OK,
-                       "Get %s id from notification evaluation",
-                       expected_notification_type_name);
+          "Get %s id from notification evaluation",
+          expected_notification_type_name);
        if (evaluation_status != LTTNG_EVALUATION_STATUS_OK) {
                ret = -1;
                goto end;
@@ -288,51 +271,52 @@ int test_notification(
                goto end;
        }
 
-       evaluation_status = lttng_evaluation_session_rotation_completed_get_location(
-                       evaluation, &location);
+       evaluation_status =
+               lttng_evaluation_session_rotation_completed_get_location(evaluation, &location);
        ok(evaluation_status == LTTNG_EVALUATION_STATUS_OK && location,
-                       "Get session %s chunk location from evaluation",
-                       expected_notification_type_name);
+          "Get session %s chunk location from evaluation",
+          expected_notification_type_name);
        if (evaluation_status != LTTNG_EVALUATION_STATUS_OK || !location) {
                ret = -1;
                goto end;
        }
 
-       ok(lttng_trace_archive_location_get_type(location) == LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL,
-                       "Location returned from the session rotation completed notification is of type 'local'");
+       ok(lttng_trace_archive_location_get_type(location) ==
+                  LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL,
+          "Location returned from the session rotation completed notification is of type 'local'");
 
-       location_status = lttng_trace_archive_location_local_get_absolute_path(
-                       location, &chunk_path);
+       location_status =
+               lttng_trace_archive_location_local_get_absolute_path(location, &chunk_path);
        ok(location_status == LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK && chunk_path,
-                       "Retrieved path from location returned by the session rotation completed notification");
+          "Retrieved path from location returned by the session rotation completed notification");
        diag("Chunk available at %s", chunk_path ? chunk_path : "NULL");
 
        ok(chunk_path && !strncmp(session->output_path, chunk_path, strlen(session->output_path)),
-                       "Returned path from location starts with the output path");
+          "Returned path from location starts with the output path");
 
 end:
        lttng_notification_destroy(notification);
        return ret;
 }
 
-static
-int test_rotation_ongoing_notification(
-               struct lttng_notification_channel *notification_channel,
-               struct session *session)
+static int
+test_rotation_ongoing_notification(struct lttng_notification_channel *notification_channel,
+                                  struct session *session)
 {
-       return test_notification(notification_channel, session,
-                       "rotation ongoing",
-                       LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING);
+       return test_notification(notification_channel,
+                                session,
+                                "rotation ongoing",
+                                LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING);
 }
 
-static
-int test_rotation_completed_notification(
-               struct lttng_notification_channel *notification_channel,
-               struct session *session)
+static int
+test_rotation_completed_notification(struct lttng_notification_channel *notification_channel,
+                                    struct session *session)
 {
-       return test_notification(notification_channel, session,
-                       "rotation completed",
-                       LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED);
+       return test_notification(notification_channel,
+                                session,
+                                "rotation completed",
+                                LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED);
 }
 
 int main(int argc, const char *argv[])
@@ -342,8 +326,7 @@ int main(int argc, const char *argv[])
        struct lttng_notification_channel *notification_channel = NULL;
        struct lttng_rotation_handle *rotation_handle = NULL;
        enum lttng_rotation_status rotation_status;
-       enum lttng_rotation_state rotation_state =
-                       LTTNG_ROTATION_STATE_NO_ROTATION;
+       enum lttng_rotation_state rotation_state = LTTNG_ROTATION_STATE_NO_ROTATION;
 
        if (argc != 3) {
                puts("Usage: rotation SESSION_NAME SESSION_OUTPUT_PATH");
@@ -356,8 +339,8 @@ int main(int argc, const char *argv[])
 
        plan_tests(TEST_COUNT);
 
-       notification_channel = lttng_notification_channel_create(
-                       lttng_session_daemon_notification_endpoint);
+       notification_channel =
+               lttng_notification_channel_create(lttng_session_daemon_notification_endpoint);
        if (!notification_channel) {
                diag("Failed to create notification channel");
                ret = -1;
@@ -371,20 +354,19 @@ int main(int argc, const char *argv[])
 
        /* Start rotation and wait for its completion. */
        ret = lttng_rotate_session(session.name, NULL, &rotation_handle);
-       ok(ret >= 0 && rotation_handle, "Start rotation of session \"%s\"",
-                       session.name);
+       ok(ret >= 0 && rotation_handle, "Start rotation of session \"%s\"", session.name);
        if (ret < 0 || !rotation_handle) {
                goto error;
        }
 
        do {
-               rotation_status = lttng_rotation_handle_get_state(
-                               rotation_handle, &rotation_state);
+               rotation_status = lttng_rotation_handle_get_state(rotation_handle, &rotation_state);
        } while (rotation_state == LTTNG_ROTATION_STATE_ONGOING &&
-                       rotation_status == LTTNG_ROTATION_STATUS_OK);
+                rotation_status == LTTNG_ROTATION_STATUS_OK);
        ok(rotation_status == LTTNG_ROTATION_STATUS_OK &&
-                       rotation_state == LTTNG_ROTATION_STATE_COMPLETED,
-                       "Complete rotation of session \"%s\"", session.name);
+                  rotation_state == LTTNG_ROTATION_STATE_COMPLETED,
+          "Complete rotation of session \"%s\"",
+          session.name);
 
        /*
         * After a rotation has completed, we can expect two notifications to
@@ -392,14 +374,12 @@ int main(int argc, const char *argv[])
         *  - Session rotation ongoing
         *  - Session rotation completed
         */
-       ret = test_rotation_ongoing_notification(notification_channel,
-                       &session);
+       ret = test_rotation_ongoing_notification(notification_channel, &session);
        if (ret) {
                goto error;
        }
 
-       ret = test_rotation_completed_notification(notification_channel,
-                       &session);
+       ret = test_rotation_completed_notification(notification_channel, &session);
        if (ret) {
                goto error;
        }
index 009473893b9fb37e004a5936580c9063f47ef5ea..3a195c12b932c6c50a0dd497e4a759441ad2d75c 100644 (file)
@@ -9,22 +9,21 @@
  *
  */
 
-#include <stddef.h>
+#include <lttng/lttng.h>
+
 #include <stdbool.h>
+#include <stddef.h>
 #include <tap/tap.h>
 
-#include <lttng/lttng.h>
-
 #define NUM_TESTS 26
 
 #define SIZE_THRESHOLD_BYTES 1024
-#define PERIODIC_TIME_US 1000000
+#define PERIODIC_TIME_US     1000000
 
 const char *session_name;
 
-static
-bool schedules_equal(const struct lttng_rotation_schedule *a,
-               const struct lttng_rotation_schedule *b)
+static bool schedules_equal(const struct lttng_rotation_schedule *a,
+                           const struct lttng_rotation_schedule *b)
 {
        bool equal = false;
        enum lttng_rotation_schedule_type a_type, b_type;
@@ -34,22 +33,19 @@ bool schedules_equal(const struct lttng_rotation_schedule *a,
        a_type = lttng_rotation_schedule_get_type(a);
        b_type = lttng_rotation_schedule_get_type(b);
        if (a_type != b_type) {
-               diag("Schedules are not of the same type (%i != %i)",
-                               a_type, b_type);
+               diag("Schedules are not of the same type (%i != %i)", a_type, b_type);
                goto end;
        }
 
        switch (a_type) {
        case LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD:
        {
-               status = lttng_rotation_schedule_size_threshold_get_threshold(a,
-                               &a_value);
+               status = lttng_rotation_schedule_size_threshold_get_threshold(a, &a_value);
                if (status != LTTNG_ROTATION_STATUS_OK) {
                        diag("Failed to retrieve size threshold of schedule 'a'");
                        goto end;
                }
-               status = lttng_rotation_schedule_size_threshold_get_threshold(b,
-                               &b_value);
+               status = lttng_rotation_schedule_size_threshold_get_threshold(b, &b_value);
                if (status != LTTNG_ROTATION_STATUS_OK) {
                        diag("Failed to retrieve size threshold of schedule 'b'");
                        goto end;
@@ -58,14 +54,12 @@ bool schedules_equal(const struct lttng_rotation_schedule *a,
        }
        case LTTNG_ROTATION_SCHEDULE_TYPE_PERIODIC:
        {
-               status = lttng_rotation_schedule_periodic_get_period(a,
-                               &a_value);
+               status = lttng_rotation_schedule_periodic_get_period(a, &a_value);
                if (status != LTTNG_ROTATION_STATUS_OK) {
                        diag("Failed to retrieve period of schedule 'a'");
                        goto end;
                }
-               status = lttng_rotation_schedule_periodic_get_period(b,
-                               &b_value);
+               status = lttng_rotation_schedule_periodic_get_period(b, &b_value);
                if (status != LTTNG_ROTATION_STATUS_OK) {
                        diag("Failed to retrieve period of schedule 'b'");
                        goto end;
@@ -85,8 +79,7 @@ end:
        return equal;
 }
 
-static
-void test_add_null_session(void)
+static void test_add_null_session(void)
 {
        enum lttng_rotation_status status;
        struct lttng_rotation_schedule *size_schedule = NULL;
@@ -95,49 +88,43 @@ void test_add_null_session(void)
 
        status = lttng_session_add_rotation_schedule(NULL, size_schedule);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "NULL session name rejected by lttng_session_add_rotation_schedule()");
+          "NULL session name rejected by lttng_session_add_rotation_schedule()");
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
-static
-void test_add_null_schedule(void)
+static void test_add_null_schedule(void)
 {
        enum lttng_rotation_status status;
 
        status = lttng_session_add_rotation_schedule(session_name, NULL);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "NULL schedule rejected by lttng_session_add_rotation_schedule()");
+          "NULL schedule rejected by lttng_session_add_rotation_schedule()");
 }
 
-static
-void test_add_uninitialized_schedule(void)
+static void test_add_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
-       struct lttng_rotation_schedule *size_schedule = NULL,
-                       *periodic_schedule = NULL;
+       struct lttng_rotation_schedule *size_schedule = NULL, *periodic_schedule = NULL;
 
        size_schedule = lttng_rotation_schedule_size_threshold_create();
        ok(size_schedule, "Created a size threshold session rotation schedule");
 
-       status = lttng_session_add_rotation_schedule(session_name,
-                       size_schedule);
+       status = lttng_session_add_rotation_schedule(session_name, size_schedule);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "Uninitialized size schedule rejected by lttng_session_add_rotation_schedule()");
+          "Uninitialized size schedule rejected by lttng_session_add_rotation_schedule()");
 
        periodic_schedule = lttng_rotation_schedule_periodic_create();
        ok(periodic_schedule, "Created a periodic session rotation schedule");
 
-       status = lttng_session_add_rotation_schedule(session_name,
-                       periodic_schedule);
+       status = lttng_session_add_rotation_schedule(session_name, periodic_schedule);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "Uninitialized periodic schedule rejected by lttng_session_add_rotation_schedule()");
+          "Uninitialized periodic schedule rejected by lttng_session_add_rotation_schedule()");
 
        lttng_rotation_schedule_destroy(size_schedule);
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
-static
-void test_remove_null_session(void)
+static void test_remove_null_session(void)
 {
        enum lttng_rotation_status status;
        struct lttng_rotation_schedule *size_schedule = NULL;
@@ -146,71 +133,59 @@ void test_remove_null_session(void)
 
        status = lttng_session_remove_rotation_schedule(NULL, size_schedule);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "NULL session name rejected by lttng_session_remove_rotation_schedule()");
+          "NULL session name rejected by lttng_session_remove_rotation_schedule()");
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
-static
-void test_remove_null_schedule(void)
+static void test_remove_null_schedule(void)
 {
        enum lttng_rotation_status status;
 
        status = lttng_session_remove_rotation_schedule(session_name, NULL);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "NULL schedule rejected by lttng_session_remove_rotation_schedule()");
+          "NULL schedule rejected by lttng_session_remove_rotation_schedule()");
 }
 
-static
-void test_remove_uninitialized_schedule(void)
+static void test_remove_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
-       struct lttng_rotation_schedule *size_schedule = NULL,
-                       *periodic_schedule = NULL;
+       struct lttng_rotation_schedule *size_schedule = NULL, *periodic_schedule = NULL;
 
        size_schedule = lttng_rotation_schedule_size_threshold_create();
-       status = lttng_session_remove_rotation_schedule(session_name,
-                       size_schedule);
+       status = lttng_session_remove_rotation_schedule(session_name, size_schedule);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "Uninitialized size schedule rejected by lttng_session_remove_rotation_schedule()");
+          "Uninitialized size schedule rejected by lttng_session_remove_rotation_schedule()");
 
        periodic_schedule = lttng_rotation_schedule_periodic_create();
-       status = lttng_session_remove_rotation_schedule(session_name,
-                       periodic_schedule);
+       status = lttng_session_remove_rotation_schedule(session_name, periodic_schedule);
        ok(status == LTTNG_ROTATION_STATUS_INVALID,
-                       "Uninitialized periodic schedule rejected by lttng_session_remove_rotation_schedule()");
+          "Uninitialized periodic schedule rejected by lttng_session_remove_rotation_schedule()");
 
        lttng_rotation_schedule_destroy(size_schedule);
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
-static
-void test_uninitialized_schedule_get(void)
+static void test_uninitialized_schedule_get(void)
 {
        uint64_t value;
        enum lttng_rotation_status status;
-       struct lttng_rotation_schedule *size_schedule = NULL,
-                       *periodic_schedule = NULL;
+       struct lttng_rotation_schedule *size_schedule = NULL, *periodic_schedule = NULL;
 
        size_schedule = lttng_rotation_schedule_size_threshold_create();
        periodic_schedule = lttng_rotation_schedule_periodic_create();
 
-       status = lttng_rotation_schedule_size_threshold_get_threshold(
-                       size_schedule, &value);
+       status = lttng_rotation_schedule_size_threshold_get_threshold(size_schedule, &value);
        ok(status == LTTNG_ROTATION_STATUS_UNAVAILABLE,
-                       "Getter on size threshold rotation schedule returns LTTNG_ROTATION_STATUS_UNAVAILABLE by default");
-       status = lttng_rotation_schedule_periodic_get_period(periodic_schedule,
-                       &value);
+          "Getter on size threshold rotation schedule returns LTTNG_ROTATION_STATUS_UNAVAILABLE by default");
+       status = lttng_rotation_schedule_periodic_get_period(periodic_schedule, &value);
        ok(status == LTTNG_ROTATION_STATUS_UNAVAILABLE,
-                       "Getter on periodic rotation schedule returns LTTNG_ROTATION_STATUS_UNAVAILABLE by default");
+          "Getter on periodic rotation schedule returns LTTNG_ROTATION_STATUS_UNAVAILABLE by default");
 
        lttng_rotation_schedule_destroy(size_schedule);
        lttng_rotation_schedule_destroy(periodic_schedule);
-
 }
 
-static
-void test_add_list_remove_schedule(
-               const struct lttng_rotation_schedule *original_schedule)
+static void test_add_list_remove_schedule(const struct lttng_rotation_schedule *original_schedule)
 {
        int ret;
        unsigned int schedules_count = 0;
@@ -218,68 +193,57 @@ void test_add_list_remove_schedule(
        const struct lttng_rotation_schedule *list_schedule;
        struct lttng_rotation_schedules *list_schedules;
 
-       status = lttng_session_add_rotation_schedule(session_name,
-                       original_schedule);
+       status = lttng_session_add_rotation_schedule(session_name, original_schedule);
        ok(status == LTTNG_ROTATION_STATUS_OK,
-                       "Add a rotation schedule to session \'%s\'",
-                       session_name);
+          "Add a rotation schedule to session \'%s\'",
+          session_name);
 
-       ret = lttng_session_list_rotation_schedules(session_name,
-                       &list_schedules);
+       ret = lttng_session_list_rotation_schedules(session_name, &list_schedules);
        ok(ret == LTTNG_OK && list_schedules,
-                       "List rotation schedules of session \'%s\'",
-                       session_name);
+          "List rotation schedules of session \'%s\'",
+          session_name);
 
-       status = lttng_rotation_schedules_get_count(list_schedules,
-                       &schedules_count);
+       status = lttng_rotation_schedules_get_count(list_schedules, &schedules_count);
        ok(status == LTTNG_ROTATION_STATUS_OK && schedules_count == 1,
-                       "Listing returned 1 rotation schedule");
+          "Listing returned 1 rotation schedule");
 
-       list_schedule = lttng_rotation_schedules_get_at_index(list_schedules,
-                       0);
-       ok(list_schedule,
-                       "Obtain the first schedule of a schedules list");
+       list_schedule = lttng_rotation_schedules_get_at_index(list_schedules, 0);
+       ok(list_schedule, "Obtain the first schedule of a schedules list");
 
        ok(schedules_equal(original_schedule, list_schedule),
-                       "Schedule returned by the listing is equal to the reference schedule that was added");
+          "Schedule returned by the listing is equal to the reference schedule that was added");
 
-       status = lttng_session_remove_rotation_schedule(session_name,
-                       list_schedule);
+       status = lttng_session_remove_rotation_schedule(session_name, list_schedule);
        ok(status == LTTNG_ROTATION_STATUS_OK,
-                       "Remove rotation schedule returned by the schedules listing");
+          "Remove rotation schedule returned by the schedules listing");
        lttng_rotation_schedules_destroy(list_schedules);
 
-       (void) lttng_session_list_rotation_schedules(session_name,
-                       &list_schedules);
-       status = lttng_rotation_schedules_get_count(list_schedules,
-                       &schedules_count);
+       (void) lttng_session_list_rotation_schedules(session_name, &list_schedules);
+       status = lttng_rotation_schedules_get_count(list_schedules, &schedules_count);
        ok(status == LTTNG_ROTATION_STATUS_OK && schedules_count == 0,
-                       "Listing returned 0 rotation schedules after removal");
+          "Listing returned 0 rotation schedules after removal");
        lttng_rotation_schedules_destroy(list_schedules);
 }
 
-static
-void test_add_list_remove_size_schedule(void)
+static void test_add_list_remove_size_schedule(void)
 {
        struct lttng_rotation_schedule *size_schedule;
 
        diag("Add, list, and remove a size threshold rotation schedule");
        size_schedule = lttng_rotation_schedule_size_threshold_create();
-       (void) lttng_rotation_schedule_size_threshold_set_threshold(
-                       size_schedule, SIZE_THRESHOLD_BYTES);
+       (void) lttng_rotation_schedule_size_threshold_set_threshold(size_schedule,
+                                                                   SIZE_THRESHOLD_BYTES);
        test_add_list_remove_schedule(size_schedule);
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
-static
-void test_add_list_remove_periodic_schedule(void)
+static void test_add_list_remove_periodic_schedule(void)
 {
        struct lttng_rotation_schedule *periodic_schedule;
 
        diag("Add, list, and remove a periodic rotation schedule");
        periodic_schedule = lttng_rotation_schedule_periodic_create();
-       (void) lttng_rotation_schedule_periodic_set_period(
-                       periodic_schedule, PERIODIC_TIME_US);
+       (void) lttng_rotation_schedule_periodic_set_period(periodic_schedule, PERIODIC_TIME_US);
        test_add_list_remove_schedule(periodic_schedule);
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
index 11e9206964b80974dffbabbf1e77d30afa61eb3f..b656d726bdc5e88c425136d954e78814152ba789 100644 (file)
@@ -5,6 +5,11 @@
  *
  */
 
+#include "utils.h"
+
+#include <lttng/condition/event-rule-matches.h>
+#include <lttng/lttng.h>
+
 #include <getopt.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <sys/time.h>
 #include <time.h>
 
-#include <lttng/condition/event-rule-matches.h>
-#include <lttng/lttng.h>
-
-#include "utils.h"
-
-static struct option long_options[] =
-{
+static struct option long_options[] = {
        /* These options set a flag. */
-       {"trigger", required_argument, 0, 't'},
-       {"sync-after-notif-register", required_argument, 0, 'a'},
+       { "trigger", required_argument, 0, 't' },
+       { "sync-after-notif-register", required_argument, 0, 'a' },
        /* Default alue for count is 1 */
-       {"count", required_argument, 0, 'b'},
+       { "count", required_argument, 0, 'b' },
        /*
         * When end-trigger is present the reception loop is exited only when a
         * notification matching the end trigger is received.
         * Otherwise the loop is exited when the count of notification received
         * for `trigger` math the `count` argument.
         */
-       {"end-trigger", required_argument, 0, 'c'},
-       {0, 0, 0, 0}
+       { "end-trigger", required_argument, 0, 'c' },
+       { 0, 0, 0, 0 }
 };
 
-static bool action_list_contains_notify(
-               const struct lttng_action *action_list)
+static bool action_list_contains_notify(const struct lttng_action *action_list)
 {
        unsigned int i, count;
-       enum lttng_action_status status =
-                       lttng_action_list_get_count(action_list, &count);
+       enum lttng_action_status status = lttng_action_list_get_count(action_list, &count);
 
        if (status != LTTNG_ACTION_STATUS_OK) {
                printf("Failed to get action count from action list\n");
@@ -49,11 +46,8 @@ static bool action_list_contains_notify(
        }
 
        for (i = 0; i < count; i++) {
-               const struct lttng_action *action =
-                               lttng_action_list_get_at_index(
-                                               action_list, i);
-               const enum lttng_action_type action_type =
-                               lttng_action_get_type(action);
+               const struct lttng_action *action = lttng_action_list_get_at_index(action_list, i);
+               const enum lttng_action_type action_type = lttng_action_get_type(action);
 
                if (action_type == LTTNG_ACTION_TYPE_NOTIFY) {
                        return true;
@@ -64,7 +58,7 @@ static bool action_list_contains_notify(
 
 /* Only expects named triggers. */
 static bool is_trigger_name(const char *expected_trigger_name,
-               struct lttng_notification *notification)
+                           struct lttng_notification *notification)
 {
        const char *trigger_name = NULL;
        enum lttng_trigger_status trigger_status;
@@ -87,8 +81,10 @@ static bool is_trigger_name(const char *expected_trigger_name,
 
        names_match = strcmp(expected_trigger_name, trigger_name) == 0;
        if (!names_match) {
-               fprintf(stderr, "Got an unexpected trigger name: name = '%s', expected name = '%s'\n",
-                               trigger_name, expected_trigger_name);
+               fprintf(stderr,
+                       "Got an unexpected trigger name: name = '%s', expected name = '%s'\n",
+                       trigger_name,
+                       expected_trigger_name);
        }
 end:
        return names_match;
@@ -108,8 +104,7 @@ int main(int argc, char **argv)
        struct lttng_notification_channel *notification_channel = NULL;
        int expected_notifications = 1, notification_count = 0;
 
-       while ((option = getopt_long(argc, argv, "a:b:c:t:", long_options,
-                               &option_index)) != -1) {
+       while ((option = getopt_long(argc, argv, "a:b:c:t:", long_options, &option_index)) != -1) {
                switch (option) {
                case 'a':
                        after_notif_register_file_path = strdup(optarg);
@@ -136,9 +131,8 @@ int main(int argc, char **argv)
                goto end;
        }
 
-
-       notification_channel = lttng_notification_channel_create(
-                       lttng_session_daemon_notification_endpoint);
+       notification_channel =
+               lttng_notification_channel_create(lttng_session_daemon_notification_endpoint);
        if (!notification_channel) {
                fprintf(stderr, "Failed to create notification channel\n");
                ret = -1;
@@ -161,14 +155,11 @@ int main(int argc, char **argv)
 
        /* Look for the trigger we want to subscribe to. */
        for (i = 0; i < count; i++) {
-               const struct lttng_trigger *trigger =
-                               lttng_triggers_get_at_index(triggers, i);
+               const struct lttng_trigger *trigger = lttng_triggers_get_at_index(triggers, i);
                const struct lttng_condition *condition =
-                               lttng_trigger_get_const_condition(trigger);
-               const struct lttng_action *action =
-                               lttng_trigger_get_const_action(trigger);
-               const enum lttng_action_type action_type =
-                               lttng_action_get_type(action);
+                       lttng_trigger_get_const_condition(trigger);
+               const struct lttng_action *action = lttng_trigger_get_const_action(trigger);
+               const enum lttng_action_type action_type = lttng_action_get_type(action);
                enum lttng_notification_channel_status channel_status;
                const char *trigger_name = NULL;
 
@@ -176,23 +167,23 @@ int main(int argc, char **argv)
                if (strcmp(trigger_name, expected_trigger_name) != 0) {
                        /* Might match the end event trigger */
                        if (end_trigger_name != NULL &&
-                                       strcmp(trigger_name,
-                                                       end_trigger_name) != 0) {
+                           strcmp(trigger_name, end_trigger_name) != 0) {
                                continue;
                        }
                }
                if (!((action_type == LTTNG_ACTION_TYPE_LIST &&
-                                     action_list_contains_notify(action)) ||
-                                   action_type == LTTNG_ACTION_TYPE_NOTIFY)) {
+                      action_list_contains_notify(action)) ||
+                     action_type == LTTNG_ACTION_TYPE_NOTIFY)) {
                        /* "The action of trigger is not notify, skipping. */
                        continue;
                }
 
-               channel_status = lttng_notification_channel_subscribe(
-                               notification_channel, condition);
+               channel_status =
+                       lttng_notification_channel_subscribe(notification_channel, condition);
                if (channel_status) {
-                       fprintf(stderr, "Failed to subscribe to notifications of trigger \"%s\"\n",
-                                       trigger_name);
+                       fprintf(stderr,
+                               "Failed to subscribe to notifications of trigger \"%s\"\n",
+                               trigger_name);
                        ret = -1;
                        goto end;
                }
@@ -225,10 +216,8 @@ int main(int argc, char **argv)
                struct lttng_notification *notification;
                enum lttng_notification_channel_status channel_status;
 
-               channel_status =
-                               lttng_notification_channel_get_next_notification(
-                                               notification_channel,
-                                               &notification);
+               channel_status = lttng_notification_channel_get_next_notification(
+                       notification_channel, &notification);
                switch (channel_status) {
                case LTTNG_NOTIFICATION_CHANNEL_STATUS_NOTIFICATIONS_DROPPED:
                        printf("Dropped notification\n");
@@ -243,18 +232,17 @@ int main(int argc, char **argv)
                        printf("Notification channel was closed by peer.\n");
                        break;
                default:
-                       fprintf(stderr, "A communication error occurred on the notification channel.\n");
+                       fprintf(stderr,
+                               "A communication error occurred on the notification channel.\n");
                        ret = -1;
                        goto end;
                }
 
                /* Early exit check. */
-               if (end_trigger_name != NULL &&
-                               is_trigger_name(end_trigger_name,
-                                               notification)) {
+               if (end_trigger_name != NULL && is_trigger_name(end_trigger_name, notification)) {
                        /* Exit the loop immediately. */
                        printf("Received end event notification from trigger %s\n",
-                                       end_trigger_name);
+                              end_trigger_name);
                        lttng_notification_destroy(notification);
                        goto evaluate_success;
                }
@@ -266,11 +254,9 @@ int main(int argc, char **argv)
                        goto end;
                }
 
-               printf("Received event notification from trigger %s\n",
-                               expected_trigger_name);
+               printf("Received event notification from trigger %s\n", expected_trigger_name);
                notification_count++;
-               if (end_trigger_name == NULL &&
-                               expected_notifications == notification_count) {
+               if (end_trigger_name == NULL && expected_notifications == notification_count) {
                        /*
                         * Here the loop exit is controlled by the number of
                         * notification and not by the reception of the end
@@ -287,8 +273,10 @@ evaluate_success:
                /* Success */
                ret = 0;
        } else {
-               fprintf(stderr, "Expected %d notification got %d\n",
-                               expected_notifications, notification_count);
+               fprintf(stderr,
+                       "Expected %d notification got %d\n",
+                       expected_notifications,
+                       notification_count);
                ret = 1;
        }
 
index bbde2b7beb9a20331e0544202571de067323c617..d1dcec4347babb87047b9a45a2416bac1b902d31 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(
-               my_provider,
-               my_first_tracepoint,
-               TP_ARGS(
-               int, my_integer_arg,
-               char*, my_string_arg
-       ),
-       TP_FIELDS(
-               ctf_string(my_string_field, my_string_arg)
-               ctf_integer(int, my_integer_field, my_integer_arg)
-       )
-)
+TRACEPOINT_EVENT(my_provider,
+                my_first_tracepoint,
+                TP_ARGS(int, my_integer_arg, char *, my_string_arg),
+                TP_FIELDS(ctf_string(my_string_field, my_string_arg)
+                                  ctf_integer(int, my_integer_field, my_integer_arg)))
 
 #endif /* _TP_H */
 
index a38cd515e217cfaee7cc55845f285790dd8067f2..180712ee8dc19c61371673668300d2ad9321cea7 100644 (file)
  *
  */
 
-#include <stdlib.h>
 #include <common/compat/time.hpp>
-#include <string.h>
-#include <stdio.h>
+
 #include <lttng/lttng-export.h>
 #include <lttng/ust-clock.h>
 
-static
-uint64_t plugin_read64(void)
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static uint64_t plugin_read64(void)
 {
        /* Freeze time */
        return 0;
 }
 
-static
-uint64_t plugin_freq(void)
+static uint64_t plugin_freq(void)
 {
-       return 1000;    /* 1KHz clock (very coarse!) */
+       return 1000; /* 1KHz clock (very coarse!) */
 }
 
-static
-int plugin_uuid(char *uuid)
+static int plugin_uuid(char *uuid)
 {
        const char myuuid[] = "83c63deb-7aa4-48fb-abda-946f400d76e6";
        memcpy(uuid, myuuid, LTTNG_UST_UUID_STR_LEN);
        return 0;
 }
 
-static
-const char *plugin_name(void)
+static const char *plugin_name(void)
 {
        return "lttng_test_clock_override";
 }
 
-static
-const char *plugin_description(void)
+static const char *plugin_description(void)
 {
        return "Freeze time with 1KHz for regression test";
 }
@@ -57,41 +54,39 @@ void lttng_ust_clock_plugin_init(void)
 
        ret = lttng_ust_trace_clock_set_read64_cb(plugin_read64);
        if (ret) {
-               fprintf(stderr, "Error setting clock override read64 callback: %s\n",
+               fprintf(stderr,
+                       "Error setting clock override read64 callback: %s\n",
                        strerror(-ret));
                goto error;
        }
        ret = lttng_ust_trace_clock_set_freq_cb(plugin_freq);
        if (ret) {
-               fprintf(stderr, "Error setting clock override freq callback: %s\n",
-                       strerror(-ret));
+               fprintf(stderr, "Error setting clock override freq callback: %s\n", strerror(-ret));
                goto error;
        }
        ret = lttng_ust_trace_clock_set_uuid_cb(plugin_uuid);
        if (ret) {
-               fprintf(stderr, "Error setting clock override uuid callback: %s\n",
-                       strerror(-ret));
+               fprintf(stderr, "Error setting clock override uuid callback: %s\n", strerror(-ret));
                goto error;
        }
 
        ret = lttng_ust_trace_clock_set_name_cb(plugin_name);
        if (ret) {
-               fprintf(stderr, "Error setting clock override name callback: %s\n",
-                       strerror(-ret));
+               fprintf(stderr, "Error setting clock override name callback: %s\n", strerror(-ret));
                goto error;
        }
 
        ret = lttng_ust_trace_clock_set_description_cb(plugin_description);
        if (ret) {
-               fprintf(stderr, "Error setting clock override description callback: %s\n",
+               fprintf(stderr,
+                       "Error setting clock override description callback: %s\n",
                        strerror(-ret));
                goto error;
        }
 
        ret = lttng_ust_enable_trace_clock_override();
        if (ret) {
-               fprintf(stderr, "Error enabling clock override: %s\n",
-                       strerror(-ret));
+               fprintf(stderr, "Error enabling clock override: %s\n", strerror(-ret));
                goto error;
        }
 
index 44ec182fab47a2e5340d115783ebcea62f69e65e..1ce1b50df81f13a60e1f260f16dc456f3bd647be 100644 (file)
@@ -7,9 +7,9 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
 #include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
index 60fec4a94699121dcce70c0748772960fba346a0..4dea6aa6c786b4c8285d6ba940d9b54d532cc1c3 100644 (file)
 #define _TRACEPOINT_UST_TESTS_DAEMON_H
 
 #include <lttng/tracepoint.h>
+
 #include <sys/types.h>
 
-TRACEPOINT_EVENT(ust_tests_daemon, before_daemon,
-       TP_ARGS(pid_t, pid),
-       TP_FIELDS(
-               ctf_integer(pid_t, pid, pid)
-       )
-)
-
-TRACEPOINT_EVENT(ust_tests_daemon, after_daemon_child,
-       TP_ARGS(pid_t, pid),
-       TP_FIELDS(
-               ctf_integer(pid_t, pid, pid)
-       )
-)
-
-TRACEPOINT_EVENT(ust_tests_daemon, after_daemon_parent,
-       TP_ARGS(),
-       TP_FIELDS()
-)
+TRACEPOINT_EVENT(ust_tests_daemon,
+                before_daemon,
+                TP_ARGS(pid_t, pid),
+                TP_FIELDS(ctf_integer(pid_t, pid, pid)))
+
+TRACEPOINT_EVENT(ust_tests_daemon,
+                after_daemon_child,
+                TP_ARGS(pid_t, pid),
+                TP_FIELDS(ctf_integer(pid_t, pid, pid)))
+
+TRACEPOINT_EVENT(ust_tests_daemon, after_daemon_parent, TP_ARGS(), TP_FIELDS())
 
 #endif /* _TRACEPOINT_UST_TESTS_DAEMON_H */
 
index 1952981f12cdc764029fff2b89b6e80e6b0a14e1..1827fdcc1be6319721a772fb5ea8c961649e2a97 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_exitfast, message,
-               TP_ARGS(char *, text),
-               TP_FIELDS(ctf_string(message, text))
-)
+TRACEPOINT_EVENT(ust_tests_exitfast,
+                message,
+                TP_ARGS(char *, text),
+                TP_FIELDS(ctf_string(message, text)))
 
 TRACEPOINT_LOGLEVEL(ust_tests_exitfast, message, TRACE_INFO)
 
index 7030a293d532db5d81cca4fa96c1948a938b7f55..2387f245e89678e8c71bc59bd6190228f62c11d5 100644 (file)
@@ -7,10 +7,10 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <stdlib.h>
+#include <unistd.h>
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_CREATE_PROBES
index 92c2a630be251893ae8353cfffbb8860e73cacad..fb417717fbda54ac217eb59fc8a994adabb15d3f 100644 (file)
 #define _TRACEPOINT_UST_TESTS_FORK_H
 
 #include <lttng/tracepoint.h>
+
 #include <sys/types.h>
 
-TRACEPOINT_EVENT(ust_tests_fork, before_fork,
-       TP_ARGS(pid_t, pid),
-       TP_FIELDS(
-               ctf_integer(pid_t, pid, pid)
-       )
-)
-
-TRACEPOINT_EVENT(ust_tests_fork, after_fork_child,
-       TP_ARGS(pid_t, pid),
-       TP_FIELDS(
-               ctf_integer(pid_t, pid, pid)
-       )
-)
-
-TRACEPOINT_EVENT(ust_tests_fork, after_fork_parent,
-       TP_ARGS(pid_t, pid),
-       TP_FIELDS(
-               ctf_integer(pid_t, pid, pid)
-       )
-)
-
-TRACEPOINT_EVENT(ust_tests_fork, after_exec,
-       TP_ARGS(pid_t, pid),
-       TP_FIELDS(
-               ctf_integer(pid_t, pid, pid)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_fork,
+                before_fork,
+                TP_ARGS(pid_t, pid),
+                TP_FIELDS(ctf_integer(pid_t, pid, pid)))
+
+TRACEPOINT_EVENT(ust_tests_fork,
+                after_fork_child,
+                TP_ARGS(pid_t, pid),
+                TP_FIELDS(ctf_integer(pid_t, pid, pid)))
+
+TRACEPOINT_EVENT(ust_tests_fork,
+                after_fork_parent,
+                TP_ARGS(pid_t, pid),
+                TP_FIELDS(ctf_integer(pid_t, pid, pid)))
+
+TRACEPOINT_EVENT(ust_tests_fork,
+                after_exec,
+                TP_ARGS(pid_t, pid),
+                TP_FIELDS(ctf_integer(pid_t, pid, pid)))
 
 #endif /* _TRACEPOINT_UST_TESTS_FORK_H */
 
index 80240f1f5da47eb5d676b77cb99da9596717a0e1..c98d7070062197bb1995c5fcc63c415e04e59700 100644 (file)
@@ -9,18 +9,19 @@
  *
  */
 
-#include <stdlib.h>
 #include <common/compat/time.hpp>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
+
 #include <lttng/lttng-export.h>
 #include <lttng/ust-getcpu.h>
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
 static long nprocessors;
 
-static
-int plugin_getcpu(void)
+static int plugin_getcpu(void)
 {
        /* Generate a sequence based on the number of configurated processor
         * by using sequence[i] % nb_configured_processors. Where sequence
@@ -31,26 +32,24 @@ int plugin_getcpu(void)
         * plugin but provide a strong argument of it's validity.
         */
        static int i = 0;
-       static int seq_seed[256] = { 100, 57, 232, 236, 42, 193, 224, 184, 216,
-               150, 92, 91, 108, 118, 55, 243, 65, 101, 209, 0, 147, 36, 29,
-               34, 49, 188, 174, 105, 253, 245, 227, 238, 112, 20, 222, 201,
-               102, 175, 119, 19, 132, 41, 78, 90, 114, 64, 138, 14, 48, 18,
-               162, 85, 204, 124, 133, 73, 172, 106, 241, 126, 28, 104, 111,
-               21, 127, 219, 9, 244, 237, 189, 59, 214, 52, 141, 107, 26, 25,
-               199, 3, 157, 117, 234, 33, 44, 46, 84, 69, 155, 122, 250, 231,
-               86, 239, 76, 190, 120, 1, 94, 206, 8, 148, 159, 167, 215, 164,
-               31, 217, 61, 71, 125, 68, 109, 195, 177, 95, 82, 142, 182, 129,
-               87, 37, 140, 134, 186, 173, 39, 116, 143, 254, 229, 131, 67,
-               121, 192, 240, 15, 221, 30, 242, 185, 80, 170, 135, 51, 187,
-               194, 246, 12, 225, 181, 137, 211, 228, 88, 218, 27, 233, 161,
-               77, 252, 123, 93, 220, 248, 205, 223, 144, 128, 196, 70, 247,
-               210, 178, 203, 154, 24, 169, 149, 163, 35, 7, 151, 103, 197,
-               139, 165, 158, 207, 72, 113, 145, 45, 183, 11, 198, 43, 81, 230,
-               97, 96, 2, 66, 213, 146, 179, 22, 58, 54, 38, 160, 200, 235,
-               226, 156, 56, 208, 249, 32, 176, 168, 110, 191, 79, 152, 115,
-               10, 74, 60, 251, 17, 83, 180, 171, 202, 40, 166, 255, 53, 212,
-               98, 5, 50, 99, 4, 89, 13, 63, 6, 136, 153, 23, 16, 47, 130, 75,
-               62 };
+       static int seq_seed[256] = {
+               100, 57,  232, 236, 42,  193, 224, 184, 216, 150, 92,  91,  108, 118, 55,  243,
+               65,  101, 209, 0,   147, 36,  29,  34,  49,  188, 174, 105, 253, 245, 227, 238,
+               112, 20,  222, 201, 102, 175, 119, 19,  132, 41,  78,  90,  114, 64,  138, 14,
+               48,  18,  162, 85,  204, 124, 133, 73,  172, 106, 241, 126, 28,  104, 111, 21,
+               127, 219, 9,   244, 237, 189, 59,  214, 52,  141, 107, 26,  25,  199, 3,   157,
+               117, 234, 33,  44,  46,  84,  69,  155, 122, 250, 231, 86,  239, 76,  190, 120,
+               1,   94,  206, 8,   148, 159, 167, 215, 164, 31,  217, 61,  71,  125, 68,  109,
+               195, 177, 95,  82,  142, 182, 129, 87,  37,  140, 134, 186, 173, 39,  116, 143,
+               254, 229, 131, 67,  121, 192, 240, 15,  221, 30,  242, 185, 80,  170, 135, 51,
+               187, 194, 246, 12,  225, 181, 137, 211, 228, 88,  218, 27,  233, 161, 77,  252,
+               123, 93,  220, 248, 205, 223, 144, 128, 196, 70,  247, 210, 178, 203, 154, 24,
+               169, 149, 163, 35,  7,   151, 103, 197, 139, 165, 158, 207, 72,  113, 145, 45,
+               183, 11,  198, 43,  81,  230, 97,  96,  2,   66,  213, 146, 179, 22,  58,  54,
+               38,  160, 200, 235, 226, 156, 56,  208, 249, 32,  176, 168, 110, 191, 79,  152,
+               115, 10,  74,  60,  251, 17,  83,  180, 171, 202, 40,  166, 255, 53,  212, 98,
+               5,   50,  99,  4,   89,  13,  63,  6,   136, 153, 23,  16,  47,  130, 75,  62
+       };
        int ret;
 
        ret = seq_seed[i] % nprocessors;
@@ -72,8 +71,7 @@ void lttng_ust_getcpu_plugin_init(void)
 
        ret = lttng_ust_getcpu_override(plugin_getcpu);
        if (ret) {
-               fprintf(stderr, "Error enabling getcpu override: %s\n",
-                       strerror(-ret));
+               fprintf(stderr, "Error enabling getcpu override: %s\n", strerror(-ret));
                goto error;
        }
        return;
index 055d8823e146edd63a2a55b886ec5eb1c71e281c..2306c2da1b8539e3fb1329275dd09138c989d149 100644 (file)
@@ -6,28 +6,26 @@
  *
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <arpa/inet.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <string.h>
-#include <arpa/inet.h>
+#include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #define TRACEPOINT_DEFINE
 #include "tp.h"
 
-static
-void inthandler(int sig __attribute__((unused)))
+static void inthandler(int sig __attribute__((unused)))
 {
 }
 
-static
-int init_int_handler(void)
+static int init_int_handler(void)
 {
        int result;
        struct sigaction act;
@@ -72,8 +70,7 @@ int main(int argc, char **argv)
 
        for (i = 0; i < 1000000; i++) {
                netint = htonl(i);
-               tracepoint(tp, tptest, i, netint, values, text,
-                               strlen(text), dbl, flt);
+               tracepoint(tp, tptest, i, netint, values, text, strlen(text), dbl, flt);
        }
 
        return 0;
index 9c74d8c0aabf856b794d94e4fbf145fb90af11bd..79fcfe57a6f18d53432e6d6789361a36959e0e62 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(tp, tptest,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen, double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
+TRACEPOINT_EVENT(
+       tp,
+       tptest,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
 
 #endif /* _TRACEPOINT_TP_H */
 
index c7aa0d307479b9bf7eed71693e0e9dff703ee3b1..882dbb82f63097641d852b1ae54c361c95277de4 100644 (file)
@@ -7,8 +7,8 @@
 /* This program is used to test malloc instrumentation with libustinstr-malloc.
  */
 
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define N_ITER 1000
 
@@ -19,7 +19,7 @@ int main(void)
        void *ptrs[N_ITER];
 
        for (i = 0; i < N_ITER; i++) {
-               ptrs[i] = malloc(i+1000);
+               ptrs[i] = malloc(i + 1000);
                if (!ptrs[i]) {
                        exit(EXIT_FAILURE);
                }
index 74d1d22a601f11ab7840b59e41a54fa69e82fb52..43b0f641c4f4c8713806b55b822aca8768aa005c 100644 (file)
@@ -6,17 +6,17 @@
  *
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <arpa/inet.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <string.h>
-#include <arpa/inet.h>
+#include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #define TRACEPOINT_DEFINE
 
@@ -48,8 +48,7 @@ int main(int argc, char **argv)
        tracepoint(ust_tests_demo, starting, 123);
        for (i = 0; i < 5; i++) {
                netint = htonl(i);
-               tracepoint(ust_tests_demo2, loop, i, netint, values,
-                          text, strlen(text), dbl, flt);
+               tracepoint(ust_tests_demo2, loop, i, netint, values, text, strlen(text), dbl, flt);
        }
        tracepoint(ust_tests_demo, done, 456);
        tracepoint(ust_tests_demo3, done, 42);
index 627873e4c448f99f2a6b55c687a5640edca18478..f08c407861a62748dd6157e802bd7cb2f48c1372 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_demo, starting,
-       TP_ARGS(int, value),
-       TP_FIELDS(
-               ctf_integer(int, value, value)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_demo,
+                starting,
+                TP_ARGS(int, value),
+                TP_FIELDS(ctf_integer(int, value, value)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo, starting, TRACE_CRIT)
 
-TRACEPOINT_EVENT(ust_tests_demo, done,
-       TP_ARGS(int, value),
-       TP_FIELDS(
-               ctf_integer(int, value, value)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_demo,
+                done,
+                TP_ARGS(int, value),
+                TP_FIELDS(ctf_integer(int, value, value)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo, done, TRACE_CRIT)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO_H */
index b45f3899160220ffc21360d4e0b10edf9a29c7ac..6df9e1c4e0ebe0ba4e4f2da369371d01920dcec6 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_demo2, loop,
-       TP_ARGS(int, anint, int, netint, long *, values,
-                char *, text, size_t, textlen,
-                double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text,
-                            size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text,
-                            size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
+TRACEPOINT_EVENT(
+       ust_tests_demo2,
+       loop,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo2, loop, TRACE_WARNING)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO2_H */
index e220f8bab1a31b9f8cc1116d6467f90a1da9afa0..7d4ca287a7ba4946f572a3ec61deb641280b05e2 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_demo3, done,
-       TP_ARGS(int, value),
-       TP_FIELDS(
-               ctf_integer(int, value, value)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_demo3,
+                done,
+                TP_ARGS(int, value),
+                TP_FIELDS(ctf_integer(int, value, value)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo3, done, TRACE_WARNING)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO3_H */
index 961f2e907c64acb2655200ab6a4655296605f2cb..d17d2bae044e969fcc74dabe0f319ee730800574 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(tp, slow,
-       TP_ARGS(unsigned int, c, const char *, thread_name),
-       TP_FIELDS(
-               ctf_integer(unsigned int, counter, c)
-               ctf_string(th_name, thread_name)
-       )
-)
+TRACEPOINT_EVENT(tp,
+                slow,
+                TP_ARGS(unsigned int, c, const char *, thread_name),
+                TP_FIELDS(ctf_integer(unsigned int, counter, c) ctf_string(th_name, thread_name)))
 
 #endif /* _TRACEPOINT_TP_H */
 
index ed86a0ed975f5fbbc9db3e1e7b4a15c71a72001c..d847e5b668a02129673cbb33eff6564696ac63f4 100644 (file)
@@ -7,14 +7,13 @@
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
+#include "callsites.h"
 #include "probes.h"
 
+#include <pthread.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <time.h>
-#include <pthread.h>
-
-#include "callsites.h"
 
 #ifndef VALUE
 #define VALUE (-1)
@@ -24,4 +23,3 @@ void call_tracepoint(void)
 {
        tracepoint(multi, tp, VALUE);
 }
-
index eb14162489ff07d924d25d0b8ae604206ce08ea0..155ef81ae27ebc6ba7c699916129ab48425fc915 100644 (file)
@@ -6,10 +6,10 @@
  */
 
 #include <dlfcn.h>
+#include <popt.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <popt.h>
 
 #if HAS_CALLSITES
 #include "callsites.h"
@@ -23,19 +23,20 @@ void exec_callsite(void)
 #endif
 }
 
-static
-void print_list(void)
+static void print_list(void)
 {
        fprintf(stderr, "Test list (-t X):\n");
-       fprintf(stderr, "\t0: dlopen() all libraries pass in arguments and execute "
-                       "the callsite.\n");
-       fprintf(stderr, "\t1: simulate the upgrade of a probe provider using dlopen() and dlclose(). \n");
-       fprintf(stderr, "\t2: simulate the upgrade of a library containing the callsites using dlopen() and dlclose(). \n");
+       fprintf(stderr,
+               "\t0: dlopen() all libraries pass in arguments and execute "
+               "the callsite.\n");
+       fprintf(stderr,
+               "\t1: simulate the upgrade of a probe provider using dlopen() and dlclose(). \n");
+       fprintf(stderr,
+               "\t2: simulate the upgrade of a library containing the callsites using dlopen() and dlclose(). \n");
 }
 
 #if HAS_CALLSITES
-static
-int dl_open_all(int nb_libraries, char **libraries)
+static int dl_open_all(int nb_libraries, char **libraries)
 {
        int i, ret = 0;
        void **handles;
@@ -65,8 +66,7 @@ error:
  * Takes 2 paths to libraries, dlopen() the first, trace, dlopen() the second,
  * and dlclose the first to simulate the upgrade of a library.
  */
-static
-int upgrade_lib(int nb_libraries, char **libraries)
+static int upgrade_lib(int nb_libraries, char **libraries)
 {
        int i, ret = 0;
        void *handles[2];
@@ -104,8 +104,7 @@ error:
  * Simulate the upgrade of a library containing a callsite.
  * Receives two libraries containing callsites for the same tracepoint.
  */
-static
-int upgrade_callsite(int nb_libraries, char **libraries)
+static int upgrade_callsite(int nb_libraries, char **libraries)
 {
        int ret = 0;
        void *handles[2];
@@ -175,10 +174,9 @@ int main(int argc, const char **argv)
        char **libraries = NULL;
        poptContext optCon;
        struct poptOption optionsTable[] = {
-                       { "test", 't', POPT_ARG_INT, &test, 0, "Test to run", NULL },
-                       { "list", 'l', 0, 0, 'l', "List of tests (-t X)", NULL },
-                       POPT_AUTOHELP
-                       { NULL, 0, 0, NULL, 0, NULL, NULL }
+               { "test", 't', POPT_ARG_INT, &test, 0, "Test to run", NULL },
+               { "list", 'l', 0, 0, 'l', "List of tests (-t X)", NULL },
+               POPT_AUTOHELP{ NULL, 0, 0, NULL, 0, NULL, NULL }
        };
 
        optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
@@ -189,7 +187,7 @@ int main(int argc, const char **argv)
        }
 
        while ((c = poptGetNextOpt(optCon)) >= 0) {
-               switch(c) {
+               switch (c) {
                case 'l':
                        print_list();
                        goto error;
@@ -212,29 +210,35 @@ int main(int argc, const char **argv)
                libraries[nb_libraries - 1] = (char *) poptGetArg(optCon);
        }
 
-       switch(test) {
+       switch (test) {
        case 0:
 #if HAS_CALLSITES
                ret = dl_open_all(nb_libraries, libraries);
 #else
-               fprintf(stderr, "Test not implemented for configuration "
-                               "(HAS_CALLSITES=%d)\n", HAS_CALLSITES == 1);
+               fprintf(stderr,
+                       "Test not implemented for configuration "
+                       "(HAS_CALLSITES=%d)\n",
+                       HAS_CALLSITES == 1);
 #endif
                break;
        case 1:
 #if HAS_CALLSITES
                ret = upgrade_lib(nb_libraries, libraries);
 #else
-               fprintf(stderr, "Test not implemented for configuration "
-                               "(HAS_CALLSITES=%d)\n", HAS_CALLSITES == 1);
+               fprintf(stderr,
+                       "Test not implemented for configuration "
+                       "(HAS_CALLSITES=%d)\n",
+                       HAS_CALLSITES == 1);
 #endif
                break;
        case 2:
 #if !HAS_CALLSITES
                ret = upgrade_callsite(nb_libraries, libraries);
 #else
-               fprintf(stderr, "Test not implemented for configuration "
-                               "(HAS_CALLSITES=%d)\n", HAS_CALLSITES == 1);
+               fprintf(stderr,
+                       "Test not implemented for configuration "
+                       "(HAS_CALLSITES=%d)\n",
+                       HAS_CALLSITES == 1);
 #endif
                break;
        default:
index 05bab2dd7c5963199cd8f12098e8e53c5b4c0bb5..d58fa26847a7cedc032f80111688f6315c3afdea 100644 (file)
 #define PROBES_H
 
 #include <lttng/tracepoint.h>
+
 #include <stdint.h>
 
 #if defined(ACTIVATE_PROBES_A)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer(uint64_t, arg_long_A, arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_integer(uint64_t, arg_long_A, arg)))
 #elif defined(ACTIVATE_PROBES_B)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer(uint64_t, arg_long_B, arg)
-               ctf_float(float, arg_float_B, (float) arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_integer(uint64_t, arg_long_B, arg)
+                                  ctf_float(float, arg_float_B, (float) arg)))
 #elif defined(ACTIVATE_PROBES_C)
-TRACEPOINT_ENUM(multi, enum_a,
-       TP_ENUM_VALUES(
-               ctf_enum_value("FIELD_A", 0)
-               ctf_enum_value("FIELD_B", 1)
-               ctf_enum_range("RANGE_C", 2, 10)
-       )
-)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_enum(multi, enum_a, int16_t, enum_short_C,  0)
-               ctf_enum(multi, enum_a, int32_t, enum_int_C,  1)
-               ctf_enum(multi, enum_a, uint64_t, enum_long_C,  2)
-       )
-)
+TRACEPOINT_ENUM(multi,
+               enum_a,
+               TP_ENUM_VALUES(ctf_enum_value("FIELD_A", 0) ctf_enum_value("FIELD_B", 1)
+                                      ctf_enum_range("RANGE_C", 2, 10)))
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_enum(multi, enum_a, int16_t, enum_short_C, 0)
+                                  ctf_enum(multi, enum_a, int32_t, enum_int_C, 1)
+                                          ctf_enum(multi, enum_a, uint64_t, enum_long_C, 2)))
 #elif defined(ACTIVATE_PROBES_D)
-TRACEPOINT_ENUM(multi, enum_a,
-       TP_ENUM_VALUES(
-               ctf_enum_value("FIELD_A", 0)
-               ctf_enum_value("FIELD_B", 1)
-               ctf_enum_range("RANGE_C_PRIME", 2, 10)
-       )
-)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_enum(multi, enum_a, int32_t, enum_int_D,  1)
-               ctf_enum(multi, enum_a, int16_t, enum_short_D,  0)
-               ctf_enum(multi, enum_a, uint64_t, enum_long_D,  2)
-       )
-)
+TRACEPOINT_ENUM(multi,
+               enum_a,
+               TP_ENUM_VALUES(ctf_enum_value("FIELD_A", 0) ctf_enum_value("FIELD_B", 1)
+                                      ctf_enum_range("RANGE_C_PRIME", 2, 10)))
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_enum(multi, enum_a, int32_t, enum_int_D, 1)
+                                  ctf_enum(multi, enum_a, int16_t, enum_short_D, 0)
+                                          ctf_enum(multi, enum_a, uint64_t, enum_long_D, 2)))
 #elif defined(ACTIVATE_PROBES_E)
 /*
  * Here we declare tracepoints really similar to one another but are different.
  * This is meant to test tracepoint comparaison code.
  */
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer(uint64_t, arg_long, arg)
-       )
-)
+TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS(ctf_integer(uint64_t, arg_long, arg)))
 #elif defined(ACTIVATE_PROBES_F)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer(int64_t, arg_long, arg)
-       )
-)
+TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS(ctf_integer(int64_t, arg_long, arg)))
 #elif defined(ACTIVATE_PROBES_G)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer_hex(int64_t, arg_long, arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_integer_hex(int64_t, arg_long, arg)))
 #elif defined(ACTIVATE_PROBES_H)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer_hex(int16_t, arg_long, arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_integer_hex(int16_t, arg_long, arg)))
 #elif defined(ACTIVATE_PROBES_I)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_integer_hex(int32_t, arg_long, arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_integer_hex(int32_t, arg_long, arg)))
 #elif defined(ACTIVATE_PROBES_J)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_float(float, arg_float, (float) arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_float(float, arg_float, (float) arg)))
 #elif defined(ACTIVATE_PROBES_K)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_float(double, arg_float, (double) arg)
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_float(double, arg_float, (double) arg)))
 #elif defined(ACTIVATE_PROBES_L)
-TRACEPOINT_ENUM(multi, enum_a,
-       TP_ENUM_VALUES(
-               ctf_enum_value("FIELD_A", 0)
-               ctf_enum_value("FIELD_B", 1)
-               ctf_enum_range("RANGE_C", 2, 10)
-       )
-)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_enum(multi, enum_a, int32_t, enum_int,  1)
-       )
-)
+TRACEPOINT_ENUM(multi,
+               enum_a,
+               TP_ENUM_VALUES(ctf_enum_value("FIELD_A", 0) ctf_enum_value("FIELD_B", 1)
+                                      ctf_enum_range("RANGE_C", 2, 10)))
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_enum(multi, enum_a, int32_t, enum_int, 1)))
 #elif defined(ACTIVATE_PROBES_M)
-TRACEPOINT_ENUM(multi, enum_a,
-       TP_ENUM_VALUES(
-               ctf_enum_value("FIELD_A", 0)
-               ctf_enum_value("FIELD_B", 1)
-               ctf_enum_range("RANGE_C", 2, 10)
-       )
-)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_enum(multi, enum_a, int64_t, enum_int,  1)
-       )
-)
+TRACEPOINT_ENUM(multi,
+               enum_a,
+               TP_ENUM_VALUES(ctf_enum_value("FIELD_A", 0) ctf_enum_value("FIELD_B", 1)
+                                      ctf_enum_range("RANGE_C", 2, 10)))
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_enum(multi, enum_a, int64_t, enum_int, 1)))
 #elif defined(ACTIVATE_PROBES_N)
-TRACEPOINT_ENUM(multi, enum_a,
-       TP_ENUM_VALUES(
-               ctf_enum_value("FIELD_A", 0)
-               ctf_enum_value("FIELD_B", 1)
-               ctf_enum_range("RANGE_C", 2, 10)
-       )
-)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_enum(multi, enum_a, int16_t, enum_int,  1)
-       )
-)
+TRACEPOINT_ENUM(multi,
+               enum_a,
+               TP_ENUM_VALUES(ctf_enum_value("FIELD_A", 0) ctf_enum_value("FIELD_B", 1)
+                                      ctf_enum_range("RANGE_C", 2, 10)))
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_enum(multi, enum_a, int16_t, enum_int, 1)))
 #elif defined(ACTIVATE_PROBES_O)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_string(arg_string, "string")
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_string(arg_string, "string")))
 #elif defined(ACTIVATE_PROBES_P)
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-               ctf_string(my_arg_string, "string")
-       )
-)
+TRACEPOINT_EVENT(multi,
+                tp,
+                TP_ARGS(uint64_t, arg),
+                TP_FIELDS(ctf_unused(arg) ctf_string(my_arg_string, "string")))
 #else
-TRACEPOINT_EVENT(multi, tp,
-       TP_ARGS(uint64_t, arg),
-       TP_FIELDS(
-               ctf_unused(arg)
-       )
-)
+TRACEPOINT_EVENT(multi, tp, TP_ARGS(uint64_t, arg), TP_FIELDS(ctf_unused(arg)))
 #endif
 
 #endif /* PROBES_H */
index 09fb640a9076c8a585aa08ca7415627ff35eb4cf..09a4683bec1eeae9d0f186a4f5bd43787fa48538 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_gen_nevents, tptest0,
-       TP_ARGS(int, anint, long, value),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer(long, longfield, value)
-       )
-)
-
-TRACEPOINT_EVENT(ust_gen_nevents, tptest1,
-       TP_ARGS(int, anint, long, value),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer(long, longfield, value)
-       )
-)
-
-TRACEPOINT_EVENT(ust_gen_nevents, tptest2,
-       TP_ARGS(int, anint, long, value),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer(long, longfield, value)
-       )
-)
-
-TRACEPOINT_EVENT(ust_gen_nevents, tptest3,
-       TP_ARGS(int, anint, long, value),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer(long, longfield, value)
-       )
-)
+TRACEPOINT_EVENT(ust_gen_nevents,
+                tptest0,
+                TP_ARGS(int, anint, long, value),
+                TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer(long, longfield, value)))
+
+TRACEPOINT_EVENT(ust_gen_nevents,
+                tptest1,
+                TP_ARGS(int, anint, long, value),
+                TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer(long, longfield, value)))
+
+TRACEPOINT_EVENT(ust_gen_nevents,
+                tptest2,
+                TP_ARGS(int, anint, long, value),
+                TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer(long, longfield, value)))
+
+TRACEPOINT_EVENT(ust_gen_nevents,
+                tptest3,
+                TP_ARGS(int, anint, long, value),
+                TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer(long, longfield, value)))
 
 #endif /* _TRACEPOINT_UST_GEN_NEVENTS_H */
 
index 4ca61cd022aa1b2d0f24a522d242d593a81ccb4e..12286293f43214a7a3ed7ba34f1eefe33ce4a5f1 100644 (file)
@@ -6,17 +6,17 @@
  *
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <arpa/inet.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <string.h>
-#include <arpa/inet.h>
+#include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
@@ -44,8 +44,7 @@ int main(int argc, char **argv)
        tracepoint(ust_tests_demo, starting, 123);
        for (i = 0; i < 5; i++) {
                netint = htonl(i);
-               tracepoint(ust_tests_demo2, loop, i, netint, values,
-                          text, strlen(text), dbl, flt);
+               tracepoint(ust_tests_demo2, loop, i, netint, values, text, strlen(text), dbl, flt);
        }
        tracepoint(ust_tests_demo, done, 456);
        tracepoint(ust_tests_demo3, done, 42);
index 8c9c89058be1398064c9b2f8c2ee8880895dfa90..c9d12eaed943050855d0270eb66f4dbb3d0c8650 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_demo, starting,
-       TP_ARGS(int, value),
-       TP_FIELDS(
-               ctf_integer(int, value, value)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_demo,
+                starting,
+                TP_ARGS(int, value),
+                TP_FIELDS(ctf_integer(int, value, value)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo, starting, TRACE_CRIT)
 
 /*
  * Dummy model information, just for example. TODO: we should check if
  * EMF model URI have some standard format we should follow.
  */
-TRACEPOINT_MODEL_EMF_URI(ust_tests_demo, starting,
-       "http://example.com/path_to_model?q=ust_tests_demo:starting")
-
-TRACEPOINT_EVENT(ust_tests_demo, done,
-       TP_ARGS(int, value),
-       TP_FIELDS(
-               ctf_integer(int, value, value)
-       )
-)
+TRACEPOINT_MODEL_EMF_URI(ust_tests_demo,
+                        starting,
+                        "http://example.com/path_to_model?q=ust_tests_demo:starting")
+
+TRACEPOINT_EVENT(ust_tests_demo,
+                done,
+                TP_ARGS(int, value),
+                TP_FIELDS(ctf_integer(int, value, value)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo, done, TRACE_CRIT)
 
-TRACEPOINT_MODEL_EMF_URI(ust_tests_demo, done,
-       "http://example.com/path_to_model?q=ust_tests_demo:done")
+TRACEPOINT_MODEL_EMF_URI(ust_tests_demo,
+                        done,
+                        "http://example.com/path_to_model?q=ust_tests_demo:done")
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO_H */
 
index a8b30e8a11997453ffbb47a986547f12ae17fa88..0c39786b6650e8a6cd5047d02539fa3302e3abc5 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_demo2, loop,
-       TP_ARGS(int, anint, int, netint, long *, values,
-                char *, text, size_t, textlen,
-                double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text,
-                            size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text,
-                            size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
+TRACEPOINT_EVENT(
+       ust_tests_demo2,
+       loop,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo2, loop, TRACE_WARNING)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO2_H */
index 7511c2dc175318431a88d21b2eac982e71c12e35..8018f22acfa26ea0629fd8853a35de40952202ad 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(ust_tests_demo3, done,
-       TP_ARGS(int, value),
-       TP_FIELDS(
-               ctf_integer(int, value, value)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_demo3,
+                done,
+                TP_ARGS(int, value),
+                TP_FIELDS(ctf_integer(int, value, value)))
 TRACEPOINT_LOGLEVEL(ust_tests_demo3, done, TRACE_WARNING)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO3_H */
index d7d2aff73939f408218e3d2eac14d09784ba6a2c..7ac8981ca5132efa3d3c7ebee99de76a726c4e60 100644 (file)
@@ -20,8 +20,8 @@ int main(void)
        int i;
 
        for (i = 0; i < 2; i++) {
-               tracepoint(ust_tests_td, tptest, i % 2, (i+1) % 2, i % 21);
-               tracepoint(ust_tests_td, tptest_bis,  i % 2);
+               tracepoint(ust_tests_td, tptest, i % 2, (i + 1) % 2, i % 21);
+               tracepoint(ust_tests_td, tptest_bis, i % 2);
        }
 
        tracepoint(ust_tests_td, test_auto);
index 84a8f7c32a81dfd6dca2dfe7b3abd35eaf6c79e2..8551b328df106deeb0a982e070fc5b93e11d6dfc 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_ENUM(ust_tests_td, testenum,
-       TP_ENUM_VALUES(
-               ctf_enum_value("zero", 0)
-               ctf_enum_value("one", 1)
-       )
-)
+TRACEPOINT_ENUM(ust_tests_td,
+               testenum,
+               TP_ENUM_VALUES(ctf_enum_value("zero", 0) ctf_enum_value("one", 1)))
 
-TRACEPOINT_ENUM(ust_tests_td, testenum2,
-       TP_ENUM_VALUES(
-               ctf_enum_value("zero", 0)
-               ctf_enum_value("five", 5)
-               ctf_enum_range("ten_to_twenty", 10, 20)
-       )
-)
+TRACEPOINT_ENUM(ust_tests_td,
+               testenum2,
+               TP_ENUM_VALUES(ctf_enum_value("zero", 0) ctf_enum_value("five", 5)
+                                      ctf_enum_range("ten_to_twenty", 10, 20)))
 
-TRACEPOINT_ENUM(ust_tests_td, testenum3,
-       TP_ENUM_VALUES(
-               ctf_enum_auto("zero")
-               ctf_enum_value("two", 2)
-               ctf_enum_auto("three")
-               ctf_enum_range("ten_to_twenty", 10, 20)
-               ctf_enum_auto("twenty_one")
-       )
-)
+TRACEPOINT_ENUM(ust_tests_td,
+               testenum3,
+               TP_ENUM_VALUES(ctf_enum_auto("zero") ctf_enum_value("two", 2) ctf_enum_auto("three")
+                                      ctf_enum_range("ten_to_twenty", 10, 20)
+                                              ctf_enum_auto("twenty_one")))
 
 /*
  * Enumeration field is used twice to make sure the global type declaration
  * is entered only once in the metadata file.
  */
-TRACEPOINT_EVENT(ust_tests_td, tptest,
+TRACEPOINT_EVENT(
+       ust_tests_td,
+       tptest,
        TP_ARGS(int, enumval, int, enumval2, int, enumval3),
        TP_FIELDS(
-               ctf_enum(ust_tests_td, testenum, int, enumfield, enumval)
-               ctf_enum(ust_tests_td, testenum, long long,
-                               enumfield_bis, enumval2)
-               ctf_enum(ust_tests_td, testenum2, unsigned int,
-                               enumfield_third, enumval3)
-       )
-)
+               ctf_enum(ust_tests_td, testenum, int, enumfield, enumval) ctf_enum(
+                       ust_tests_td, testenum, long long, enumfield_bis, enumval2)
+                       ctf_enum(ust_tests_td, testenum2, unsigned int, enumfield_third, enumval3)))
 
 /*
  * Another tracepoint using the global types to make sure each global type is
  * entered only once in the metadata file.
  */
-TRACEPOINT_EVENT(ust_tests_td, tptest_bis,
-       TP_ARGS(int, enumval),
-       TP_FIELDS(
-               ctf_enum(ust_tests_td, testenum, unsigned char,
-                               enumfield, enumval)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_td,
+                tptest_bis,
+                TP_ARGS(int, enumval),
+                TP_FIELDS(ctf_enum(ust_tests_td, testenum, unsigned char, enumfield, enumval)))
 
 /*
  * Test autoincrementing enumeration values.
  */
-TRACEPOINT_EVENT(ust_tests_td, test_auto,
-       TP_ARGS(void),
-       TP_FIELDS(
-               ctf_enum(ust_tests_td, testenum3, int, zero, 0)
-               ctf_enum(ust_tests_td, testenum3, int, two, 2)
-               ctf_enum(ust_tests_td, testenum3, int, three, 3)
-               ctf_enum(ust_tests_td, testenum3, int, fifteen, 15)
-               ctf_enum(ust_tests_td, testenum3, int, twenty_one, 21)
-       )
-)
+TRACEPOINT_EVENT(ust_tests_td,
+                test_auto,
+                TP_ARGS(void),
+                TP_FIELDS(ctf_enum(ust_tests_td, testenum3, int, zero, 0) ctf_enum(
+                        ust_tests_td, testenum3, int, two, 2)
+                                  ctf_enum(ust_tests_td, testenum3, int, three, 3) ctf_enum(
+                                          ust_tests_td, testenum3, int, fifteen, 15)
+                                          ctf_enum(ust_tests_td, testenum3, int, twenty_one, 21)))
 
 #endif /* _TRACEPOINT_UST_TESTS_TD_H */
 
index 13ff1f2d196f1dc2207988d6f908ae56e2a511e9..ef7c68d7d75ce77927dc884354bdedac0fa5f9fa 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(
-    libbar,
-    bar,
-    TP_ARGS(void),
-    TP_FIELDS()
-)
+TRACEPOINT_EVENT(libbar, bar, TP_ARGS(void), TP_FIELDS())
 
 #endif /* _LIBBAR_TP_H */
 
index 1f1a0bbfd3ef0ffb17ff98791529223c4f298f70..7248e5d6f03ed3e8382707f4cae56fe106571453 100644 (file)
@@ -12,4 +12,4 @@
 
 LTTNG_EXPORT int bar(void);
 
-#endif  /* _LIBBAR_H */
+#endif /* _LIBBAR_H */
index c95a0885269f670437e7ebdd4a951ccd93bfd67e..5dcc2507c9af16b37121c3ff66acd7acd0e627ac 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(
-    libfoo,
-    foo,
-    TP_ARGS(void),
-    TP_FIELDS()
-)
+TRACEPOINT_EVENT(libfoo, foo, TP_ARGS(void), TP_FIELDS())
 
 #endif /* _LIBFOO_TP_H */
 
index 3c92464d849f03a1d7a22cf0c2df69aba6f84a9f..908eb1f80891ebe828d010e43b6d25553c4c542e 100644 (file)
@@ -5,8 +5,8 @@
  *
  */
 
-#include "libfoo.h"
 #include "libbar.h"
+#include "libfoo.h"
 
 #define TRACEPOINT_DEFINE
 #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
index 43ae5b9b88f4432a1d1ddfe7c9ee6e70adfc11fb..30e94a0869d8a82025589684c1c926e1639a3568 100644 (file)
@@ -12,4 +12,4 @@
 
 LTTNG_EXPORT int foo(void);
 
-#endif  /* _LIBFOO_H */
+#endif /* _LIBFOO_H */
index c7390fa27731524bdaca23d322b089e81037f52d..17761a422f91a8da5cdc36c48f44310a217f2281 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(
-    libzzz,
-    zzz,
-    TP_ARGS(void),
-    TP_FIELDS()
-)
+TRACEPOINT_EVENT(libzzz, zzz, TP_ARGS(void), TP_FIELDS())
 
 #endif /* _LIBZZZ_TP_H */
 
index e1ea4ce9c5dc726121b38a3b8e63703ea88ddd6f..ba7d84c86a8735af4e889abe112024c4d7a5f867 100644 (file)
@@ -10,4 +10,4 @@
 
 int zzz(void);
 
-#endif  /* _LIBZZZ_H */
+#endif /* _LIBZZZ_H */
index e4288928fad5235245086f8f47087bcb4eb2ab3c..60fb0d1dc9c415f9671a04ae910eb4780c5dd8c7 100644 (file)
@@ -6,12 +6,12 @@
  */
 
 /* _GNU_SOURCE is defined by config.h */
+#include <common/compat/errno.hpp>
+
 #include <dlfcn.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
-
-#include <common/compat/errno.hpp>
+#include <unistd.h>
 
 /*
  * libfoo has a direct dependency on libbar.
index 9f41408bd4c4dd25a729b607b4c276bb115ab27b..a7ec3db2c4ada41c9d23aedb951711818f6e3ca7 100644 (file)
@@ -5,15 +5,15 @@
  * Copyright (C) 2017 Jérémie Galarneau
  */
 
+#include "tap.h"
+
+#include <assert.h>
 #include <ctype.h>
+#include <limits.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <limits.h>
-#include <assert.h>
-
-#include "tap.h"
 
 static int no_plan = 0;
 static int skip_all = 0;
@@ -31,11 +31,11 @@ static int test_died = 0;
 #ifdef HAVE_LIBPTHREAD
 #include <pthread.h>
 static pthread_mutex_t M = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK pthread_mutex_lock(&M);
-# define UNLOCK pthread_mutex_unlock(&M);
+#define LOCK   pthread_mutex_lock(&M);
+#define UNLOCK pthread_mutex_unlock(&M);
 #else
-# define LOCK
-# define UNLOCK
+#define LOCK
+#define UNLOCK
 #endif
 
 static void _expected_tests(unsigned int);
@@ -43,14 +43,14 @@ static void _tap_init(void);
 static void _cleanup(void);
 
 #ifdef __MINGW32__
-static inline
-void flockfile (FILE * filehandle) {
-       return;
+static inline void flockfile(FILE *filehandle)
+{
+       return;
 }
 
-static inline
-void funlockfile(FILE * filehandle) {
-       return;
+static inline void funlockfile(FILE *filehandle)
+{
+       return;
 }
 #endif
 
@@ -61,9 +61,8 @@ void funlockfile(FILE * filehandle) {
  * test_name -- the name of the test, may be NULL
  * test_comment -- a comment to print afterwards, may be NULL
  */
-unsigned int
-_gen_result(int ok, const char *func, const char *file, unsigned int line,
-           const char *test_name, ...)
+unsigned int _gen_result(
+       int ok, const char *func, const char *file, unsigned int line, const char *test_name, ...)
 {
        va_list ap;
        char *local_test_name = NULL;
@@ -76,7 +75,7 @@ _gen_result(int ok, const char *func, const char *file, unsigned int line,
 
        /* Start by taking the test name and performing any printf()
           expansions on it */
-       if(test_name != NULL) {
+       if (test_name != NULL) {
                va_start(ap, test_name);
                if (vasprintf(&local_test_name, test_name, ap) == -1) {
                        local_test_name = NULL;
@@ -86,43 +85,44 @@ _gen_result(int ok, const char *func, const char *file, unsigned int line,
                /* Make sure the test name contains more than digits
                   and spaces.  Emit an error message and exit if it
                   does */
-               if(local_test_name) {
+               if (local_test_name) {
                        name_is_digits = 1;
-                       for(c = local_test_name; *c != '\0'; c++) {
-                               if(!isdigit((unsigned char) *c) && !isspace((unsigned char) *c)) {
+                       for (c = local_test_name; *c != '\0'; c++) {
+                               if (!isdigit((unsigned char) *c) && !isspace((unsigned char) *c)) {
                                        name_is_digits = 0;
                                        break;
                                }
                        }
 
-                       if(name_is_digits) {
-                               diag("    You named your test '%s'.  You shouldn't use numbers for your test names.", local_test_name);
+                       if (name_is_digits) {
+                               diag("    You named your test '%s'.  You shouldn't use numbers for your test names.",
+                                    local_test_name);
                                diag("    Very confusing.");
                        }
                }
        }
 
-       if(!ok) {
+       if (!ok) {
                printf("not ");
                failures++;
        }
 
        printf("ok %d", test_count);
 
-       if(test_name != NULL) {
+       if (test_name != NULL) {
                printf(" - ");
 
                /* Print the test name, escaping any '#' characters it
                   might contain */
-               if(local_test_name != NULL) {
+               if (local_test_name != NULL) {
                        flockfile(stdout);
-                       for(c = local_test_name; *c != '\0'; c++) {
-                               if(*c == '#')
+                       for (c = local_test_name; *c != '\0'; c++) {
+                               if (*c == '#')
                                        fputc('\\', stdout);
-                               fputc((int)*c, stdout);
+                               fputc((int) *c, stdout);
                        }
                        funlockfile(stdout);
-               } else {        /* vasprintf() failed, use a fixed message */
+               } else { /* vasprintf() failed, use a fixed message */
                        printf("%s", todo_msg_fixed);
                }
        }
@@ -134,20 +134,23 @@ _gen_result(int ok, const char *func, const char *file, unsigned int line,
 
           This is not counted as a failure, so decrement the counter if
           the test failed. */
-       if(todo) {
+       if (todo) {
                printf(" # TODO %s", todo_msg ? todo_msg : todo_msg_fixed);
-               if(!ok)
+               if (!ok)
                        failures--;
        }
 
        printf("\n");
 
-       if(!ok) {
-               if(getenv("HARNESS_ACTIVE") != NULL)
+       if (!ok) {
+               if (getenv("HARNESS_ACTIVE") != NULL)
                        fputs("\n", stderr);
 
                diag("    Failed %stest (%s:%s() at line %d)",
-                    todo ? "(TODO) " : "", file, func, line);
+                    todo ? "(TODO) " : "",
+                    file,
+                    func,
+                    line);
        }
        free(local_test_name);
 
@@ -162,12 +165,11 @@ _gen_result(int ok, const char *func, const char *file, unsigned int line,
  * Initialise the TAP library.  Will only do so once, however many times it's
  * called.
  */
-void
-_tap_init(void)
+void _tap_init(void)
 {
        static int run_once = 0;
 
-       if(!run_once) {
+       if (!run_once) {
                atexit(_cleanup);
 
                /* stdout needs to be unbuffered so that the output appears
@@ -181,15 +183,13 @@ _tap_init(void)
 /*
  * Note that there's no plan.
  */
-int
-plan_no_plan(void)
+int plan_no_plan(void)
 {
-
        LOCK;
 
        _tap_init();
 
-       if(have_plan != 0) {
+       if (have_plan != 0) {
                fprintf(stderr, "You tried to plan twice!\n");
                test_died = 1;
                UNLOCK;
@@ -207,10 +207,8 @@ plan_no_plan(void)
 /*
  * Note that the plan is to skip all tests
  */
-int
-plan_skip_all(const char *reason)
+int plan_skip_all(const char *reason)
 {
-
        LOCK;
 
        _tap_init();
@@ -219,7 +217,7 @@ plan_skip_all(const char *reason)
 
        printf("1..0");
 
-       if(reason != NULL)
+       if (reason != NULL)
                printf(" # Skip %s", reason);
 
        printf("\n");
@@ -232,22 +230,20 @@ plan_skip_all(const char *reason)
 /*
  * Note the number of tests that will be run.
  */
-int
-plan_tests(unsigned int tests)
+int plan_tests(unsigned int tests)
 {
-
        LOCK;
 
        _tap_init();
 
-       if(have_plan != 0) {
+       if (have_plan != 0) {
                fprintf(stderr, "You tried to plan twice!\n");
                test_died = 1;
                UNLOCK;
                exit(255);
        }
 
-       if(tests == 0) {
+       if (tests == 0) {
                fprintf(stderr, "You said to run 0 tests!  You've got to run something.\n");
                test_died = 1;
                UNLOCK;
@@ -263,8 +259,7 @@ plan_tests(unsigned int tests)
        return e_tests;
 }
 
-unsigned int
-diag(const char *fmt, ...)
+unsigned int diag(const char *fmt, ...)
 {
        va_list ap;
 
@@ -279,8 +274,7 @@ diag(const char *fmt, ...)
        return 0;
 }
 
-void
-diag_multiline(const char *val)
+void diag_multiline(const char *val)
 {
        size_t len, i, line_start_idx = 0;
 
@@ -301,16 +295,13 @@ diag_multiline(const char *val)
        }
 }
 
-void
-_expected_tests(unsigned int tests)
+void _expected_tests(unsigned int tests)
 {
-
        printf("1..%d\n", tests);
        e_tests = tests;
 }
 
-int
-skip(unsigned int n, const char *fmt, ...)
+int skip(unsigned int n, const char *fmt, ...)
 {
        va_list ap;
        char *skip_msg = NULL;
@@ -323,11 +314,11 @@ skip(unsigned int n, const char *fmt, ...)
        }
        va_end(ap);
 
-       while(n-- > 0) {
+       while (n-- > 0) {
                test_count++;
-               printf("ok %d # skip %s\n", test_count,
-                      skip_msg != NULL ?
-                      skip_msg : "libtap():malloc() failed");
+               printf("ok %d # skip %s\n",
+                      test_count,
+                      skip_msg != NULL ? skip_msg : "libtap():malloc() failed");
        }
 
        free(skip_msg);
@@ -337,8 +328,7 @@ skip(unsigned int n, const char *fmt, ...)
        return 1;
 }
 
-void
-todo_start(const char *fmt, ...)
+void todo_start(const char *fmt, ...)
 {
        va_list ap;
 
@@ -355,10 +345,8 @@ todo_start(const char *fmt, ...)
        UNLOCK;
 }
 
-void
-todo_end(void)
+void todo_end(void)
 {
-
        LOCK;
 
        todo = 0;
@@ -367,22 +355,21 @@ todo_end(void)
        UNLOCK;
 }
 
-int
-exit_status(void)
+int exit_status(void)
 {
        int r;
 
        LOCK;
 
        /* If there's no plan, just return the number of failures */
-       if(no_plan || !have_plan) {
+       if (no_plan || !have_plan) {
                UNLOCK;
                return failures;
        }
 
        /* Ran too many tests?  Return the number of tests that were run
           that shouldn't have been */
-       if(e_tests < test_count) {
+       if (e_tests < test_count) {
                r = test_count - e_tests;
                UNLOCK;
                return r;
@@ -400,51 +387,54 @@ exit_status(void)
  * Cleanup at the end of the run, produce any final output that might be
  * required.
  */
-void
-_cleanup(void)
+void _cleanup(void)
 {
-
        LOCK;
 
        /* If plan_no_plan() wasn't called, and we don't have a plan,
           and we're not skipping everything, then something happened
           before we could produce any output */
-       if(!no_plan && !have_plan && !skip_all) {
+       if (!no_plan && !have_plan && !skip_all) {
                diag("Looks like your test died before it could output anything.");
                UNLOCK;
                return;
        }
 
-       if(test_died) {
+       if (test_died) {
                diag("Looks like your test died just after %d.", test_count);
                UNLOCK;
                return;
        }
 
-
        /* No plan provided, but now we know how many tests were run, and can
           print the header at the end */
-       if(!skip_all && (no_plan || !have_plan)) {
+       if (!skip_all && (no_plan || !have_plan)) {
                printf("1..%d\n", test_count);
        }
 
-       if((have_plan && !no_plan) && e_tests < test_count) {
+       if ((have_plan && !no_plan) && e_tests < test_count) {
                diag("Looks like you planned %d %s but ran %d extra.",
-                    e_tests, e_tests == 1 ? "test" : "tests", test_count - e_tests);
+                    e_tests,
+                    e_tests == 1 ? "test" : "tests",
+                    test_count - e_tests);
                UNLOCK;
                return;
        }
 
-       if((have_plan || !no_plan) && e_tests > test_count) {
+       if ((have_plan || !no_plan) && e_tests > test_count) {
                diag("Looks like you planned %d %s but only ran %d.",
-                    e_tests, e_tests == 1 ? "test" : "tests", test_count);
+                    e_tests,
+                    e_tests == 1 ? "test" : "tests",
+                    test_count);
                UNLOCK;
                return;
        }
 
-       if(failures)
+       if (failures)
                diag("Looks like you failed %d %s of %d.",
-                    failures, failures == 1 ? "test" : "tests", test_count);
+                    failures,
+                    failures == 1 ? "test" : "tests",
+                    test_count);
 
        UNLOCK;
 }
index bc6745a73862040006ab51712ff48ade74d628bb..5da691919f08446fa14d9f58d392faf580fcad58 100644 (file)
@@ -13,74 +13,69 @@ extern "C" {
    and requires the caller to add the final comma if they've ommitted
    the optional arguments */
 #ifdef __GNUC__
-# define ok(e, test, ...) ((e) ?                                       \
-                          _gen_result(1, __func__, __FILE__, __LINE__, \
-                                      test, ## __VA_ARGS__) :          \
-                          _gen_result(0, __func__, __FILE__, __LINE__, \
-                                      test, ## __VA_ARGS__))
-
-# define ok1(e) ((e) ?                                                 \
-                _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
-                _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
-
-# define pass(test, ...) ok(1, test, ## __VA_ARGS__)
-# define fail(test, ...) ok(0, test, ## __VA_ARGS__)
-
-# define skip_start(test, n, fmt, ...)                 \
-       do {                                            \
-               if((test)) {                            \
-                       skip(n, fmt, ## __VA_ARGS__);   \
-                       continue;                       \
+#define ok(e, test, ...)                                                           \
+       ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__) : \
+              _gen_result(0, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__))
+
+#define ok1(e)                                                          \
+       ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
+              _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
+
+#define pass(test, ...) ok(1, test, ##__VA_ARGS__)
+#define fail(test, ...) ok(0, test, ##__VA_ARGS__)
+
+#define skip_start(test, n, fmt, ...)                \
+       do {                                         \
+               if ((test)) {                        \
+                       skip(n, fmt, ##__VA_ARGS__); \
+                       continue;                    \
                }
 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* __GNUC__ */
-# define ok(e, ...) ((e) ?                                             \
-                    _gen_result(1, __func__, __FILE__, __LINE__,       \
-                                __VA_ARGS__) :                         \
-                    _gen_result(0, __func__, __FILE__, __LINE__,       \
-                                __VA_ARGS__))
-
-# define ok1(e) ((e) ?                                                 \
-                _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
-                _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
-
-# define pass(...) ok(1, __VA_ARGS__)
-# define fail(...) ok(0, __VA_ARGS__)
-
-# define skip_start(test, n, ...)                      \
-       do {                                            \
-               if((test)) {                            \
-                       skip(n,  __VA_ARGS__);          \
-                       continue;                       \
+#define ok(e, ...)                                                         \
+       ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, __VA_ARGS__) : \
+              _gen_result(0, __func__, __FILE__, __LINE__, __VA_ARGS__))
+
+#define ok1(e)                                                          \
+       ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
+              _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
+
+#define pass(...) ok(1, __VA_ARGS__)
+#define fail(...) ok(0, __VA_ARGS__)
+
+#define skip_start(test, n, ...)              \
+       do {                                  \
+               if ((test)) {                 \
+                       skip(n, __VA_ARGS__); \
+                       continue;             \
                }
 #else /* __STDC_VERSION__ */
-# error "Needs gcc or C99 compiler for variadic macros."
+#error "Needs gcc or C99 compiler for variadic macros."
 #endif /* __STDC_VERSION__ */
 
-#define skip_end() } while(0);
+#define skip_end() \
+       }          \
+       while (0)  \
+               ;
 
 #ifdef __MINGW_PRINTF_FORMAT
-# define TAP_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
+#define TAP_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
 #else
-# define TAP_PRINTF_FORMAT printf
+#define TAP_PRINTF_FORMAT printf
 #endif
 
-__attribute__((format(TAP_PRINTF_FORMAT, 5, 6)))
-unsigned int _gen_result(int, const char *, const char *, unsigned int, const char *, ...);
+__attribute__((format(TAP_PRINTF_FORMAT, 5, 6))) unsigned int
+_gen_result(int, const char *, const char *, unsigned int, const char *, ...);
 
 int plan_no_plan(void);
-__attribute__((noreturn))
-int plan_skip_all(const char *);
+__attribute__((noreturn)) int plan_skip_all(const char *);
 int plan_tests(unsigned int);
 
-__attribute__((format(TAP_PRINTF_FORMAT, 1, 2)))
-unsigned int diag(const char *, ...);
+__attribute__((format(TAP_PRINTF_FORMAT, 1, 2))) unsigned int diag(const char *, ...);
 void diag_multiline(const char *);
 
-__attribute__((format(TAP_PRINTF_FORMAT, 2, 3)))
-int skip(unsigned int, const char *, ...);
+__attribute__((format(TAP_PRINTF_FORMAT, 2, 3))) int skip(unsigned int, const char *, ...);
 
-__attribute__((format(TAP_PRINTF_FORMAT, 1, 2)))
-void todo_start(const char *, ...);
+__attribute__((format(TAP_PRINTF_FORMAT, 1, 2))) void todo_start(const char *, ...);
 void todo_end(void);
 
 int exit_status(void);
index 5e488f9829df05bac1b387805f36ee11bb733f82..af8b76a17314d96078912f12f05d3167d5a8f2fc 100644 (file)
@@ -6,6 +6,8 @@
  *
  */
 
+#include "utils.h"
+
 #include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
@@ -13,8 +15,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "utils.h"
-
 #define LTTNG_MODULES_FILE "/proc/lttng-test-filter-event"
 
 /*
@@ -31,8 +31,7 @@ int main(int argc, char **argv)
 
        if (argc != 3) {
                fprintf(stderr, "Error: Missing argument\n");
-               fprintf(stderr, "USAGE: %s PATH_WAIT_FILE NR_EVENTS\n",
-                               argv[0]);
+               fprintf(stderr, "USAGE: %s PATH_WAIT_FILE NR_EVENTS\n", argv[0]);
                ret = -1;
                goto end;
        }
index 9d3e030b7f2c0079169a51c34983e14e612e1e84..bee03a42ce2148e0fdb72476eea0d37c5478c367 100644 (file)
@@ -5,6 +5,8 @@
  *
  */
 
+#include "utils.h"
+
 #include <fcntl.h>
 #include <signal.h>
 #include <stdbool.h>
@@ -15,8 +17,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "utils.h"
-
 /**
  * The process waits for the creation of a file passed as argument from an
  * external processes to execute a syscall and exiting. This is useful for tests
 volatile int val = 0;
 
 long nooptimization my_gettid(void);
-long nooptimization
-my_gettid(void)
+long nooptimization my_gettid(void)
 {
-    long ret;
+       long ret;
 #ifdef __x86_64
-    asm volatile
-    (
-        "syscall"
-        : "=a" (ret)
-        : "0"(__NR_gettid)
-        : "cc", "rcx", "r11", "memory"
-    );
+       asm volatile("syscall" : "=a"(ret) : "0"(__NR_gettid) : "cc", "rcx", "r11", "memory");
 #elif defined(__i386)
-    asm volatile
-    (
-        "int $0x80"
-        : "=a" (ret)
-        : "0"(__NR_gettid)
-        : "cc", "edi", "esi", "memory"
-    );
+       asm volatile("int $0x80" : "=a"(ret) : "0"(__NR_gettid) : "cc", "edi", "esi", "memory");
 #else
 #error "Userspace callstack test not supported for this architecture."
 #endif
-    return ret;
+       return ret;
 }
 
 int nooptimization fct_c(void);
-int nooptimization
-fct_c(void)
+int nooptimization fct_c(void)
 {
        return my_gettid();
 }
 
 int nooptimization fct_b(void);
-int nooptimization
-fct_b(void)
+int nooptimization fct_b(void)
 {
        val += fct_c();
        return val;
 }
 
 int nooptimization fct_a(void);
-int nooptimization
-fct_a(void)
+int nooptimization fct_a(void)
 {
        val += fct_b();
        return val;
index b9540e53f6918cc1c222151cb82c12bd6f5dcab5..624bb5c073bf92ddea945d03a852e61ff0cd7e64 100644 (file)
 #if !defined(_TRACEPOINT_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
 #define _TRACEPOINT_TP_H
 
-#include <sys/types.h>
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(tp, tptest,
-       TP_ARGS(ino_t, ns_ino),
-       TP_FIELDS(
-               ctf_integer(ino_t, ns_ino, ns_ino)
-       )
-)
+#include <sys/types.h>
+
+TRACEPOINT_EVENT(tp, tptest, TP_ARGS(ino_t, ns_ino), TP_FIELDS(ctf_integer(ino_t, ns_ino, ns_ino)))
 
 #endif /* _TRACEPOINT_TP_H */
 
index 6f22887cfbac098e907e48dafa6b43c114b62ce9..08c5f92de0105cea2a76745139dc19fe12818c6c 100644 (file)
 #define _TRACEPOINT_TP_H
 
 #include <lttng/tracepoint.h>
+
 #include <stdint.h>
 
-TRACEPOINT_ENUM(
-       tp, tptest_enum,
-       TP_ENUM_VALUES(
-               ctf_enum_auto("AUTO: EXPECT 0")
-               ctf_enum_value("VALUE: 23", 23)
-               ctf_enum_value("VALUE: 27", 27)
-               ctf_enum_auto("AUTO: EXPECT 28")
-               ctf_enum_range("RANGE: 101 TO 303", 101, 303)
-               ctf_enum_auto("AUTO: EXPECT 304")
-               ctf_enum_value("VALUE: -1", -1)
-       )
-)
+TRACEPOINT_ENUM(tp,
+               tptest_enum,
+               TP_ENUM_VALUES(ctf_enum_auto("AUTO: EXPECT 0") ctf_enum_value("VALUE: 23", 23)
+                                      ctf_enum_value("VALUE: 27",
+                                                     27) ctf_enum_auto("AUTO: EXPECT 28")
+                                              ctf_enum_range("RANGE: 101 TO 303", 101, 303)
+                                                      ctf_enum_auto("AUTO: EXPECT 304")
+                                                              ctf_enum_value("VALUE: -1", -1)))
 
-TRACEPOINT_EVENT(tp, tptest,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               char *, etext, uint32_t * , net_values,
-               double, doublearg, float, floatarg),
+TRACEPOINT_EVENT(
+       tp,
+       tptest,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               char *,
+               etext,
+               uint32_t *,
+               net_values,
+               double,
+               doublearg,
+               float,
+               floatarg),
        TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer(int, signedfield, -1)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_array_network(uint32_t, arrfield3, net_values, 3)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_sequence_network(uint32_t, seqfield3, net_values, size_t, 3)
-               ctf_sequence(long, seqfield4, values, size_t, 3)
-               ctf_string(stringfield, text)
-               ctf_string(stringfield2, etext)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-               ctf_enum(tp, tptest_enum, int, enum0, 0)
-               ctf_enum(tp, tptest_enum, int, enum23, 23)
-               ctf_enum(tp, tptest_enum, int, enum27, 27)
-               ctf_enum(tp, tptest_enum, int, enum28, 28)
-               ctf_enum(tp, tptest_enum, int, enum202, 202)
-               ctf_enum(tp, tptest_enum, int, enum304, 304)
-               ctf_enum(tp, tptest_enum, int, enumnegative, -1)
-       )
-)
+               ctf_integer(int, intfield, anint) ctf_integer_hex(int, intfield2, anint) ctf_integer(
+                       long, longfield, anint) ctf_integer(int,
+                                                           signedfield,
+                                                           -1) ctf_integer_network(int,
+                                                                                   netintfield,
+                                                                                   netint)
+                       ctf_integer_network_hex(int, netintfieldhex, netint) ctf_array(
+                               long,
+                               arrfield1,
+                               values,
+                               3) ctf_array_text(char,
+                                                 arrfield2,
+                                                 text,
+                                                 10) ctf_array_network(uint32_t,
+                                                                       arrfield3,
+                                                                       net_values,
+                                                                       3) ctf_sequence(char,
+                                                                                       seqfield1,
+                                                                                       text,
+                                                                                       size_t,
+                                                                                       textlen)
+                               ctf_sequence_text(char,
+                                                 seqfield2,
+                                                 text,
+                                                 size_t,
+                                                 textlen) ctf_sequence_network(uint32_t,
+                                                                               seqfield3,
+                                                                               net_values,
+                                                                               size_t,
+                                                                               3)
+                                       ctf_sequence(long, seqfield4, values, size_t, 3) ctf_string(
+                                               stringfield,
+                                               text) ctf_string(stringfield2,
+                                                                etext) ctf_float(float,
+                                                                                 floatfield,
+                                                                                 floatarg)
+                                               ctf_float(double, doublefield, doublearg) ctf_enum(
+                                                       tp,
+                                                       tptest_enum,
+                                                       int,
+                                                       enum0,
+                                                       0) ctf_enum(tp,
+                                                                   tptest_enum,
+                                                                   int,
+                                                                   enum23,
+                                                                   23) ctf_enum(tp,
+                                                                                tptest_enum,
+                                                                                int,
+                                                                                enum27,
+                                                                                27)
+                                                       ctf_enum(tp, tptest_enum, int, enum28, 28)
+                                                               ctf_enum(tp,
+                                                                        tptest_enum,
+                                                                        int,
+                                                                        enum202,
+                                                                        202) ctf_enum(tp,
+                                                                                      tptest_enum,
+                                                                                      int,
+                                                                                      enum304,
+                                                                                      304)
+                                                                       ctf_enum(tp,
+                                                                                tptest_enum,
+                                                                                int,
+                                                                                enumnegative,
+                                                                                -1)))
 
-TRACEPOINT_EVENT(tp, end,
-       TP_ARGS(),
-       TP_FIELDS(
-       )
-)
+TRACEPOINT_EVENT(tp, end, TP_ARGS(), TP_FIELDS())
 
 #endif /* _TRACEPOINT_TP_H */
 
index b9fe384297ad9ee45450fa9c0b0b1cc4881e62f5..3a4054a84cfd5a45cfeee7feeee8fa21dc6022b6 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(tp, the_string,
-       TP_ARGS(
-               int, i,
-               int, arg_i,
-               const char *, str
-       ),
-       TP_FIELDS(
-               ctf_integer(int, i, i)
-               ctf_integer(long, arg_i, arg_i)
-               ctf_string(str, str)
-       )
-)
+TRACEPOINT_EVENT(tp,
+                the_string,
+                TP_ARGS(int, i, int, arg_i, const char *, str),
+                TP_FIELDS(ctf_integer(int, i, i) ctf_integer(long, arg_i, arg_i)
+                                  ctf_string(str, str)))
 
 #endif /* _TRACEPOINT_TP_H */
 
index 8b68b374df1ed38adc4e26965ce90808a69f6d2f..c9f214ea4e9a3509f8928915443184eb42fd9c43 100644 (file)
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_EVENT(tp, tptest1,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
-TRACEPOINT_EVENT(tp, tptest2,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
-TRACEPOINT_EVENT(tp, tptest3,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
-TRACEPOINT_EVENT(tp, tptest4,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
-TRACEPOINT_EVENT(tp, tptest5,
-       TP_ARGS(int, anint, int, netint, long *, values,
-               char *, text, size_t, textlen,
-               double, doublearg, float, floatarg),
-       TP_FIELDS(
-               ctf_integer(int, intfield, anint)
-               ctf_integer_hex(int, intfield2, anint)
-               ctf_integer(long, longfield, anint)
-               ctf_integer_network(int, netintfield, netint)
-               ctf_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
-               ctf_sequence(char, seqfield1, text, size_t, textlen)
-               ctf_sequence_text(char, seqfield2, text, size_t, textlen)
-               ctf_string(stringfield, text)
-               ctf_float(float, floatfield, floatarg)
-               ctf_float(double, doublefield, doublearg)
-       )
-)
+TRACEPOINT_EVENT(
+       tp,
+       tptest1,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
+TRACEPOINT_EVENT(
+       tp,
+       tptest2,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
+TRACEPOINT_EVENT(
+       tp,
+       tptest3,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
+TRACEPOINT_EVENT(
+       tp,
+       tptest4,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
+TRACEPOINT_EVENT(
+       tp,
+       tptest5,
+       TP_ARGS(int,
+               anint,
+               int,
+               netint,
+               long *,
+               values,
+               char *,
+               text,
+               size_t,
+               textlen,
+               double,
+               doublearg,
+               float,
+               floatarg),
+       TP_FIELDS(ctf_integer(int, intfield, anint) ctf_integer_hex(
+               int, intfield2, anint) ctf_integer(long, longfield, anint)
+                         ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(
+                                 int, netintfieldhex, netint) ctf_array(long, arrfield1, values, 3)
+                                 ctf_array_text(char, arrfield2, text, 10) ctf_sequence(
+                                         char, seqfield1, text, size_t, textlen)
+                                         ctf_sequence_text(char, seqfield2, text, size_t, textlen)
+                                                 ctf_string(stringfield, text)
+                                                         ctf_float(float, floatfield, floatarg)
+                                                                 ctf_float(double,
+                                                                           doublefield,
+                                                                           doublearg)))
 
 #endif /* _TRACEPOINT_TP_H */
 
index ba2c86a39da25e73aa6437bbcce6e1d4b4f548c7..26272e37e4ad599a49acaa66677f8c67bc4c38d3 100644 (file)
 
 static volatile int should_quit;
 
-static
-void sighandler(int sig)
+static void sighandler(int sig)
 {
        if (sig == SIGTERM) {
                should_quit = 1;
        }
 }
 
-static
-int set_signal_handler()
+static int set_signal_handler()
 {
        int ret;
        struct sigaction sa {};
index d530be2691b8cbacbae6db4ca57be36145376293..7a5040051e7314e137b7e22d30ce56f853af0574 100644 (file)
@@ -8,8 +8,8 @@
 #include "foo.h"
 volatile int not_a_function = 0;
 
-void __attribute__ ((noinline)) test_function(void);
-void __attribute__ ((noinline)) test_function(void)
+void __attribute__((noinline)) test_function(void);
+void __attribute__((noinline)) test_function(void)
 {
        not_a_function += 1;
 }
index aa518e425fba349dd93633dbe5fab1b0f1443ad4..05babd4ce723610b817a6effac18500db41d2c7d 100644 (file)
@@ -5,12 +5,9 @@
  *
  */
 
-class test_class
-{
+class test_class {
 public:
        test_class();
        void test_method();
        volatile int test_member;
 };
-
-
index a504ac89e3407b4346b26e080adf7779bd69df21..633fa0561c792a4085a30a4669cd072fa3686258 100644 (file)
@@ -5,8 +5,10 @@
  *
  */
 
-#include <sys/sdt.h>
 #include "foobar_provider.h"
-void bar_function() {
+
+#include <sys/sdt.h>
+void bar_function()
+{
        FOOBAR_TP_IN_DLOPEN();
 }
index 103b3d729285ea637da28ec0ecc4086b37bdbea7..78c79fb84e13e8e4580678178ed9a25f52de63e4 100644 (file)
@@ -5,10 +5,13 @@
  *
  */
 
-#include <sys/sdt.h>
 #include "foobar_provider.h"
-void foo_function() {
+
+#include <sys/sdt.h>
+void foo_function()
+{
        FOOBAR_TP_IN_SHARED_OBJECT();
 }
-void overridable_function() {
+void overridable_function()
+{
 }
index 64660283e4069d781c8f25bc6b904cfc8b721440..ee7599f9e68ff27a7008b53859c3768a5b2ceef3 100644 (file)
@@ -5,8 +5,10 @@
  *
  */
 
-#include <sys/sdt.h>
 #include "foobar_provider.h"
-void overridable_function() {
+
+#include <sys/sdt.h>
+void overridable_function()
+{
        FOOBAR_TP_IN_LDPRELOAD();
 }
index 3126e91ada8212385f0e0b7fe3a2014cc0cb991b..ffe2b5c6016a50355ba5de3d2f2df49b5e4a566d 100644 (file)
@@ -6,7 +6,9 @@
  */
 
 #include "foobar_provider.h"
+
 #include <sys/sdt.h>
-void sema_function() {
+void sema_function()
+{
        FOOBAR_TP_WITH_SEMAPHORE();
 }
index 03bdb3a45f5b63e974c632bfbcce2924a2e48779..c9c8036970638788acbce1c4d91f18c0249ad24a 100644 (file)
@@ -9,20 +9,19 @@
 #define _GNU_SOURCE
 #endif
 
+#include "foobar_provider.h"
+#include "libfoo.h"
+#include "sema.h"
+
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <sys/sdt.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include <sys/sdt.h>
-
-#include "foobar_provider.h"
-#include "libfoo.h"
-#include "sema.h"
-
 int main(int argc, char *argv[])
 {
        void *handle;
@@ -48,7 +47,7 @@ int main(int argc, char *argv[])
                fprintf(stderr, "Can't dlopen libbar.so");
                return -1;
        }
-       bar_function = (void (*)())dlsym(handle, "bar_function");
+       bar_function = (void (*)()) dlsym(handle, "bar_function");
        bar_function();
        dlclose(handle);
 
@@ -68,4 +67,3 @@ int main(int argc, char *argv[])
        sema_function();
        return 0;
 }
-
index 8f04413c6183385740f0b104967de21c4e4ddcde..87b4918def3a9960a230b4ace04ad71b56007128 100644 (file)
@@ -14,7 +14,8 @@
 extern "C" {
 #endif
 
-#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
+#if !defined(__GLIBC__) || \
+       ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
 
 /*
  * Version using XSI strerror_r.
@@ -29,13 +30,12 @@ extern "C" {
 /*
  * Version using GNU strerror_r, for linux with appropriate defines.
  */
-#define PERROR_NO_LOGGER(msg, args...)                                    \
-       do {                                                              \
-               char *_perror_buf;                                        \
-               char _perror_tmp[200];                                    \
-               _perror_buf = strerror_r(                                 \
-                               errno, _perror_tmp, sizeof(_perror_tmp)); \
-               fprintf(stderr, msg ": %s\n", ##args, _perror_buf);       \
+#define PERROR_NO_LOGGER(msg, args...)                                             \
+       do {                                                                       \
+               char *_perror_buf;                                                 \
+               char _perror_tmp[200];                                             \
+               _perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
+               fprintf(stderr, msg ": %s\n", ##args, _perror_buf);                \
        } while (0);
 #endif
 
This page took 0.562353 seconds and 4 git commands to generate.