06ab9ef825ae20c6c73c08ae7d9091aa0dfceabe
2 * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; version 2.1 of
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #define TRACEPOINT_DEFINE
28 * Thread recording a tracepoint every minute for 20 minutes.
30 static void *th_event_minute(void *data
)
34 /* Loop for 20 minutes */
35 for (i
= 1; i
< 21; i
++) {
36 /* Sleep 60 seconds */
39 /* 20 minutes tracepoint */
41 tracepoint(tp
, slow
, i
, "twenty");
44 /* 10 minutes tracepoint */
46 tracepoint(tp
, slow
, i
, "ten");
49 /* 1 minute tracepoint */
50 tracepoint(tp
, slow
, i
, "one");
59 int main(int argc
, char **argv
)
65 ret
= pthread_create(&thread
, NULL
, th_event_minute
, NULL
);
67 perror("pthread_create event minute");
71 ret
= pthread_join(thread
, &status
);
73 perror("pthread_join");
This page took 0.03086 seconds and 3 git commands to generate.