2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2009 Pierre-Marc Fournier
5 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 #include <sys/types.h>
18 * Work-around inet.h missing struct mmsghdr forward declaration, with
19 * triggers a warning when system files warnings are enabled.
22 #include <arpa/inet.h>
26 #define LTTNG_UST_TRACEPOINT_DEFINE
27 #include "ust_tests_hello.h"
30 void inthandler(int sig
__attribute__((unused
)))
32 printf("in SIGUSR1 handler\n");
33 lttng_ust_tracepoint(ust_tests_hello
, tptest_sighandler
);
37 int init_int_handler(void)
42 memset(&act
, 0, sizeof(act
));
43 result
= sigemptyset(&act
.sa_mask
);
45 perror("sigemptyset");
49 act
.sa_handler
= inthandler
;
50 act
.sa_flags
= SA_RESTART
;
52 /* Only defer ourselves. Also, try to restart interrupted
53 * syscalls to disturb the traced program as little as possible.
55 result
= sigaction(SIGUSR1
, &act
, NULL
);
64 int main(int argc
, char **argv
)
67 long values
[] = { 1, 2, 3 };
68 char text
[10] = "test";
72 bool mybool
= 123; /* should print "1" */
77 delay
= atoi(argv
[1]);
79 fprintf(stderr
, "Hello, World!\n");
83 fprintf(stderr
, "Tracing... ");
84 for (i
= 0; i
< 1000000; i
++) {
86 lttng_ust_tracepoint(ust_tests_hello
, tptest
, i
, netint
, values
,
87 text
, strlen(text
), dbl
, flt
, mybool
);
90 fprintf(stderr
, " done.\n");
This page took 0.034068 seconds and 4 git commands to generate.