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 TRACEPOINT_DEFINE
27 #include "ust_tests_hello.h"
29 void inthandler(int sig
)
31 printf("in SIGUSR1 handler\n");
32 tracepoint(ust_tests_hello
, tptest_sighandler
);
35 int init_int_handler(void)
40 memset(&act
, 0, sizeof(act
));
41 result
= sigemptyset(&act
.sa_mask
);
43 perror("sigemptyset");
47 act
.sa_handler
= inthandler
;
48 act
.sa_flags
= SA_RESTART
;
50 /* Only defer ourselves. Also, try to restart interrupted
51 * syscalls to disturb the traced program as little as possible.
53 result
= sigaction(SIGUSR1
, &act
, NULL
);
62 void test_inc_count(void);
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 tracepoint(ust_tests_hello
, tptest
, i
, netint
, values
,
87 text
, strlen(text
), dbl
, flt
, mybool
);
90 fprintf(stderr
, " done.\n");
This page took 0.030659 seconds and 4 git commands to generate.