2 * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
13 #define TRACEPOINT_DEFINE
17 * Thread recording a tracepoint every minute for 20 minutes.
19 static void *th_event_minute(void *data
__attribute__((unused
)))
23 /* Loop for 20 minutes */
24 for (i
= 1; i
< 21; i
++) {
25 /* Sleep 60 seconds */
26 (void) poll(NULL
, 0, 60000);
28 /* 20 minutes tracepoint */
30 tracepoint(tp
, slow
, i
, "twenty");
33 /* 10 minutes tracepoint */
35 tracepoint(tp
, slow
, i
, "ten");
38 /* 1 minute tracepoint */
39 tracepoint(tp
, slow
, i
, "one");
54 ret
= pthread_create(&thread
, NULL
, th_event_minute
, NULL
);
56 perror("pthread_create event minute");
60 ret
= pthread_join(thread
, &status
);
62 perror("pthread_join");
This page took 0.030201 seconds and 4 git commands to generate.