.gitignore: ignore local vscode workspace settings file
[lttng-tools.git] / tests / utils / testapp / userspace-probe-sdt-binary / userspace-probe-sdt-binary.c
index 03bdb3a45f5b63e974c632bfbcce2924a2e48779..551b42b5a7e33310dd783b6a897de180fa48ea2d 100644 (file)
@@ -9,6 +9,19 @@
 #define _GNU_SOURCE
 #endif
 
+/*
+ * The order of inclusion is important here: including sdt.h _before_ the probe
+ * declarations ensures that semaphore-protected SDT probes (which we don't support) are not
+ * generated. See SYSTEMTAP(2) for more details.
+ */
+/* clang-format off */
+#include <sys/sdt.h>
+#include "foobar_provider.h"
+/* clang-format on */
+
+#include "libfoo.h"
+#include "sema.h"
+
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <stdbool.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 +55,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 +75,3 @@ int main(int argc, char *argv[])
        sema_function();
        return 0;
 }
-
This page took 0.025193 seconds and 4 git commands to generate.