2 * Copyright (C) 2017 Francis Deslauriers <francis.deslauriers@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
14 #include <sys/syscall.h>
15 #include <sys/types.h>
21 * The process waits for the creation of a file passed as argument from an
22 * external processes to execute a syscall and exiting. This is useful for tests
23 * in combinaison with LTTng's PID tracker feature where we can trace the kernel
24 * events generated by our test process only.
27 #if defined(__clang__)
28 #define nooptimization __attribute__((noinline)) __attribute__((optnone))
30 #define nooptimization __attribute__((noinline)) __attribute__((optimize(0)))
35 long nooptimization
my_gettid(void);
46 : "cc", "rcx", "r11", "memory"
54 : "cc", "edi", "esi", "memory"
57 #error "Userspace callstack test not supported for this architecture."
62 int nooptimization
fct_c(void);
69 int nooptimization
fct_b(void);
77 int nooptimization
fct_a(void);
85 int main(int argc
, char **argv
)
91 fprintf(stderr
, "Error: Missing argument\n");
92 fprintf(stderr
, "USAGE: %s PATH_WAIT_FILE\n", argv
[0]);
100 * Wait for the start_file to be created by an external process
101 * (typically the test script) before executing the syscall
103 ret
= wait_on_file(start_file
);
108 /* Start the callchain to the syscall */
This page took 0.032328 seconds and 4 git commands to generate.