2 * Copyright (C) - 2017 Francis Deslauriers <francis.deslauriers@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by the
6 * Free Software Foundation; version 2.1 of the License.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <sys/syscall.h>
25 #include <sys/types.h>
31 * The process waits for the creation of a file passed as argument from an
32 * external processes to execute a syscall and exiting. This is useful for tests
33 * in combinaison with LTTng's PID tracker feature where we can trace the kernel
34 * events generated by our test process only.
37 #if defined(__clang__)
38 #define nooptimization __attribute__((noinline)) __attribute__((optnone))
40 #define nooptimization __attribute__((noinline)) __attribute__((optimize(0)))
55 : "cc", "rcx", "r11", "memory"
63 : "cc", "edi", "esi", "memory"
66 #error "Userspace callstack test not supported for this architecture."
91 int main(int argc
, char **argv
)
97 fprintf(stderr
, "Error: Missing argument\n");
98 fprintf(stderr
, "USAGE: %s PATH_WAIT_FILE\n", argv
[0]);
103 start_file
= argv
[1];
106 * Wait for the start_file to be created by an external process
107 * (typically the test script) before executing the syscall
109 ret
= wait_on_file(start_file
);
114 /* Start the callchain to the syscall */
This page took 0.031353 seconds and 4 git commands to generate.