Fix: kernel snapshot handling of EAGAIN
[lttng-tools.git] / src / common / consumer / consumer-timer.h
CommitLineData
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
d3e2ba59 29#define LTTNG_CONSUMER_SIG_LIVE SIGRTMIN + 12
e9404c27 30#define LTTNG_CONSUMER_SIG_MONITOR SIGRTMIN + 13
13675d0e 31#define LTTNG_CONSUMER_SIG_EXIT SIGRTMIN + 14
331744e3
JD
32
33#define CLOCKID CLOCK_MONOTONIC
34
35/*
36 * Handle timer teardown race wrt memory free of private data by consumer
37 * signals are handled by a single thread, which permits a synchronization
2b8f8754
MD
38 * point between handling of each signal. Internal lock ensures mutual
39 * exclusion.
331744e3
JD
40 */
41struct timer_signal_data {
42 pthread_t tid; /* thread id managing signals */
43 int setup_done;
44 int qs_done;
2b8f8754 45 pthread_mutex_t lock;
331744e3
JD
46};
47
48void consumer_timer_switch_start(struct lttng_consumer_channel *channel,
e9404c27 49 unsigned int switch_timer_interval_us);
331744e3 50void consumer_timer_switch_stop(struct lttng_consumer_channel *channel);
d3e2ba59 51void consumer_timer_live_start(struct lttng_consumer_channel *channel,
e9404c27 52 unsigned int live_timer_interval_us);
d3e2ba59 53void consumer_timer_live_stop(struct lttng_consumer_channel *channel);
e9404c27
JG
54int consumer_timer_monitor_start(struct lttng_consumer_channel *channel,
55 unsigned int monitor_timer_interval_us);
56int consumer_timer_monitor_stop(struct lttng_consumer_channel *channel);
d3e2ba59 57void *consumer_timer_thread(void *data);
73664f81 58int consumer_signal_init(void);
331744e3 59
c585821b
MD
60int consumer_flush_kernel_index(struct lttng_consumer_stream *stream);
61int consumer_flush_ust_index(struct lttng_consumer_stream *stream);
62
e9404c27
JG
63int consumer_timer_thread_get_channel_monitor_pipe(void);
64int consumer_timer_thread_set_channel_monitor_pipe(int fd);
65
331744e3 66#endif /* CONSUMER_TIMER_H */
This page took 0.050189 seconds and 5 git commands to generate.