X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Futils%2Ftestapp%2Fgen-ns-events%2Fgen-ns-events.cpp;h=80afdb6d63ed27c99510c7068436a7539d23bcf2;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hp=7c2b6478c4520f526a9dbca17c7d4d12d1bb650f;hpb=729c1fec5976af17fded2f026725a08ef1924290;p=lttng-tools.git diff --git a/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp b/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp index 7c2b6478c..80afdb6d6 100644 --- a/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp +++ b/tests/utils/testapp/gen-ns-events/gen-ns-events.cpp @@ -18,10 +18,12 @@ #include #include #include +#include -#include +#include +#include -#include "signal-helper.h" +#include "signal-helper.hpp" #include "utils.h" #define LTTNG_PROC_NS_PATH_MAX 40 @@ -71,10 +73,11 @@ static struct poptOption opts[] = { { "after", 'a', POPT_ARG_STRING, &after_unshare_wait_file_path, 0, "Wait for file after unshare", NULL }, { "signal", 's', POPT_ARG_STRING, &after_unshare_signal_file_path, 0, "Create signal file after unshare", NULL }, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, 0, 0, NULL, 0, NULL, NULL } }; -static void debug_printf(const char *format, ...) +static ATTR_FORMAT_PRINTF(1, 2) +void debug_printf(const char *format, ...) { va_list args; va_start(args, format); @@ -130,7 +133,7 @@ static int do_the_needful(int ns_flag, const char *ns_str) ret = -1; goto end; } - debug_printf("Initial %s ns inode number: %lu\n", ns_str, ns1); + debug_printf("Initial %s ns inode number: %" PRIuMAX "\n", ns_str, (uintmax_t) ns1); /* Wait on synchronization before unshare. */ if (before_unshare_wait_file_path) { @@ -153,7 +156,7 @@ static int do_the_needful(int ns_flag, const char *ns_str) ret = -1; goto end; } - debug_printf("Post unshare %s ns inode number: %lu\n", ns_str, ns2); + debug_printf("Post unshare %s ns inode number: %" PRIuMAX "\n", ns_str, (uintmax_t) ns2); /* Signal that the unshare call is completed. */ if (after_unshare_signal_file_path) {