X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Futils%2Ftestapp%2Fuserspace-probe-sdt-binary%2Fuserspace-probe-sdt-binary.c;h=551b42b5a7e33310dd783b6a897de180fa48ea2d;hb=HEAD;hp=03bdb3a45f5b63e974c632bfbcce2924a2e48779;hpb=a12fbf640489be17c800edc1fba9f926b8a1ab8b;p=lttng-tools.git diff --git a/tests/utils/testapp/userspace-probe-sdt-binary/userspace-probe-sdt-binary.c b/tests/utils/testapp/userspace-probe-sdt-binary/userspace-probe-sdt-binary.c index 03bdb3a45..551b42b5a 100644 --- a/tests/utils/testapp/userspace-probe-sdt-binary/userspace-probe-sdt-binary.c +++ b/tests/utils/testapp/userspace-probe-sdt-binary/userspace-probe-sdt-binary.c @@ -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 +#include "foobar_provider.h" +/* clang-format on */ + +#include "libfoo.h" +#include "sema.h" + #include #include #include @@ -17,12 +30,6 @@ #include #include -#include - -#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; } -