Commit | Line | Data |
---|---|---|
331744e3 JD |
1 | /* |
2 | * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca> | |
3 | * Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
4 | * 2012 - David Goulet <dgoulet@efficios.com> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License, version 2 only, | |
8 | * as published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along | |
16 | * with this program; if not, write to the Free Software Foundation, Inc., | |
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 | */ | |
19 | ||
20 | #ifndef CONSUMER_TIMER_H | |
21 | #define CONSUMER_TIMER_H | |
22 | ||
23 | #include <pthread.h> | |
24 | ||
25 | #include "consumer.h" | |
26 | ||
27 | #define LTTNG_CONSUMER_SIG_SWITCH SIGRTMIN + 10 | |
28 | #define LTTNG_CONSUMER_SIG_TEARDOWN SIGRTMIN + 11 | |
29 | ||
30 | #define CLOCKID CLOCK_MONOTONIC | |
31 | ||
32 | /* | |
33 | * Handle timer teardown race wrt memory free of private data by consumer | |
34 | * signals are handled by a single thread, which permits a synchronization | |
35 | * point between handling of each signal. | |
36 | */ | |
37 | struct timer_signal_data { | |
38 | pthread_t tid; /* thread id managing signals */ | |
39 | int setup_done; | |
40 | int qs_done; | |
41 | }; | |
42 | ||
43 | void consumer_timer_switch_start(struct lttng_consumer_channel *channel, | |
44 | unsigned int switch_timer_interval); | |
45 | void consumer_timer_switch_stop(struct lttng_consumer_channel *channel); | |
46 | void *consumer_timer_metadata_thread(void *data); | |
47 | void consumer_signal_init(void); | |
48 | ||
49 | #endif /* CONSUMER_TIMER_H */ |