820937902b70a934cfd791130f87801517214833
2 * Copyright (C) - 2017 Francis Deslauriers <francis.deslauriers@efficios.com>
3 * Copyright (C) - 2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License as published by the
7 * Free Software Foundation; version 2.1 of the License.
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <sys/types.h>
28 #define LTTNG_MODULES_FILE "/proc/lttng-test-filter-event"
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.
36 int main(int argc
, char **argv
)
39 char *start_file
, *nr_events_str
;
43 fprintf(stderr
, "Error: Missing argument\n");
44 fprintf(stderr
, "USAGE: %s PATH_WAIT_FILE NR_EVENTS\n",
51 nr_events_str
= argv
[2];
54 * Wait for the start_file to be created by an external process
55 * (typically the test script) before executing the syscalls.
57 ret
= wait_on_file(start_file
);
63 * Start generating events.
65 fd
= open(LTTNG_MODULES_FILE
, O_RDWR
);
72 len
= write(fd
, nr_events_str
, strlen(nr_events_str
) + 1);
73 if (len
!= strlen(nr_events_str
) + 1) {
82 int closeret
= close(fd
);
This page took 0.036879 seconds and 4 git commands to generate.