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>
17 #include <arpa/inet.h>
20 #define TRACEPOINT_DEFINE
21 #include "ust_tests_hello.h"
23 void inthandler(int sig
)
25 printf("in SIGUSR1 handler\n");
26 tracepoint(ust_tests_hello
, tptest_sighandler
);
29 int init_int_handler(void)
34 memset(&act
, 0, sizeof(act
));
35 result
= sigemptyset(&act
.sa_mask
);
37 perror("sigemptyset");
41 act
.sa_handler
= inthandler
;
42 act
.sa_flags
= SA_RESTART
;
44 /* Only defer ourselves. Also, try to restart interrupted
45 * syscalls to disturb the traced program as little as possible.
47 result
= sigaction(SIGUSR1
, &act
, NULL
);
56 int main(int argc
, char **argv
)
59 long values
[] = { 1, 2, 3 };
60 char text
[10] = "test";
68 delay
= atoi(argv
[1]);
70 fprintf(stderr
, "Hello, World!\n");
74 fprintf(stderr
, "Tracing... ");
75 for (i
= 0; i
< 1000000; i
++) {
77 tracepoint(ust_tests_hello
, tptest
, i
, netint
, values
,
78 text
, strlen(text
), dbl
, flt
, 15);
81 fprintf(stderr
, " done.\n");
This page took 0.030552 seconds and 4 git commands to generate.