bc5b68ca639ef5f10375ffccbcb5e2da82a81c30
[lttng-tools.git] / tests / regression / ust / nprocesses / gen-events-time.c
1 /*
2 * Copyright (C) - 2009 Pierre-Marc Fournier
3 * Copyright (C) - 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
5 *
6 * This library is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation; version 2.1 of the License.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include <arpa/inet.h>
21 #include <fcntl.h>
22 #include <signal.h>
23 #include <stdarg.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <sys/mman.h>
28 #include <sys/stat.h>
29 #include <sys/types.h>
30 #include <unistd.h>
31
32 #define TRACEPOINT_DEFINE
33 #include "ust_gen_event.h"
34
35 int main(int argc, char **argv)
36 {
37 int i, netint;
38 long values[] = { 1, 2, 3 };
39 char text[10] = "test";
40 double dbl = 2.0;
41 float flt = 2222.0;
42 /* Default loop time is 60 sec since each round sleeps 1 sec */
43 unsigned int nr_iter = 60;
44
45 fclose(stdout);
46 fclose(stderr);
47 fclose(stdin);
48
49 if (argc == 2) {
50 nr_iter = atoi(argv[1]);
51 }
52
53 for (i = 0; i < nr_iter; i++) {
54 netint = htonl(i);
55 tracepoint(ust_gen_event, tptest, i, netint, values, text,
56 strlen(text), dbl, flt);
57 sleep(1);
58 }
59
60 return 0;
61 }
This page took 0.029444 seconds and 3 git commands to generate.