SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / tests / utils / testapp / gen-ust-nevents-str / gen-ust-nevents-str.c
1 /*
2 * Copyright (C) 2017 Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #define _LGPL_SOURCE
9 #include <stdio.h>
10 #include "signal-helper.h"
11
12 #define TRACEPOINT_DEFINE
13 #include "tp.h"
14
15 int main(int argc, char **argv)
16 {
17 int count = 0, i = 0, arg_i = 0;
18
19 if (set_signal_handler()) {
20 return 1;
21 }
22
23 if (argc <= 3) {
24 fprintf(stderr, "Usage: %s COUNT STRING [STRING]...\n",
25 argv[0]);
26 return 1;
27 }
28
29 if (argc >= 2) {
30 count = atoi(argv[1]);
31 }
32
33 if (count < 0) {
34 return 0;
35 }
36
37 for (i = 0, arg_i = 2; i < count; i++) {
38 tracepoint(tp, the_string, i, arg_i, argv[arg_i]);
39
40 arg_i++;
41 if (arg_i == argc) {
42 arg_i = 2;
43 }
44 if (should_quit) {
45 break;
46 }
47 }
48
49 return 0;
50 }
This page took 0.033383 seconds and 5 git commands to generate.