afbcf4694783aaa6f19567bd6854b383b80b2d92
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"
24 void inthandler(int sig
__attribute__((unused
)))
26 printf("in SIGUSR1 handler\n");
27 tracepoint(ust_tests_hello
, tptest_sighandler
);
31 int init_int_handler(void)
36 memset(&act
, 0, sizeof(act
));
37 result
= sigemptyset(&act
.sa_mask
);
39 perror("sigemptyset");
43 act
.sa_handler
= inthandler
;
44 act
.sa_flags
= SA_RESTART
;
46 /* Only defer ourselves. Also, try to restart interrupted
47 * syscalls to disturb the traced program as little as possible.
49 result
= sigaction(SIGUSR1
, &act
, NULL
);
58 int main(int argc
, char **argv
)
61 long values
[] = { 1, 2, 3 };
62 char text
[10] = "test";
70 delay
= atoi(argv
[1]);
72 fprintf(stderr
, "Hello, World!\n");
76 fprintf(stderr
, "Tracing... ");
77 for (i
= 0; i
< 1000000; i
++) {
79 tracepoint(ust_tests_hello
, tptest
, i
, netint
, values
,
80 text
, strlen(text
), dbl
, flt
, 15);
83 fprintf(stderr
, " done.\n");
This page took 0.032358 seconds and 5 git commands to generate.