tests: Move to kernel style SPDX license identifiers
[lttng-tools.git] / tests / regression / ust / exit-fast / exit-fast.c
1 /*
2 * Copyright (C) 2011 Nils Carlson
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 /* This test generates a single event and exits.
9 */
10
11 #include <signal.h>
12 #include <string.h>
13 #include <sys/types.h>
14 #include <unistd.h>
15
16 #define TRACEPOINT_DEFINE
17 #define TRACEPOINT_CREATE_PROBES
18 #include "ust_tests_exitfast.h"
19
20 int main(int argc, char *argv[])
21 {
22 int suicide = 0;
23 char normal_exit_text[] = "exit-fast tracepoint normal exit";
24 char suicide_exit_text[] = "exit-fast tracepoint suicide";
25
26 if (argc > 1 && !strcmp(argv[1], "suicide")) {
27 suicide = 1;
28 }
29
30 if (suicide) {
31 tracepoint(ust_tests_exitfast, message, suicide_exit_text);
32 kill(getpid(), SIGKILL);
33 }
34
35 tracepoint(ust_tests_exitfast, message, normal_exit_text);
36 return 0;
37 }
This page took 0.03023 seconds and 5 git commands to generate.