Commit | Line | Data |
---|---|---|
9d16b343 MJ |
1 | /* |
2 | * Copyright (C) 2011 Nils Carlson | |
ee28adfb | 3 | * |
9d16b343 | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
ee28adfb | 5 | * |
ee28adfb JG |
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 | } |